Drop all other modules and use only Requests as you have in import.
Call in line 15 is wrong
Example getting subscribers count for a YouTube channel.
Call in line 15 is wrong
snippet,id&order
can not have ,
.Example getting subscribers count for a YouTube channel.
import requests api_key = 'xxxxxxxxxxxxxxxxx' channel_id = 'UC5kS0l76kC0xOzMPtOmSFGw' response = requests.get(f'https://www.googleapis.com/youtube/v3/channels?part=statistics&id={channel_id}&key={api_key}')Test usage:
>>> response <Response [200]> >>> j = response.json() >>> j['items'][0]['statistics']['subscriberCount'] '273000'Possible fix for your call.
import requests api_key = 'xxxxxxxxxxxxxxxx' channel_id = 'UC5kS0l76kC0xOzMPtOmSFGw' response = requests.get(f'https://www.googleapis.com/youtube/v3/channels?part=snippet&order=date&maxResults=1&id={channel_id}&key={api_key}') json_data = response.json() # Do call on returned json_data