Zeplin API utilizes offset and limit based pagination for endpoints that return collections. These endpoints share common query parameters:
Query parameter | Type | Default | Maximum | Description |
---|---|---|---|---|
limit | integer | 30 | 100 | Number of items to be returned |
offset | integer | 0 | - | Zero-based offset to start collecting items from |
To get the first page of items, you can either set the offset
parameter to 0
or not set it at all.
curl -i https://api.zeplin.dev/v1/projects?limit=50 \
-H "Authorization: Bearer {token}"
To get the next page of items, you need to increase offset
parameter by the limit
parameter you provided (or by 30 since it's the default).
curl -i https://api.zeplin.dev/v1/projects?limit=50&offset=50 \
-H "Authorization: Bearer {token}"
If an offset
parameter exceeds the number of items in a collection, the endpoint returns an empty collection.