Pagination
In this guide, we will look at how to work with paginated responses when querying the Fystack API. By default, list responses limit results to 20. You can request up to 1000 items by adding a limit parameter. If you are using one of the official Fystack API client libraries, you don't need to worry about pagination, as it's handled behind the scenes.
When an API response returns a list of objects, no matter the amount, pagination is supported. In paginated responses, objects are nested in a data attribute. You can use the offset and limit query parameters to browse pages.
Example using offset pagination
In this example, we request the first page of networks with a limit of 10 items. You can navigate through pages by adjusting the offset value. For example, to get the second page, you would use offset=10 when your limit is 10.
- Name
- offset
- Type
- integer
- Description
The number of items to skip before starting to collect the result set.
- Name
- limit
- Type
- integer
- Description
Limit the number of items returned per page. The maximum value is 1000.
Pagination using cURL
curl -G https://api.fystack.io/api/v1/networks \
-d offset=0 \
-d limit=10
Paginated response
{
"data": [
{
"id": "WAz8eIbvDR60rouK",
// ...
},
{
"id": "hSIhXBhNe8X1d8Et"
// ...
},
{
"id": "fbwYwpi9C2ybt6Yb"
// ...
}
// ... 7 more items
]
}