Skip to main content

Pagination

Sheet Best supports two ways to page through rows: the _limit and _offset query parameters, or short URL suffixes for a single row or a range.

_limit and _offset

ParameterDescription
_limitMaximum number of rows returned
_offsetNumber of rows to skip before reading the sheet
# Skip the first row, then return the next two
curl 'https://api.sheetbest.com/sheets/YOUR_SHEET_ID?_limit=2&_offset=1'

Single row by index

Append /<Row Index> to fetch one row. Indexes are 0-based.

# First row
curl 'https://api.sheetbest.com/sheets/YOUR_SHEET_ID/0'

# Third row
curl 'https://api.sheetbest.com/sheets/YOUR_SHEET_ID/2'

This is equivalent to ?_limit=1&_offset=<Row Index>:

  • https://api.sheetbest.com/sheets/YOUR_SHEET_ID/2
  • https://api.sheetbest.com/sheets/YOUR_SHEET_ID?_limit=1&_offset=2

Range by index

Use /<Start>:<End> to return a range of rows.

# Rows 3 and 4 (0-indexed)
curl 'https://api.sheetbest.com/sheets/YOUR_SHEET_ID/2:4'

Equivalent forms:

  • https://api.sheetbest.com/sheets/YOUR_SHEET_ID/2:4
  • https://api.sheetbest.com/sheets/YOUR_SHEET_ID?_limit=2&_offset=2

Combining with filters and queries

_limit and _offset can be combined with filtering and querying.

# First 10 rows where Name contains "Jane"
curl 'https://api.sheetbest.com/sheets/YOUR_SHEET_ID/Name/*Jane*?_limit=10'

# Page 2 of a query (rows 10-19)
curl 'https://api.sheetbest.com/sheets/YOUR_SHEET_ID/query?Amount=__gt(100)&_limit=10&_offset=10'