racetimeGG / racetime-app

Application code for racetime.gg
https://racetime.gg
GNU General Public License v3.0
41 stars 20 forks source link

Feature Request - Public API - Allow Querying More than 10 Races per Page #212

Closed YourAverageLink closed 3 days ago

YourAverageLink commented 1 week ago

I recently created a data visualizer for visualizing head-to-head matchups on RaceTime. Would it be possible to allow API calls to fetch more than 10 races per page? I currently have to asynchronously fetch each page of race data for a slug and update the table live as they come in, so it would be nice to cut down on loading times by fetching race data in bulk.

deains commented 1 week ago

I can add something in to increase the default limit, but your app ought to cache races that have already been fetched once. After recording none of the data is likely to change, so fetching them all again is just wasteful really.

YourAverageLink commented 1 week ago

That's fair, I do plan on caching fetched results. This was more to see if it was possible to cut down on the initial load time when a user inputs a slug for the first time.

deains commented 3 days ago

I've added the ability to specify per_page up to 100: https://github.com/racetimeGG/racetime-app/wiki/Public-API-endpoints#past-category-races