How to get ID's Player speedrun.com API
4 years ago
Pays de la Loire, France

I want to use the speedrun.com api for a discord bot in JS but I can't get the players id by their nickname :

I use NodeJs and HTTPS for the request so when i make a request on https://speedrun.com/api/v1/users/Pseudo this doesn't return me a JSON file.

How can i get the ID by the pseudo to make my request ?

Sorry if there are mistakes.

California, USA

I ran into the same problem.

You can use my unofficial API, but no guarentees as to the future of course.

https://sr-browser.dbeal.dev/api/v1/whatis/<username text>

Stun likes this
Israel

When you use the request on https:/​/​www.speedrun.​com/​api/​v1/​users/​Pseudo it does a redirect (status code 302) to a link with the ID, given by the "Location" response header. Then, the second request does return a json with the relevant ID in it.

Seems to me like it should work for you.

Gaming_64 and klbyte like this
Pays de la Loire, France

Thanks for your answers.

So I try with the "Location" response header but this doesn't give me a link with the ID but the same link (https:/​/​www.speedrun.​com/​api/​v1/​users/​Pseudo).

Request: https:/​/​www.speedrun.​com/​api/​v1/​users/​Stun

response header: { server: 'nginx/1.10.3', date: 'Wed, 11 Mar 2020 11:29:23 GMT', 'content-type': 'text/html', 'content-length': '187', connection: 'close', location: 'https://www.speedrun.com/api/v1/users/Stun' }

Israel

Hmm, very strange. I tried your link as well (by copying it and pasting to the browser), and it gave me a google search result. I then typed the entire link myself, and then it did work as intended.

That working link is: https://www.speedrun.com/api/v1/users/Stun

Now, since they are looking the same, I put the two links in a text-diff program and got different results (yours at the left contains some weird symbols): https://i.imgur.com/B2HoNPq.png

Gaming_64 likes this
Pays de la Loire, France

Ok thank you, effectively there was some invisible symbols in my link now it's work !

Oreo321 likes this