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": "..."
}
dataholds the items of this page.has_moresays whether more items follow.next_cursoris the value to send for the next page. It isnullon the last page.
Read every page
- Send the first request without
cursor. Setlimitto the page size you want, from 1 to 100. Without it a page holds 25 items. - If
has_moreistrue, send the same request again withcursorset to thenext_cursoryou received. - Repeat until
has_moreisfalse.
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.
