Pagination

How to handle collections

Collection resources will always contain a paginated response and allow the use of offset and limit to provide pagination functionality to the client.

curl http://sport.api.press.net/v1/collection?limit=20&offset=0
{
    "limit": 20,
    "offset": 0,
    "hasNext": false,
    "hasPrevious": false,
    "items": [...]
}
FieldDescriptionValue Type
limitThe limited request parameterInteger
offsetThe offset request parameterInteger
hasNextFlag to indicate there is more data on next pageBoolean
hasPreviousFlag to indicate there is more data on previous pageBoolean
itemsThe array of requested objectsArray[Object]

The 'limit' parameter is typically used with the 'offset' parameter to facilitate pagination. Each resource that exposes a collection has a limit to what the limit can be set to. This information can be found in the API reference.

The following table identifies the pagination limits for each resources, should a request be made over these limits a 400 Bad Request response will be returned.

ResourceLimit
Sport30
Tournament50
Season30
Stage50
Event20
Draw30
Standing20
Venue30
Participant50
Country100

What’s Next