Pagination
Working with paginated results
Some endpoints return paginated results. We use offset-based pagination.
Request
To list all items, you can use the offset and limit query parameters:
| parameters | description | default value |
|---|---|---|
offset | The number of items to skip. | 0 |
limit | The maximum number of items to return. | 10 |
Example:
fetch("https://api.excalidraw.com/api/v1/scenes?offset=0&limit=10", {
method: "GET",
headers: {
Authorization: "Bearer sk-...7qd",
},
});Response
A paginated response will return an array of items along with pagination metadata:
| field | description |
|---|---|
data | Array of returned data items. |
offset | The number of items skipped in the response. |
limit | The maximum number of items returned in the response. |
hasNextPage | Whether there are more items to be fetched. |
Example response:
{
"data": [
// array of returned data
],
"offset": 0,
"limit": 10,
"hasNextPage": true
}