Pagination
Your Street account can have a lot of content—far more than you’d want to pull down in a single request. The API endpoints default to providing a limited number of items per request.
Pagination Parameters
Any API response which contains multiple resources supports several common query parameters to handle paging through the response data:
?page[number]=: specify the page of results to return.
For example, /open-api/people?page[number]=2 is the second page of results
By retrieving /open-api/people, then /open-api/people?page[number]=2, and so on, you may access every available record through the API, one page at a time.
?page[size]=: specify the number of records to return in one request, specified as an integer from 1 to 100.
For example, /open-api/people?page[size]=1 will return only the first record in the collection
Please note
Large queries can hurt site performance, so page[size] is capped at 100 records. If you wish to retrieve more than 100 records, for example to build a client-side list of all available records, you may make multiple API requests and combine the results within your application.
Pagination Details
In the results you get back from the API there will be an additional meta object that contains all the relevant details for pagination.
"meta": {
"pagination": {
"total": 267,
"count": 0,
"per_page": 0,
"current_page": 0,
"total_pages": 0
}
}
Pagination Links
Additionally in the returned results you will get a links object that returns the fully constructed links for you be able to easily traverse the full result set.
"links": {
"self": "https://street.co.uk/open-api/people?page[number]=2&page[size]=25&page[number]=2",
"first": "https://street.co.uk/open-api/people?page[number]=2&page[size]=25&page[number]=1",
"prev": "https://street.co.uk/open-api/people?page[number]=2&page[size]=25&page[number]=1",
"next": "https://street.co.uk/open-api/people?page[number]=2&page[size]=25&page[number]=3",
"last": "https://street.co.uk/open-api/people?page[number]=2&page[size]=25&page[number]=9"
}
Please note
The above example URIs show unencoded [ and ] characters simply for readability. In practice, these characters should be percent-encoded.