Paging records over the API: bookmarks, not page numbers
The records API pages by bookmark, not page number. The loop in bash and Node, page_size from 1 to 1,000, and why there is no jump to page 40.
Updated November 2026
A page of records comes with a bookmark when there are more. Pass it back
unchanged to get the next page. When a response has no bookmark, you have
everything.
The two parameters
page_size=: how many records per page, from 1 to 1,000, with a default of- A value outside that range is a 400:
"page_size" must be a whole number between 1 and 1000.
- A value outside that range is a 400:
bookmark=: the value from the previous response. Treat it as opaque. Don't parse it, don't store it for long, and don't make up your own. A garbage value is a 400 (Invalid bookmark.). A bookmark taken under one set of sort fields is refused under another (Bookmark does not match the sort.), because the bookmark encodes where you are in that ordering. Changingview=between pages counts too, since a view brings its own sort, so finish a walk before you switch, or start the new one without a bookmark. The bookmark records which fields you sorted by but not in which direction, so reversing one partway through (sort=Price, thensort=-Price) isn't caught. Send the samesort=with every page.
Those two are the only paging parameters. Tools that learned on other APIs
often send cursor, offset, page or limit. None of them is a parameter
here, and a parameter the records list doesn't know is ignored, not refused.
So the first page comes back again, at the default size, and you end up with
a loop that never ends or the same records counted twice.
Walking the 14-record demo Plants table at page_size=6 takes three
responses: six records with a bookmark, six more with a bookmark, then two
with none. The last page leaves the key out, and that missing key is the only
sign that you've reached the end.
The loop in bash
TABLE="tbl_jukzu86nxtcj"
BOOKMARK=""
while : ; do
if [ -z "$BOOKMARK" ]; then
PAGE=$(curl -s "https://tabladb.com/api/tables/$TABLE/records?page_size=100" \
-H "Authorization: Bearer key_xxxx.your-secret")
else
PAGE=$(curl -s -G "https://tabladb.com/api/tables/$TABLE/records" \
-H "Authorization: Bearer key_xxxx.your-secret" \
--data-urlencode "page_size=100" --data-urlencode "bookmark=$BOOKMARK")
fi
echo "$PAGE" | jq -r '.records[].id' # do your work here
BOOKMARK=$(echo "$PAGE" | jq -r '.bookmark // empty')
[ -z "$BOOKMARK" ] && break
done
The loop in Node
const KEY = "key_xxxx.your-secret";
const base = "https://tabladb.com/api/tables/tbl_jukzu86nxtcj/records";
async function allRecords() {
const records = [];
let bookmark;
do {
const url = new URL(base);
url.searchParams.set("page_size", "100");
if (bookmark) url.searchParams.set("bookmark", bookmark);
const res = await fetch(url, {
headers: { Authorization: `Bearer ${KEY}` },
});
if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
const page = await res.json();
records.push(...page.records);
bookmark = page.bookmark; // undefined on the last page
} while (bookmark);
return records;
}
We ran both loops as printed (against the demo table), and each returned every record once and only once. Filters, sort and search apply per request. Choose them once and send the same ones on every page call along with the bookmark, and they apply to every page of the walk (filtering).
Why bookmarks instead of page numbers
?page=7 means "skip 600 records, then read." If someone inserts a record
while you walk, page 7 serves you a record that page 6 already gave you. If
someone deletes one, a record slips between pages and you never see it. Offset
paging counts positions in a list that can change while you read it.
A bookmark doesn't hold a position. It records the last record you saw (its sort values, under the ordering you asked for), and the next page starts strictly after that record. So inserts and deletes elsewhere in the table can't make the walk skip or repeat a record. The one exception is a record whose own sort value changes during the walk. It moves within the ordering, so it can still be missed or seen twice. Keyset vs offset pagination goes through the argument at more length, with both schemes drawn out.
In practice, this means:
- There is no "jump to page 40". You go through the pages in order. For
"the newest 20," you don't need page 40 anyway. Send
sort=-Placed&page_size=20, which is one request. - A bookmark only continues a walk. It survives inserts and deletes, but don't save one to use next week. Start a fresh walk instead.
- The screen pages the same way. The grid reads records through this same mechanism, so a million-record table costs the API what it costs the screen, one page at a time.
The full parameter list, including fields=, cell_format= and key_by=, is
at /docs/api.