Skip to content

Commit 53b5167

Browse files
committed
Added script for fetching Youtube channel info
1 parent 7d4e1a9 commit 53b5167

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Youtube Channel Info
2+
This is a simple script that fetches info about a youtube channel.
3+
4+
## Usage
5+
- Clone the repo
6+
- download the requirements
7+
- add the api key and channel id
8+
- run python script.py
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from googleapiclient.discovery import build
2+
3+
youtube = build('youtube', 'v3',
4+
developerKey='Enter API key')
5+
6+
ch_request = youtube.channels().list(
7+
part='statistics',
8+
id='Enter Channel ID')
9+
10+
ch_response = ch_request.execute()
11+
12+
sub = ch_response['items'][0]['statistics']['subscriberCount']
13+
vid = ch_response['items'][0]['statistics']['videoCount']
14+
views = ch_response['items'][0]['statistics']['viewCount']
15+
16+
print("Total Subscriber:- ", sub)
17+
print("Total Number of Videos:- ", vid)
18+
print("Total Views:- ", views)

0 commit comments

Comments
 (0)