In the previous tutorial, we discussed how you can set your desiredtimezone. 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 a hundred results per page.
Note that every page called counts against the ratelimiter. So a call to page 1,2,3,4 and 5 counts as 5 call against the ratelimiter.
Create your request
Let's request all the fixtures between two dates. We can do this by using ourget fixtures by date range endpoint. In themeta descriptionof the response, you will see information about your subscription, the number of API calls and more. Please refer to ourmeta description page for more info.
Also, you can see information about the results of the response. In the second tab, you can see that the response returned 13454 results, but the API only shows a hundred results per page. With pagination, it results in 135 pages.
Opens an array of information about the pages in the API response
total
The total amount of results the API returns
count
The amount of results on the current page
per_page
The amount of results per page
current_page
The number of page currently browsed
total_pages
The total number of pages
links
The link if you want to go to the next API page
"So, how do I get to the second page then?’"
Excellent question. Going to the second page is easy! Simply add &page=2 to your request. In the second tab, you will see that the meta description changes accordingly.
Opens an array of information about the pages in the API response
total
The total amount of results the API returns
count
The number of results on the current page
per_page
The number of results per page
current_page
The number of pages currently browsed
total_pages
The total number of pages
links
The link if you want to go to the next API page
Request more or fewer results per page
Do you want the API to return more or fewer results per page? That’s also possible! You can determine the number of results per page (range 10-150) by adding &per_page= {number} to your request. For example, if you want 110 results per page: