speedruncomorg / api

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

Minecraft: Java Edition - cannot get data on Random Seed #171

Closed mcpenguin closed 1 year ago

mcpenguin commented 1 year ago

Hello,

I'm trying to get the leaderboard data for the random seed runs for Minecraft: Java Edition through the API. I was able to get the Minecraft game ID (j1npme6p) and the category I am interested in (xk979xd0). However, when I try to run

GET https://www.speedrun.com/api/v1/leaderboards/j1npme6p/category/xk979xd0,

I get a 400 error saying the selected category is for individual level runs, but no level was selected. However, when I try to get the level data using

GET https://www.speedrun.com/api/v1/games/j1npme6p/levels

I get an empty list. So, I'm not sure if I'm doing something incorrectly or if this is a hiccup in the Minecraft data specifically. Thanks for the help!

AnInternetTroll commented 1 year ago

While it is kind of a bug that those "levels" show up at all under https://speedrun.com/api/v1/games/j1npme6p/categories That is not how you want to go about getting Minecraft Java's Random Seed runs

What you really need is

  1. A game ID
    • Minecraft Java in this case
  2. A category ID
    • For example "Any%" would be "wkpn0vdr", "Any% Glitchless" would be "mkeyl926"
  3. A variable ID and a variable value ID
    • For example for "Any% Glitchless"'s Seed Type you would have "r8rg67rn", and "Random Seed" would be "21d4zvp1"

Making the final URL: https://www.speedrun.com/api/v1/leaderboards/j1npme6p/category/mkeyl926?var-r8rg67rn=21d4zvp1

mcpenguin commented 1 year ago

Oh okay thank you! That makes a lot more sense :))