In the previous tutorial, we discussed how you can set your desired time zone. Before we dive into the extra details of our API, we need to discuss one of the fundamentals of our API: pagination.
“How is it possible that I cannot find all the data I requested?”
Responses sometimes return more than 1.000 results. With that much data, requests can become slow and hard to work with. That’s why these endpoints use something called pagination. Instead of returning all 1.000+ results, you'll get 25 results per page.
Let's request all the available fixtures in the free plan. We can do this by using the GET All Fixtures endpoint:
If you navigate to the end of the response, you can see information about pagination. You can see that there are 25 results returned per page, the current page, the link to the next page and an indicator
false. You can paginate using the
has_moreparameter to determine if you can still propagate through the results.
"So, how do I get to the second page then?’" Excellent question. Going to the second page is easy! Simply add
&page=2to your request.
The request also contains a
next_pagefield with the same includes and parameters of your previous request. See the example below
Now that you know about pagination, we can explore our API’s endless possibilities in the next chapter: enriching your response.
Note that every page called counts against the rate limiter. So a call to pages 1,2,3,4 and 5 counts as 5 calls in the rate limiter
It is now possible to add the
filters=populateto your query parameter. This parameter allows for a higher pagination limit (
max 1000), so you can populate your database in a more convenient way instead of using the default pagination limit of
50. To prevent our services from overloading, using includes is disabled when this filter is added to the request.