Skip to main content
GET /peek returns the contents of a rectangular cell range in one of three serialization formats. Use it when an agent has already scouted the workbook structure with /schema and needs the actual values from a specific block — for example, the first ten rows of a data table to decide what to compute over.

Request

string
required
An A1-notation range of the form A1:D10. The two corners can be in either order — D10:A1 is normalized to the same rectangle. Both letters and digits are required on each side; bare column or row references (e.g. A:A, 1:10) are not accepted.
string
Name of the sheet to read from. Defaults to the currently active sheet when omitted.
string
default:"csv"
Serialization format. One of:
  • "csv" — comma-separated, with RFC 4180-style quoting for fields containing commas, quotes, or newlines. Returns Content-Type: text/csv.
  • "tsv" — tab-separated, no quoting. Returns Content-Type: text/tab-separated-values.
  • "json" — JSON object with sheet, range, and rows (a 2-D array of values). Returns Content-Type: application/json.

Response

The response shape depends on format. CSV and TSV return the serialized text directly with the appropriate Content-Type. JSON returns a structured object:
string
The sheet that was read.
string
The normalized A1 range that was returned (corners ordered top-left to bottom-right).
array
A 2-D array (array of arrays) of cell values in row-major order. Empty cells are returned as the empty string "". Numeric cells are returned as JSON numbers; string cells as JSON strings; boolean cells as JSON booleans.

HTTP errors

Examples

CSV (default)

Empty cells render as the empty string between the separators (note the trailing comma on the second row when C2 is empty).

TSV

JSON

CSV escaping

Fields containing a comma, double-quote, or newline are wrapped in double quotes, with internal double quotes doubled, following RFC 4180: TSV does not escape — embed tabs at your own risk. JSON is the safest format for pipelines that need to handle arbitrary cell content.
/peek returns each cell’s evaluated value, not its formula text. A cell containing =SUM(A1:A10) returns the computed sum; the formula itself is not exposed through /peek. Use POST /eval when you need to inspect formulas, or GET /api/workbook for a full state dump that includes formula strings.
Use the smallest possible range. The 1000-cell cap is a hard ceiling, but most agents do better with 50-100 cells per peek — that comfortably fits in any model’s context and matches the granularity an LLM can actually reason about.