How to get the User ID in Twitch API

How to get the User ID in Twitch API
0.0 0

#1

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?


#2

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

#3

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.


#4

Works great! Thanks mate!


#5

How was I supposed to get that url?

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


#6

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.


#7

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…


#8

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.


#9

Yeah I do now, thank you :smiley:


#10

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:


#11

Finally got that god forsaken app working


#12

Thanks Davec ! you make my day !!!