As mention bye @ndc85430 this is common task to do with Python.
Requests make it easy to do
A example YouTube API,usually with big API you get a API key(free here) to use.
Example find how many subscriber a channel has,so insert key and channel id with
As a standard usually get JSON back,it's a dictionary when use it from Python.
Requests make it easy to do
GET
and POST
request.A example YouTube API,usually with big API you get a API key(free here) to use.
Example find how many subscriber a channel has,so insert key and channel id with
f-string
.As a standard usually get JSON back,it's a dictionary when use it from Python.
import requests api_key = 'xxxxxxxxxxxxxx' channel_id = 'UC5kS0l76kC0xOzMPtOmSFGw' # chess.com response = requests.get(f'https://www.googleapis.com/youtube/v3/channels?part=statistics&id={channel_id}&key={api_key}') json_data = response.json() print(json_data['items'][0]['statistics']['subscriberCount'])
Output:285000