Pagination
In this guide, we will look at how to work with paginated responses when querying the Unblind API. By default, all responses limit results to 100 items. However, you can go as high as 1,000 items by adding a limit parameter to your requests.
When an API response returns a list of objects, pagination is always available. In paginated responses, the returned objects are nested under the data attribute, and the response includes a next_page field indicating the next page, if any. You can use the page query parameters to navigate between pages.
Example using cursors
In this example, we request the page that starts after the page with id s4WycXedwhQrEFuM. As a result, we get a list of three logs and can tell from the null value of the next_page attribute that we’ve reached the end of the result set.
- Name
page- Type
- string
- Description
The page ID you're currently on when you want to fetch the next page.
- Name
limit- Type
- integer
- Description
Limit the number of items returned.
- Name
- Description
Manual pagination using cURL
curl -G https://api.unblind.dev/v1/conversations \
-H "Authorization: Bearer <API_KEY>" \
-d page="s4WycXedwhQrEFuM" \
-d limit=10
Paginated response
{
"next_page": null,
"data": [
{
"span_id": "WAz8eIbvDR60rouK",
// ...
},
{
"span_id": "Nabfwen8qsKdE7jk",
// ...
},
{
"span_id": "irNbg3wiDXrdliVm",
// ...
}
]
}