How to get the User ID in Twitch API

In order to obtain the information necessary to complete the twitch project, we need the ID of users. However I don’t understand how to obtain this ID. Can someone show/explain please?

I was able to get the information needed with a combination of /streams/STREAMER_NAME and /users/STREAMER_NAME.

So:

https://wind-bow.glitch.me/twitch-api/streams/ESL_SC2

and

https://wind-bow.glitch.me/twitch-api/users/ESL_SC2
1 Like

One URL you can use is “https://api.twitch.tv/kraken/users?login=”.
You can use multiple names by seperating them by a comma. “?login=name1,name2,name3”

This will return a JSON object of an array containing users if getting multiple names in one request.

Works great! Thanks mate!

How was I supposed to get that url?

The FCC challenge says I should use https://wind-bow.gomix.me/twitch-api

You can replace the “https://api.twitch.tv/kraken/ part with https://wind-bow.gomix.me/twitch-api and add on the rest of the url as per normal. These I believe can be found somewhere deep in the twitch API docs, but I wasn’t sure where exactly to find them.

Yes but what works is https://wind-bow.GLITCH.me/twitch-api and what FCC says I should use is https://wind-bow.GOMIX.me/twitch-api

eventually the gomix one redirects me to glitch.me but one doesn’t work and the other one does…

Huh… I never noticed that. The major difference in that the GOMIX one appears to require a proxy server (I used heroku) which has a limited number of calls that you can use per day, whereas the glitch one does not. Use the glitch one.

1 Like

Yeah I do now, thank you :smiley:

Yup. I was redirected, but never really noticed. But what I usually do with API-based apps is play with the url endpoints (in combination with reading the docs as best I can) until I see the data I want and then copy/paste that url into my app.

Glad you got it sorted. :slight_smile:

Finally got that god forsaken app working

Thanks Davec ! you make my day !!!