Pagination

In this guide, we will look at how to work with paginated responses when querying the Spaw API. By default, all responses limit results to 15. However, you can go as high as 100 by adding a limit parameter to your requests.

When an API response returns a list of objects, no matter the amount, pagination is supported. In paginated responses, objects are nested in a data attribute and have a links attributes that indicates whether you have reached the end of the last page. You can use the prev and next links to browse pages.

Example using cursors

In this example, we request the page that starts with cursor id eyJfaWQiOiI2NWExNGRhYzg3N... As a result, we get a list of proxies and can tell by the next_cursor attribute from meta object that we have reached the end of the resultset.

  • Name
    cursor
    Type
    string
    Description

    Use it when you want to fetch the next or previous page.

  • Name
    limit
    Type
    integer
    Description

    Limit the number of items returned.

Manual pagination using cURL

Paginated response