Pagination
How to paginate through API results
The Lirium API uses cursor-based pagination for resource collections.
Pagination Parameters
| Parameter | Description |
|---|---|
starting_after | Return resources listed after the specified cursor value |
ending_before | Return resources listed before the specified cursor value |
limit | Maximum number of results to return (page size) |
Note:
starting_afterandending_beforeare mutually exclusive. Only one may be used per request.
Response Format
All paginated responses include a pagination object:
{
"pagination": {
"starting_after": "20200901212845208267",
"ending_before": "20200901213325502653",
"limit": 10
},
"data": [
...
]
}Navigation
- Use
starting_afterfrom the response to navigate to the next page - Use
ending_beforefrom the response to navigate to the previous page
Empty Results
When there are no results, both starting_after and ending_before will be null.
To avoid losing your cursor position:
- If using
starting_afterand you receive an empty response, there is no next page - If using
ending_beforeand you receive an empty response, there is no previous page
Updated 4 months ago
