Files

Read a text file

Changed on

Returns a small text file, or a range of its lines, for agents that read and edit project files such as scripts, configs, or CSVs. Not meant for large or binary files; download those with GET /files/download.

get/files/content

Request

  • Base URL
    https://api.deepnote.com/v2
  • URL
    https://api.deepnote.com/v2/files/content
  • Auth
    HTTP bearer

Query parameters

projectIdstring uuid required

Project that contains the file.

pathstring required

File path within the project.

startLineinteger

First line to read, starting at 1.

Example:1
endLineinteger

Last line to read, inclusive.

Example:40

Response

File content

contentstring required
startLineinteger required
endLineinteger required
hasMoreboolean required

Whether the file continues after endLine.

Example response

{
  "content": "import streamlit as st\n\nst.title(\"Sales\")\n",
  "startLine": 1,
  "endLine": 3
}

Changes