Skip to content
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

GET /records var-{variable ID}-{value ID} filter is not working #153

Open
ghost opened this issue Jun 28, 2022 · 5 comments
Open

GET /records var-{variable ID}-{value ID} filter is not working #153

ghost opened this issue Jun 28, 2022 · 5 comments

Comments

@ghost
Copy link

ghost commented Jun 28, 2022

I'm trying to make a world record leaderboard for every game but the request link doesn't seem to work, as the runs aren't filtered by the variable specified.
Please someone take a look at this link:
https://www.speedrun.com/api/v1/games/k6q4rqzd/records?skip-empty=true&max=200&offset=0&top=1&embed=players&var-2lggye3l=4lxexp31
image

@ghost ghost changed the title var-{variable ID}-{value ID} filter is not working on GET /records GET /records var-{variable ID}-{value ID} filter is not working Jun 28, 2022
@ghost ghost changed the title GET /records var-{variable ID}-{value ID} filter is not working ´´´GET /records´´´ var-{variable ID}-{value ID} filter is not working Jun 28, 2022
@ghost ghost changed the title ´´´GET /records´´´ var-{variable ID}-{value ID} filter is not working GET /records var-{variable ID}-{value ID} filter is not working Jun 28, 2022
@ghost ghost changed the title GET /records var-{variable ID}-{value ID} filter is not working GET /records var-{variable ID}-{value ID} filter is not working Jun 28, 2022
@Nick-NCSU
Copy link

Assuming you are referring to GET /games/{id}/records which it seems your request uses: refer to the query parameters listed for this endpoint (https://github.com/speedruncomorg/api/blob/master/version1/games.md#get-gamesidrecords). The only documented query parameters are top scope miscellaneous skip-empty max offset and embed.

The var-___ query parameter is only available for the GET /leaderboards/{game}/category/{category} and GET /leaderboards/{game}/level/{level}/{category} endpoints.

@danthedrummer
Copy link

danthedrummer commented Jun 28, 2022

Those query params aren't documented in the /games route. Should you be using the /leaderboards route instead?

Something like this:
https://www.speedrun.com/api/v1/leaderboards/k6q4rqzd/category/z27lez0d?skip-empty=true&max=200&offset=0&top=1&embed=players&var-2lggye3l=4lxexp31

edit: Nick beat me to it 😂

@ghost
Copy link
Author

ghost commented Jun 28, 2022

Is there any way to filter all top 1 runs by variables then?

I though every propriety of the lbs doc also applied here lmao

@Nick-NCSU
Copy link

No, you would need to iterate through each one using the GET /leaderboards/{game}/category/{category} endpoint with top=1. The GET /games/{id}/records returns the fastest run in a category not subcategory.

@ghost
Copy link
Author

ghost commented Jun 28, 2022

Oh well that's not good for me, also doesn't really make sense to not return the fastest run for every subcategory that has each lb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants