I am trying to build an analytics tool using python, and I have been searching for a way to retrieve the live viewer count of a channel when it is online. Currently, I have this program, but I keep getting a 401 error saying that I need to pass in my OAuth token, which I have:
So, I was able to get an app access token yesterday with the POST command from the docs, and I was able to access the viewer count as well of a live channel. But today, with the same code, I am getting several errors.
Trying to get an app access token yields a <Response[200]> instead of a json dictionary object.
Trying to type the url with the client id and client secret in a browser results in a 404 page not found.
Trying to access the viewer count with the same code, oauth token, and client id yields a <Response[401]>, which I think is the error for when an OAuth token is not valid.
Yeah, I was printing r instead of r.text, so that’s my fault, sorry.
I now can get the app access key, but like before, my client ID and app access token are not matching according to the error response. I have generated a new app access token that expires in 2 months, so I don’t think that’s the problem. Sorry for being a noob at this.
If the API is saying your ClientID and Token don’t match then they don’t match, you need to check your code to check you are sending what you think you are sending to Twitch