Get Games Analytics endpoint unauthorized

hi, I’m successfully getting my OAuth token and can run successfully calls on classic API such as the users API.

Ex:

url=“https://api.twitch.tv/helix/users
params = {‘login’: ‘mbxtreme’}
res = requests.get(url=url, params=params, headers=auth_headers)

However, everytime I try to use the get games analytics API I get a 401 unauthorized despite using the same auth token.

url=‘https://api.twitch.tv/helix/analytics/games
params = { “game_id”: “33214” }
res = requests.get(url, params=params, headers=auth_headers)

Is there some kind of permissions to get in order to access some APIs ?

Thanks

The Get Games Analytics endpoint requires the analytics:read:games scope, and it MUST be granted to your app by a user in the organization who owns that game on Twitch. Meaning if you want to see Fortnite analytics you need one of the Fortnite developers/publishers to explicitly grant your app that access.

1 Like

oh ok, so scope in the token request is not relevant
‘scope’:‘analytics:read:games’ ?

For App Access Tokens from the Client Credentials flow the scope does nothing as it doesn’t represent a user.

For User Access Tokens scopes do work, but if you use the analytics:read:games scope and go through the OAuth process, that just grants you access to games which you are the developer of. You can’t grant yourself permission to access stuff you have no right accessing. So for game analytics you need the game developers to go through your login process, to access things like channel subscribers you need that specific broadcaster to go through your login process, etc…

1 Like

got it, very helpful, thanks!

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