How do i use the API?
3 years ago
Finland

yeah so i want to use the API to get my newest run and show it on a webpage for example but i dont even know where to start since ive never played around with APIs before.

Riekelt likes this
Netherlands

I just hope that you know a bit about (probably) javascript programming and how to do an API call. Fortunately, this API doesn't need authentication. First of all, I checked out your username; https://www.speedrun.com/api/v1/users?lookup=SioN

After that, on this page, there's a personal best link, go there. This works with user-ID, so it's easier to do it this way. That brings you to the next page.

https://www.speedrun.com/api/v1/users/zxzy6drj/personal-bests

I have a strong feeling the results there are chronologically, with newest first, so you'd need to get the first element. data[0].run.

In that thing, you get a lot of ID's. Game ID for Ape 2 is 576r7q18, the Any% category ID is 7wkpwjdr. The video can be found via data[0].run.videos.links[0].uri

And for example, to get the games name, you'd grab the game ID up there, paste it here: https://www.speedrun.com/api/v1/games/576r7q18 The name can be accessed via data.names.international

How did I find all these links? Via my good friend documentation: https://github.com/speedruncomorg/api/tree/master/version1 You will use this a lot.

I hope this somewhat helps. It's a bit harder to pass information around seeing how SRC only handles in ID's unless you'are at the spot, but your thing should be totally doable. Just need a few API calls for a single thing.

Edited by the author 3 years ago
SioN likes this
Finland

i have no idea how to do an API call, i did try to search for that on google but it all just confused me more as some sites told me to put the "commands" in a terminal and some just told me to "do it and this will happen".

and yes i did try to go trough the documentation before making this thread.

Antarctica

Without programming experience you won’t be able to use the API. API’s are designed for programmers to interact with sites and their data. So, unfortunately, without a basic understanding of the HTTP protocol and a programming language of your choice, using the API won’t be as simple as just reading the documentation.

Niamek, Amei, and Caidren like this
India

is the api available for python

Germany

You know what an API is, right?

AmenAnthem, Merl_ and 3 others like this