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": [...]
}

Field

Description

Value Type

limit

The limited request parameter

Integer

offset

The offset request parameter

Integer

hasNext

Flag to indicate there is more data on next page

Boolean

hasPrevious

Flag to indicate there is more data on previous page

Boolean

items

The array of requested objects

Array[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.

Resource

Limit

Sport

30

Tournament

50

Season

30

Stage

50

Event

20

Draw

30

Standing

20

Venue

30

Participant

50

Country

100


What’s Next