Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


pip install mixer_shotcode

This is an example of Mixer shortcode OAuth in Python. An example can be found in in this directory. For more information about OAuth in general, check out the OAuth reference page on the Mixer developer site.

from mixer_shortcode import OAuthClient, ShortCodeAccessDeniedError, ShortCodeTimeoutError
import asyncio

my_client_id = '<Your OAuth token here!>'
scopes = ['interactive:robot:self']

async def get_access_token(client):
    code = await client.get_code()
    print("Go to and enter {}".format(code.code))

        return await code.accepted()
    except ShortCodeAccessDeniedError:
        print("The user denied access to our client")
    except ShortCodeTimeoutError:
        print("Yo, you're too slow! Let's try again...")
        return await get_access_token(client)

async def run():
    async with OAuthClient(my_client_id, scopes=scopes) as client:
        token = await get_access_token(client)
        print("Access token: {}".format(token.access))



> python
Go to and enter KJ3NA6
Access token: <snip>