speedruncomorg / api

REST API Documentation for speedrun.com
346 stars 36 forks source link

Minecraft Data #127

Closed burnedsap closed 3 years ago

burnedsap commented 3 years ago

Hello,

I can't seem to access the data for this particular category. I've been trying this link: https://www.speedrun.com/api/v1/leaderboards/j1npme6p/category/zd3re8dn but I get an error

"status":400,"message":"The selected category is for individual-level runs, but no level was selected.","links":[{"rel":"support","uri":"irc:\/\/speedrunslive.com#speedrun.com"},{"rel":"report-issues","uri":"https:\/\/github.com\/speedruncom\/api\/issues"}]}

Other categories such as this: https://www.speedrun.com/api/v1/leaderboards/j1npme6p/category/mkeyl926 work well.

Am I accessing the API incorrectly?

bigfoott commented 3 years ago

If you look at the full list of categories here and CTRL + F for the category you linked above, you'll see it's type is per-level. You're probably looking for a category that is type = per-game.

In this case I see you're looking for the Random Seed Glitchless leaderboard, but there isn't a specific category for it. You'll need to get the Any% Glitchless category and then filter the runs by the variable in this screenshot.

Theres a URL to see the variables for each category in the games/game id/categories endpoint for each category. For filtering custom variables, go to this page of the docs and CTRL + F for "filter by custom variables".

Appologies if I didn't explain something very clearly, lmk if part of what I said was confusing and I'll clarify :)

burnedsap commented 3 years ago

Okay I see, this is helpful thank you!

For those wondering, this is how I did it: https://www.speedrun.com/api/v1/leaderboards/j1npme6p/category/mkeyl926?var-r8rg67rn=21d4zvp1&var-jlzkwql2=mln68v0q

j1npme6p = Minecraft mkeyl926 = "Any% Glitchless" Category r8rg67rn = "Seed Type (Any% Glitchless)" Variable + 21d4zvp1 = "Random Seed" + jlzkwql2 = "Version" + mln68v0q = "1.16.1"

It's a bit roundabout instead of approaching it directly through "zd3re8dn" but makes sense nevertheless!

Thank you!