Skip to content
Python 3.5 Youtube v3 API package
Python Other
  1. Python 98.7%
  2. Other 1.3%
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.vscode
Lib
Scripts
YoutubeV3API.egg-info
__pycache__
build/lib/youtube_v3api
dist
youtube_v3api
.gitattributes
.gitignore
README.md
pip-selfcheck.json
pyvenv.cfg
setup.py

README.md

Youtube v3 API module for Python 3.5

Requires :

- Python 3.5.2 - requests 2.12 - Youtube APIKey that can be obtained with your google account in the developer console

Install :

Download the wheel file from the 'dist' folder and launch virtual env in command prompt and enter :
>>pip install c:\path\to\wheel\file\YoutubeV3API-0.1.1-py3-none-any.whl

Quick usage :

from youtube_v3api import youtube

#Retrieves a channel information based on the channelid, returns -> model.Channel object

mychannel = Channel()
mychannel = youtube.get_channel(channelid , APIKey)

'''Retrieves videos information (exclusive video stats for each Video, is faster than with stats) 
based on a channelid returns -> collection of model.Video elements
by default the youtube query response is ordered by viewCount.
OrderBy valid values : viewCount, title, rating, date '''

videoElements = []
videoElements = youtube.get_videos_without_stats(channelid , APIKey , maxResult = 5 , orderBy = 'viewCount')

'''Retrieves videos information (inclusive video stats for each Video, this generates extra queries) 
based on a channelid returns -> collection of model.Video elements
by default the youtube query response is ordered by viewCount. 
OrderBy valid values : viewCount, title, rating, date '''

videoElements = []
videoElements = youtube.get_videos_with_stats(channelid , APIKey ,  maxResult = 5  , orderBy = 'viewCount')

'''retrieves channel info based on keywords 
(keywords format=string, inclusive ex: 'key1|key2|key_n' exclusive ex: ' -key1 -key2'
by default the youtube query response is ordered by viewCount.
OrderBy valid values : viewCount, title, rating, date, videoCount
Maxresult is maximum 50
returns -> collection of model.Channel objects'''

channelElements = []
channelElements = youtube.search_channels_on_keywords(keywords , APIKey, maxResults = 10 , orderBy = 'viewCount')

'''retrieves channel info based on keywords 
(keywords format=string, ex: 'key1|key2|key_n' exclusive ex: ' -key1 -key2'
by default the youtube query response is ordered by viewCount. 
OrderBy valid values : viewCount, title, rating, date
Maxresult is maximum 50
returns -> collection of model.Channel objects'''

videoElements = []
videoElements = youtube.search_videos_on_keywords(keywords , APIKey , maxResults = 10 , orderBy = 'viewCount')

Objects reference

</tr>
Video
channelidThe youtube ID of the channel
idThe youtube ID of the video
pubdateVideo publishing date
titleTitle of the video
descDescription of the video
thumb_defaultThe video default thumbnail image link
thumb_mediumMedium size thumbnail link
thumb_highHigh size thumbnail link
channeltitleThe channel title
statsA dictionary containing the video statistics
Keys { 'views':0 , 'likes':0 , 'dislikes':0 , 'comments':0 }
Channel
idThe youtube channel id
titleChannel name
descChannel description
pubdateCreation date
thumb_defaultThe channel logo
thumb_mediumChannel medium size banner
thumb_highChannel high size banner
statsChannel statistics dictionary
{'views':0,'comments':0,'subs':0,'videos':0}
videosList of model.Video objects
You can’t perform that action at this time.