G
G
Gostin02020-01-06 23:53:06
API
Gostin0, 2020-01-06 23:53:06

Twitch api, how to find out the right parameter?

The essence of the question is the following, how to correctly write a Python script to log in and get the desired parameter, for example, the number of viewers in twitch.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
Gostin0, 2020-01-07
@Gostin0

if you believe the documentation and the correctness of writing the script, then everything should work

import requests
 
headers = {'Authorization': 'Bearer 5egdrak4zcq1zx3eo6ew5o1chyxxo4'}
r = requests.get('https://api.twitch.tv/helix/analytics/extensions?first=5', headers=headers, stream=True)
with open('test.html', 'w') as output_file:
  output_file.write(r.text)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question