Generating a List of Followed, Online Streams

Hi guys, first off I want to apologise for my severe lack of knowledge in this area - I haven’t been doing this very long!

I’m trying to generate a list of the top 15 streams that I am following to display on localhost.
I gather I’m going to be using something along the lines of the

GET /steams/followed

command, but I’m running into issues with how I go about authenticating myself, and where I enter it (as a .js file?).
I assume I’m going to also need

stream_type: live, limit: 15

In there somewhere also.

Any help appreciated - thanks in advance!

This is how I do it, although there may be a simpler way…

  1. Setup an application in your Settings > Connections. Call it whatever you want and set the redirect URI to http://localhost. Next screen, ask for a New Client Secret. Keep that and your Client ID.

  2. Run this URL to get an access token from Twitch - replace the field as indicated:

  3. Look at your new URL and note down the THIS_IS_YOUR_ACCESS_TOKEN value:

Then, you will need to build your query into Twitch and pass the access token in the header as indicated on that API page. However you do that is based on what language/API you are using to build and manage your request.

From there, you will get your streams in order I believe, not “top” if you mean by most popular in terms of follows or viewers or what ever.

Hey man, thanks for getting back to me, and sorry for replying so late!

I tried going through your steps, but after step two I kept getting

{“error”: “Bad Request”,“status”:400,“message”:“client does not exist”}

Also, what would you suggest as being the easiest way to get the list? Just a javascript file?

Thanks again, man.

Did you register a client from step 1 and put in the Client ID that Twitch gives you in as YOUR_CLIENT_ID? That is what would cause that error 400.

The list, it depends what language you are used to and what API you are using to talk to Twitch. You can use JavaScript and try to scrape data. PHP has some good tools like HttpGuzzle for digesting data as well, it depends what you are trying to build this into I suppose. Sorry if that is vague, but, it sort of depends what you want to do with the list when you get it back and what languages you are comfortable with.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.