Get Viewer Count without OAuth

Is it possible to see the number of viewers of a channel without needing an OAuth2 token, because the Twitch website has to get the viewers from somewhere even if you are not logged in and if it is possible how?

No

All of helix requires a token.

generate an app access/client credentails token and make your backend collect the information

A Client Credentials token is used for servers to do “anonomous data lookups” such as stream view counts as needed.

Make sure not to leak said token to your front end. So you’d want to make the front end use the backend to collect the view count

Is it possible to obtain this temporary Client Token for sending these requests or would this be against the TOS?

You generate a Token as documented…

^^ covers how to generate a token to use for server to server requests.

But how exactly does the Twitch website get the information if you’re not logged in?

Internal first party API

For us as third parties:

If you want to get how many viewers are watching a stream.
And you can’t sensibly get a token from a user of your website.
Then you generate a token to call the API with for your backend.

This is nothing to do with how the Twitch website itself works, as we are only talking about the third party API.

You’re right, this is getting off-topic here.

This post was flagged by the community and is temporarily hidden.