Twitch API Help for beginners

Twitch API Help for beginners
0

#1

So like I am beyond confused as to what I am supposed to do for the Twitch Project. Like are there any tutorials I can use to help me out!!! They are talking about using a new URL but they haven’t really gone into that much detail about it. Like I just need advice on how to tackle this problem because I have found myself pretty overwhelmed by this project any many of the other FCC projects.


#2

Hey there,

I think part of the learning process is hitting this walls. In my opinion, working your way through the walls is what makes you grow as a developer and help you take in all the information.

Regarding that project, the first thing you need to do is head over to the APIs documentation, to find out how it works:

https://dev.twitch.tv/docs

When you visit that link, you will notice a sidebar menu, that is where you will be looking to get the end points.

If you click on the ‘Users’ tab, for example, you will see that now you get a list of all end points for getting user related information.

You’ll notice that endpoints are pretty much the same, except they accept another info into the URL, be it a user ID numbers, a channel name, etc. The end point kinda looks like this:

https://api.twitch.tv/kraken/.

The challenge mentions that Twitch now requires an API key, which is basically a unique user ID number you pass when making the call to the server. In this case, we need to change that for the following:

https://wind-bow.gomix.me/twitch-api

What this means is that now, you can use the last URL to retrieve the information from the API. For example, a call to the API to retrieve FCCs information would look like this:

https://wind-bow.gomix.me/twitch-api/users/freecodecamp.

Sometimes you will get an error from codepen regarding the call, so you need to watch out for that. I read on twitch’s site that if you add a callback param at the end of your request, it will be treated as jsonp and you can parse it without problem. My call looks like this:

https://wind-bow.gomix.me/twitch-api/users/freecodecamp?callback=?

Hope this helps!