GuidesAPI Reference
DocumentationLog In

Pagination

All GET endpoints which return an object list support cursor based pagination with pagination information inside a pagination object. This means that to get all objects, you need to paginate through the results by always using the id of the last resource in the list as a starting_after parameter for the next call. To make it easier, the API will construct the next call into next_uri together with all the currently used pagination parameters. You know that you have paginated all the results when the response’s next_uri is empty. Default limit is set to 25 but values up to 100 are permitted.

Arguments

FieldDescription
order optionalOrder of the resources in the response. desc (default), asc
limit optionalNumber of results per call. Accepted values: 0 - 100. Default 25
starting_after optionalA cursor for use in pagination. starting_after is a resource ID that defines your place in the list.
ending_before optionalA cursor for use in pagination. ending_before is a resource ID that defines your place in the list.

Example request:

curl https://api.commerce.coinbase.com/checkouts?limit=20 \
     -H "X-CC-Api-Key: <Your API Key>" \
     -H "X-CC-Version: 2018-03-22"

Example response:

{
    "pagination": {
        "order": "desc",
        "starting_after": null,
        "ending_before": null,
        "total": 25,
        "yielded": 20,
        "limit": 20,
        "previous_uri": null,
        "next_uri": "https://api.commerce.coinbase.com/checkouts?limit=20&starting_after=fb6721f2-1622-48f0-b713-aac6c819b67a",
        "cursor_range": ["a76721f2-1611-48fb-a513-aac6c819a9d6", "fb6721f2-1622-48f0-b713-aac6c819b67a"]
    },
    "data": [
        ...
    ]
}