Get Stream Key with Python

Hi guys I want to get stream key with Python but I am very beginner and I do not know exactly what I should do please guide me

If you refer to the documentation

It’ll describe the required authentication:


  • User OAuth token
  • Required scope: channel:read:stream_key

This means you’ll need to generate a user access token, with the scope channel:read:stream_key

Either using:

Both flows will require a webpage that redirects the user to Twitch to accept or decline the link.

The first (implicit) gives youi a token good for around 60 days
The second returns a token good for around 4 hours, but comes with a refresh token that you can use to get a new access token.

When you have a token then you can call the Get Stream Key API and fetch the user stream key.

So you’ll need

  • to create something that can process the fetching of an access token.
  • create something to store the access token (and refresh token)
  • use that refresh token as needed to get a new access token
    THEN you’ll be able to write some code to then actually go get the access token.
1 Like

Thanks for the helpful tips :wink:

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