According to the docs here:
https://dev.twitch.tv/docs/v5/guides/using-the-twitch-api/#translating-from-user-names-to-user-ids
I am supposed to receive a response based on username passed. Below is the response I am receiving:
200
{‘Date’: ‘Tue, 23 May 2017 22:23:38 GMT’, ‘Content-Type’: ‘application/json’, ‘Transfer-Encoding’: ‘chunked’, ‘Connection’: ‘keep-alive’, ‘Server’: ‘nginx’, ‘Access-Control-Allow-Origin’: ‘*’, ‘Cache-Control’: ‘no-cache, no-store, must-revalidate, private’, ‘Expires’: ‘0’, ‘Pragma’: ‘no-cache’, ‘Twitch-Trace-Id’: ‘2f7da5e1bba7946b7c1892e7c8e68915’, ‘X-Ctxlog-Logid’: ‘1-5924b66a-5142971b02b514964bbcf54b’, ‘Front-End-Https’: ‘on’, ‘Timing-Allow-Origin’: ‘https://www.twitch.tv’, ‘Content-Encoding’: ‘gzip’}
I’m using python 3.6 + requests library:
header = {‘Accept’: ‘application/vnd.twitchtv.v5+json’,‘Client-ID’: ‘xxxx’ }
getuserIDurl = ‘https://api.twitch.tv/kraken/users?login=therealcarbon’
testGET = requests.get(getuserIDurl, headers=header)
print(testGET.status_code)
print(testGET.headers)