Pagination
In this guide, we will look at how to work with paginated responses when querying the Waygo API. By default, all list endpoints limit results to 20 items and start from the beginning (skip=0). You can customize these values by adding skip and limit parameters to your requests. If you are using one of the official Waygo API client libraries, you don't need to worry about pagination, as it's all being taken care of 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 response-specific attribute (like maps, datasets, etc.) and include metadata about the pagination state. You can use the skip and limit query parameters to browse pages.
Example using skip and limit
In this example, we request the second page of results by setting skip=20 (to skip the first 20 items) and limit=10 (to get 10 items). The response includes the requested objects, total count, and pagination metadata.
- Name
skip- Type
- integer
- Description
The number of items to skip from the beginning of the resultset. Defaults to 0.
- Name
limit- Type
- integer
- Description
The maximum number of items to return. Defaults to 20, maximum varies by endpoint.
Manual pagination using cURL
curl -G https://api.waygomaps.com/v1/maps \
-H "Waygo-API-Key: eyJhbGciOiJIU...sXSJE_1AJgMEnI_g-WTerk" \
-H "Waygo-Account: n39q9h0ph9324hf9h4vksh9h2f9h03hl" \
-d skip=20 \
-d limit=10
Paginated response
{
"maps": [
{
"map_id": "map_123",
"name": "Downtown Area",
// ...
},
{
"map_id": "map_124",
"name": "Suburban District",
// ...
},
{
"id": "map_125",
"name": "Industrial Zone",
// ...
}
],
"total": 45,
"skip": 20,
"limit": 10
}