How to retrieve the list of games from xbox API?

2.9k Views Asked by At

i am trying to retrieve a list of all xbox one games that are on xbox marketplace.

The example from documentation:

https://xboxapi.com/v2/browse-marketplace/games/1?sort=releaseDate

This query returns only 20 records at time. So the problem is, you need to pass the page number. I can make a loop but it will obviously make more calls, which will have a big impact on the performance. Is there a way to retrieve all games at once, or at least in bigger chunks?

thx

1

There are 1 best solutions below

5
djekl On

For this endpoint, you can see there is a 1 at the end of the URI. This is one of the few endpoints that Microsoft don't offer continuation tokens on, and instead increment a page number. So to get the next page, it would be;

https://xboxapi.com/v2/browse-marketplace/games/2?sort=releaseDate

and

https://xboxapi.com/v2/browse-marketplace/games/3?sort=releaseDate

so on, and so on.

~djekl