OlammaAPI

Pagination

Lists come a page at a time. Follow the cursor until there are no more pages.

Lists take a limit (each endpoint states its maximum) and answer with nextCursor. Pass it back as cursor to get the next page. When nextCursor is null, you have everything.

let cursor = null;
do {
  const params = new URLSearchParams({ view: "tv_…", limit: "100" });
  if (cursor) params.set("cursor", cursor);
  const response = await fetch(`${BASE}/tables/tt_…/records?${params}`, { headers });
  const page = await response.json();
  for (const record of page.records) handle(record);
  cursor = page.nextCursor;
} while (cursor);
cursor = None
while True:
    params = {"view": "tv_…", "limit": 100}
    if cursor:
        params["cursor"] = cursor
    page = requests.get(f"{BASE}/tables/tt_…/records", headers=headers, params=params, timeout=30).json()
    for record in page["records"]:
        handle(record)
    cursor = page["nextCursor"]
    if not cursor:
        break
  • Send the same filters and sort with every page. Changing them midway invalidates the cursor.
  • Treat cursors as opaque text: don’t build, change or store them for long.
  • Pages follow a stable order with a tie-breaker, so the pages of one list don’t repeat a record.