Authenticating with Twitch API using Python


I use the following API in Python:

The twitchingpython api throws an exception and i found out that it’s doing that because my token is invalid (but it is not, i double checked with direct url in my browser).

Python Code:


import twitchingpython

token = "mytoken"
channel = 'nullby7e'
status  = 'new_status'
game    = 'new_game'

wrapper = twitchingpython.TwitchingWrapper(token)
wrapper.updatechannel(channel, status, game)

I also have a question about this on stackoverflow with a similar Python script, without the twitchingpython API.

On an offtopic note; I am not receiving an activation mail for my other Twitch Developers account: NullBy7e.
It’s been two days since I registered.

If you are getting a 401 error, it is most likely that your token is invalid, or that you aren’t sending the token properly for some reason. Assuming your wrapper is used by other people and not buggy, it’s reasonable that your token is not valid, or does not possess the scopes required to update channel information.

You can check if an oauth token is valid and what scopes it has by GETting Updating channel status and game requires the channel_editor scope.

It may be a confusion on my part.
I generated the OAuth token with TMI and it doesn’t have the channel_editor scope.

I used this: to get my token and I should have read better.


I tried to get my token via: and I get this:

{"error":"Not Found","status":404,"message":null}

I think you meant to visit

Now I get: ?


The redirect url I entered is the same as the url set in the client id account.

Make sure the uri is exactly the same. Ex:
Every character must be the same, even if they point to the same ip.

Yep it’s the same, I set the url to on the account that belongs to the client id.

Don’t forget to include the protocol as well: should be or if you are using SSL.