Looking for assistance as I think I am pretty close but keep getting 401 error. Any help would be appreciated. clientID and clientSecret have been removed for privacy. I want to start using the API to import data in JSON and start playing around the data.
#Setting up the parameters to use
baseURL = “https://api.twitch.tv/helix/”
clientID = [Redacted]
clientSecret = [Redacted]
headers = {‘client-id’: clientID, ‘Authorization’: clientSecret}
indent = 2
import requests
#r = requests.get(‘https://api.twitch.tv/helix/search/channels?query=a_seagull’, headers=headers, params=payload)
r = requests.get(‘https://api.twitch.tv/helix/search/channels?query=a_seagull’, headers=headers)
r.status_code
headers = {‘client-id’: clientID, ‘Authorization’: clientSecret}
OAuth = requests.get(‘https://id.twitch.tv/oauth2/validate’.client_id = clientID, client_secret = clientSecret, scopes=[twitch.constants.OAUTH_SCOPE_ANALYTICS_READ_EXTENSIONS])
OAuth.status_code