Pagination
Pagination helps manage large datasets by dividing results into pages. Use the page
query parameter to control the size of each page and specify which page to retrieve.
If pagination is not applied, some endpoints may return all records in a single response.
Important
Pagination applies to any endpoint that returns a resource collection as primary data, regardless of the request type.
The default maximum page size is 100, unless overridden by an endpoint.
If
page[number]
is not specified, page 1 is returned by default.Some endpoints may disable pagination and return all records in a single response.
Define page size
Use the page[size]
parameter to set the maximum number of items returned per page.
In this example, the response will include 10 records (such as cities, countries, or DIDs) per page.
http
GET /cities?page%5Bsize%5D=10 HTTP/1.1
Host: api.didww.com
Accept: application/vnd.api+json
curl
curl -i -X GET 'https://api.didww.com/cities?page%5Bsize%5D=10' -H "Accept: application/vnd.api+json"
Retrieve a specific page
Use the page[number]
parameter to request a specific page of results.
In this example, with page[size]=10
and page[number]=3
, the response will include records 21 through 30.
http
GET /v3/cities?page%5Bnumber%5D=3&page%5Bsize%5D=10 HTTP/1.1
Host: api.didww.com
Accept: application/vnd.api+json
curl
curl -i -X GET 'https://api.didww.com/v3/cities?page%5Bnumber%5D=3&page%5Bsize%5D=10' -H "Accept: application/vnd.api+json"
Pagination links
Paginated responses include navigation links in the top-level links
object:
first
– the first page of datalast
– the last page of dataprev
– the previous page of datanext
– the next page of data
These links help you navigate through paginated results without manually calculating page numbers.