Pagination
This page details how result pagination can achieved with Content API
Pagination of results can be done by using the offset and limit parameters. The offset parameter defines the offset from the first result you want to fetch. The limit parameter allows you to configure the maximum amount of hits to be returned.
The default offset value is 0 and the default limit value is 20. The maximum limit value supported by the API is 100.
The following example demonstrates a request that will only return 10 results (if 10 results are available):
curl \
-H "Accept: application/json" \
-H "apikey: <API KEY>" \
https://content.api.pressassociation.io/v1/item?limit=10
Building on the above request, to get the next "page" of 10 results we would simply set the offset to value of the previous offset plus the limit, so 0 + 10;
curl \
-H "Accept: application/json" \
-H "apikey: <API KEY>" \
https://content.api.pressassociation.io/v1/item?limit=10&offset=10
In order to return the third "page" you can simply request the following (previous offset plus the limit limit, so 10 + 10);
curl \
-H "Accept: application/json" \
-H "apikey: <API KEY>" \
https://content.api.pressassociation.io/v1/item?limit=10&offset=20
Updated about 5 years ago