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.

  • Page size is 50 by default, unless it is overridden at a particular endpoint.

  • The maximum page size is 100, unless it is overridden at a particular 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. If page[size] is not specified, page size is 50 by default, unless it is overridden at a particular endpoint.

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.

For example, if the page[size] is set to 10 and the page[number] is set to 3, entry numbers 21 to 30 will be returned in the data.

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"