Skip to content
Start free Sign in

Read lists page by page

Agency plan

Last updated

Available on the Agency plan

This feature is included in the Agency plan and the plans above it. See pricing

Operations that return many items, such as your sites or the cookies of a scan, answer one page at a time. This guide shows how to read every page.

What a list looks like

{
  "object": "list",
  "data": [ ... ],
  "has_more": true,
  "next_cursor": "..."
}
  • data holds the items of this page.
  • has_more says whether more items follow.
  • next_cursor is the value to send for the next page. It is null on the last page.

Read every page

  1. Send the first request without cursor. Set limit to the page size you want, from 1 to 100. Without it a page holds 25 items.
  2. If has_more is true, send the same request again with cursor set to the next_cursor you received.
  3. Repeat until has_more is false.
curl "https://api.kukie.io/v1/sites?limit=100" \
  -H "Authorization: Bearer $KUKIE_API_KEY"

curl "https://api.kukie.io/v1/sites?limit=100&cursor=NEXT_CURSOR" \
  -H "Authorization: Bearer $KUKIE_API_KEY"

NEXT_CURSOR stands for the next_cursor of the answer before.

What a cursor is tied to

A cursor is an opaque string. Do not read it, change it or build one yourself. It works only with:

  • the API key it was made for, so after you roll a key, start the list again from its first page
  • the operation it came from
  • the filters it was made with, so keep the other query parameters the same on every page

A cursor that cannot be used answers 400 validation_failed, with cursor as the parameter. Start the list again from its first page.

Filters

Some lists take filters as query parameters, which the API reference lists for each operation. A query parameter the operation does not know answers 422 validation_failed, so a mistyped filter never returns the whole list by mistake.

Was this helpful?

Listed on