Pagination
To efficiently handle large datasets, the Storyblok API supports pagination for all top-level resources, including stories, assets, and datasources.
The query accepts two parameters:
| Parameter | Description |
|---|---|
page | Default: 1. The page number to retrieve. Increase the value to receive the next page of entries. |
per_page | Default: 25. The number of entries per page. The maximum for stories is 100, and for datasource entries is 1000. |
The response headers of paginated API requests include two properties:
total: the total number of items available across all pages.per_page: the number of items per page.
To calculate how many pages are available, use the total response header received after the first request: divide the total value by the per_page value. The result is the last available page number.
If the request specifies a page number greater than the result, the API response returns an empty array.
Get in touch with the Storyblok community