Authorization Error with Helix

Apologies if I’m missing something obvious, but I’m trying to access the Streams API in Helix.

1 I get client-credentials through the endpoint, like so:

auth_url = "" +  client_id + "&client_secret=" + client_secret + "&grant_type=client_credentials"

r =, timeout=15)


info = r.json()

client_token = info['access_token']

This returns the token just fine.

2 Then, I pass this on to the endpoint:

headers = {
        'Client_ID': client_id,
        'Authorization': 'Bearer ' + client_token,

helix_url = ""

helix_r = requests.get(helix_url, headers, timeout = 15)


stream_info = helix_r.json()


And I get a 401 error. The message body says the “OAuth token is missing”.

What am I missing? Thanks in advance.

What language is this?

Is this Python and requests?

The quick start docs

Says you have formatted your request wrong

helix_r = requests.get(helix_url, headers, timeout = 15)

should be

helix_r = requests.get(helix_url, headers=headers, timeout = 15)

I believe

Thanks for getting back to me. This is Python and I am using the requests library. I made the fix you suggested and I got the same error. I imagine it has something to do with encoding? I have used the same code (i.e., the call to the OAuth endpoint) to get and send the client-credentials via another API (that wraps the lower level guts) and it works. Just can’t figure out why my code isn’t working.

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