Hoppa till innehåll
Menu and API reference

Guide

Pagination

Use page cursors to read large result sets in stable, predictable chunks.

List resources share the same response envelope. The data sits in data, and the next page is controlled by two explicit fields.

json
{
  "data": [ … ],
  "has_more": true,
  "next_cursor": "eyJ2IjoxLCJzIjoicmV2ZW51ZSIsImYiOiI4YzE…"
}

Send the value from next_cursor as cursor in the next call. Stop when has_more is false.

bash
curl "https://firmainfo.se/api/v1/companies?limit=100" \
  -H "Authorization: Bearer $FIRMAINFO_API_KEY"

curl "https://firmainfo.se/api/v1/companies?limit=100&cursor=eyJ2IjoxLC…" \
  -H "Authorization: Bearer $FIRMAINFO_API_KEY"

Results without a total count

An exact total can require counting millions of rows for every combination of filters, which makes simple queries needlessly slow. The API therefore returns has_more and lets the client keep reading without an expensive count.

How long a cursor is valid

  • Never parse or modify the contents of a page cursor. The format is internal and may change.
  • A cursor is valid for 24 hours. After that the API responds with 410 cursor_expired.
  • Filters and sorting belong to the first page. If they change while an old cursor is being used, you get 400 cursor_conflict.
  • Do not use page cursors as permanent bookmarks. For long-running monitoring, store a date and use after or since.

When data changes mid-pagination

New records can be added without shifting an offset. An existing row can, however, move if its sort value is updated, for example when new accounts change the latest revenue figure. Use the change feed when you need to synchronise changes over time.