Appearance
Paging
Without paging
Leave out page and a call returns every row in the window at once, up to 20,000 rows. Above that you get a 413 with too_many_rows. Narrow from and to, or page.
With paging
Send page (counting from 1) and, if you like, page_size (1 to 1,000, default 1,000).
sh
curl -H "Authorization: Bearer hpk_your_key_here" \
"https://ntnzabbhtivotmfhwdnm.supabase.co/functions/v1/data-api/v1/calendar?page=2&page_size=500"How you know there's more:
| Format | Where |
|---|---|
| JSON | has_more is true, beside page and page_size |
| CSV | The X-Has-More header is true or false |
Keep asking for the next page until has_more is false.
js
const BASE = 'https://ntnzabbhtivotmfhwdnm.supabase.co/functions/v1/data-api/v1'
const headers = { Authorization: `Bearer ${process.env.HOSTPORT_API_KEY}` }
const rows = []
for (let page = 1; ; page++) {
const res = await fetch(`${BASE}/calendar?page=${page}&page_size=1000`, { headers })
if (!res.ok) throw new Error(`Host Port answered ${res.status}`)
const body = await res.json()
rows.push(...body.rows)
if (!body.has_more) break
}Good to know
- Each dataset has a fixed row order, so pages never overlap or skip, as long as the data doesn't change between calls.
has_moreis exact. A full last page still saysfalseif nothing follows.- Every page is one call against the daily limit of 500. Use the biggest page size you can.
