Skip to content
Chirag Rathod (Srce Cde) edited this page Feb 16, 2017 · 1 revision

Python YouTube API

A basic Python YouTube v3 API to fetch data from YouTube using public API-Key without OAuth

It fetch comments, perform search and return videos, channels and playlist in categorized form.

You are required to get the API key from Google API console in order to use this script

How to use

Pass --c after file name for calling Video Comment function Pass --s after file name for calling Search by Keyword Pass --sc after file name for calling Search videos by YouTube ChannelId
It is mandatory to pass any of the above argument after file name

Video Comments

  • python youtube_api_cmd.py --max --videourl --key
  • --max parameter for defining the maximum result you want (maxlimit = 100, default=20)
  • --videourl parameter for defining the youtube URL
  • --key parameter for defining your developer API key
  • --videourl and --key parameter is mandatory. --max parameter is optional

Search by Keyword

  • python youtube_api_cmd.py --search --max --key
  • --max parameter for defining the maximum result you want (maxlimit = 100, default=20)
  • --search parameter for giving the keyword
  • --key parameter for defining your developer API key Mandatory
  • It will return Videos, Channel and Playlist in the respective category

Search Videos by YouTube ChannelId

  • python youtube_api_cmd.py --channelid --max --key
  • --max parameter for defining the maximum result you want (maxlimit = 100, default=20)
  • --channelid parameter for defining channel id Mandatory
  • --key parameter for defining your developer API key Mandatory
  • It will list of Videos from the defined YouTube ChannelId

YouTube API v3

Contribute

License