Usage of a paginated endpoint
A paginated endpoint is an endpoint that returns a subset of the data. To get the entire dataset, you need to make multiple requests to the endpoint, each time retrieving a different subset of the data. To do so, you need to use the limit
and offset
query parameters :
limit
: it controls the numbers of items returnedoffset
: it controls the number of items to skip before starting to collect the result set
Why use pagination?
✅ Better Performance – Prevents retrieving too much data at once.
✅ Improved API Efficiency – Reduces load on the server.
✅ Easier Navigation – Fetch data in smaller, manageable chunks.