How to create a proper ajax-request using API?


I’m trying to build an app similar to this (you can’t see online and offline channels, because API rules changed and every app similar to this don’t work).

So, I use an ajax-request and add a client-id
url: “”,
type: “GET”,
async: false,
headers: {
‘Client-ID’: ‘Client-ID’

But despite of that, I get a 404 mistake. According to these rules, you need an “Authorization” in the “headers”, but I can’t understand where I should get this authorization key.

So could you please help me to create a proper ajax-request?

Your URL is wrong

You need to call Get Streams with the user_login param instead, for online/offline checking.

The search API is for searching, and the correct URL for that would be

As for tokens, since this is an ajax call an implicit token is most appropriate

You will need to prompt the user to login with Twitch to get a token that you can use in the front end.

This example, will call the users API but you can substitute as needed: Twitch Implicit Auth Example

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