mirror of
https://github.com/metafy-social/python-scripts.git
synced 2024-11-27 22:11:10 +00:00
19 lines
518 B
Python
19 lines
518 B
Python
from googleapiclient.discovery import build
|
|
|
|
youtube = build('youtube', 'v3',
|
|
developerKey='Enter API key')
|
|
|
|
ch_request = youtube.channels().list(
|
|
part='statistics',
|
|
id='Enter Channel ID')
|
|
|
|
ch_response = ch_request.execute()
|
|
|
|
sub = ch_response['items'][0]['statistics']['subscriberCount']
|
|
vid = ch_response['items'][0]['statistics']['videoCount']
|
|
views = ch_response['items'][0]['statistics']['viewCount']
|
|
|
|
print("Total Subscriber:- ", sub)
|
|
print("Total Number of Videos:- ", vid)
|
|
print("Total Views:- ", views)
|