In this guide, we will look at how to work with paginated responses when querying the RedirHub API. By default, all responses are limited to 100 results. However, you can customize the number of results returned by passing a
per_pageparameter to your requests. The
per_pageshould be between 5 and 1,000.
When an API response returns a list of objects, no matter the amount, pagination is supported. In paginated responses, objects are nested in a
dataattribute and have a
metaattribute that provides useful information about the paginated result set. You can use the
pagequery parameter in combination with the
per_pageto browse additional results from the API.
linkfield within the response body will conveniently provide you with the next and previous API URLs.