How do i get general channel information

From what i can read from the documentation then it’s not possible to retrieve simple data like bio, total followers and subscriptions count without User OAuth.

I’m creating a small game website where you have to choose which streamer you prefer, like the other Versus website you see around the web. But i want current data, not old data that i have to manually replace, is it possible to get this information without user OAuth?

yes, use an App Access Token instead.

App Access is a “server to server” token.

Types of tokens:

The token you need

1 Like

Thank you!

Am i doing something wrong, i did recieve the AccessToken with the correct scope, and i use that token in another request:

      const data = await fetch(`https://api.twitch.tv/henrik_dk/channel`, {
        headers: {
          Accept: "application/vnd.twitchtv.v5+json",
          "Client-ID": process.env.GATSBY_CLIENT_ID,
          Authorization: `OAuth ${accessToken}`,
        },
      })

But i’m getting 404, am i doing something wrong or maybe a misspelling? As you can see i do get the token and i do log itScreenshot_1

Thats not a valid endpoint

I believe you are after

It’s under Twitch Api v5 https://dev.twitch.tv/docs/v5/reference/channels#get-channel

And the other endpoint doesn’t have the information i need. I need bio, followers and subscriber count. Which the endpoint you linked have none off.

“kraken” is the “name” of the API, not the channel to lookup.
v5/kraken is deprecated you should use new API/helix

Bio: Reference | Twitch Developers
Follow count: Reference | Twitch Developers
Sub Count: Reference | Twitch Developers (load all pages and count yourself)

If you intend to use the Deprecated v5:

Then if you have the users oAuth token you call, for bio you would call the channels API:

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

if you don’t have the users oAuth you call

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

And substitute in the channel ID (not user name)

Okay i got most of it down, but i have a small problem with authorization.
As you can see my access_token does have the scope required, but my call to
https://api.twitch.tv/helix/subscriptions?broadcaster_id=xxxxx gives a respond back that i need the scope.

Screenshot_2

You require a user access token to access the subscribers endpoint

And the user access token needs to be of the user_id matching broadcaster ID in the request

The current user is determined by the OAuth token provided in the Authorization header.

User ID of the broadcaster. Must match the User ID in the Bearer token.

from Reference | Twitch Developers

You need authorization from the broadcaster to get the broadcasters subscriber count. (Since knowing the count lets you estimate the casters income from Twitch)

I missed this in your original message, as your topic is “general channel information” and this item isn’t general really.

Yes but it doesn’t have a user, so you won’t be able to get the users subscribers count (or email address) as there is no user on the token

Okay so it’s not possible to get Channel subscriber count without the twitch user giving you their OAuth key.

I don’t really see how that shouldn’t be possible, but i guess i would have to live without that information.

I answered that. It’s “privileged” information, owned by the broadcaster

Same thing with the broadcasters email address. thats private to the caster, since the email on their account could differ from their public/contact email

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