Paginación
Sheet Best ofrece dos formas de paginar filas: los parámetros de consulta _limit y _offset, o sufijos breves en la URL para una fila o un rango.
_limit y _offset
| Parámetro | Descripción |
|---|---|
_limit | Número máximo de filas devueltas |
_offset | Número de filas que se omiten antes de leer la hoja |
- cURL
- JavaScript
- Python
# Skip the first row, then return the next two
curl 'https://api.sheetbest.com/sheets/YOUR_SHEET_ID?_limit=2&_offset=1'
fetch(
'https://api.sheetbest.com/sheets/YOUR_SHEET_ID?_limit=2&_offset=1'
);
import requests
requests.get(
'https://api.sheetbest.com/sheets/YOUR_SHEET_ID',
params={'_limit': 2, '_offset': 1},
)
Una fila por índice
Añade /<Row Index> para obtener una fila. Los índices empiezan en 0.
# First row
curl 'https://api.sheetbest.com/sheets/YOUR_SHEET_ID/0'
# Third row
curl 'https://api.sheetbest.com/sheets/YOUR_SHEET_ID/2'
Esto equivale a ?_limit=1&_offset=<Row Index>:
https://api.sheetbest.com/sheets/YOUR_SHEET_ID/2https://api.sheetbest.com/sheets/YOUR_SHEET_ID?_limit=1&_offset=2
Un rango por índice
Usa /<Start>:<End> para devolver un rango de filas.
# Rows 3 and 4 (0-indexed)
curl 'https://api.sheetbest.com/sheets/YOUR_SHEET_ID/2:4'
Formas equivalentes:
https://api.sheetbest.com/sheets/YOUR_SHEET_ID/2:4https://api.sheetbest.com/sheets/YOUR_SHEET_ID?_limit=2&_offset=2
Combinar con filtros y consultas
Puedes combinar _limit y _offset con filtros y consultas.
# 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'