New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Embedding records data #42
Comments
Improving how using /records works is on my to-do list. |
Without using embeds, it takes three requests to get the current world record for a category in a game. I'm retrieving information for the GDQ vod thread so I have to look up the correct category and then retrieve records for it. A request to /games to get the url for category information, a request to /games/id/categories for the list of categories, and then a request to /categories/id/records to get the world record. With embeds it takes two requests, a request to /games?embed=categories and then using the /records url from the embedded results. Ideally, I would be able to embed information for records (and other information available at sublevels like |
👍 on this. I'm making an Android app from this API and I would gladly have to get the records directly embedded in a single /runs?embed=category.records,level.records request. |
It would be extremely handy to be able to embed data like records that's accessible from a resource. By that I mean, if you can access /games/<id>/records, being able to embed records data would save an API request and the time associated with it. It would also simplify the problem I'm having with https://github.com/blha303/srcomapi where requesting the records data as a class attribute is causing some issues; if the data was in the request to start with there would be no issues.
Overall the embed feature could be expanded to support more data types, although I'm unaware of the impact this would have on the database, obviously it's up to the owners of speedrun.com but doing a join in a database query is faster than making multiple API requests and joining them on the other end.
The text was updated successfully, but these errors were encountered: