python-youtube-api
python-youtube-api copied to clipboard
A basic Python YouTube v3 API to fetch data from YouTube using public API-Key without OAuth
Python YouTube API
A basic Python YouTube v3 API to fetch data from YouTube using public API-Key without OAuth.
It can fetch video comments for a given video URL, keyword based search (returns videos, playlist, channel) and return videos data for a given channelId. It store the data into output directory in CSV files.
You are required to get the API key from Google API console in order to use this script
Install Dependencies
- pip3 install -r requirements.txt
How to use
- Pass --c after file name for fetching comments from videos
- Pass --s after file name for fetching results based on search keyword
- Pass --sc after file name for fetching videos based on YouTube ChannelId
It is mandatory to pass any of the above argument after file name
Video Comments
- --max argument for defining the maximum result to return (default=10)
- --videourl argument for defining the youtube URL Mandatory
- --key argument for defining API key Mandatory
Search by Keyword
- --max argument for defining the maximum result to return (default=10)
- --search argument for giving the keyword
- --r argument for defining region (Country) For ex. --r=IN (Argument should be a country code)
- --key argument for defining your developer API key Mandatory
Search Videos by YouTube ChannelId
- --max argument for defining the maximum result to return (default=10)
- --channelid argument for defining channel id Mandatory
- --key argument for defining your developer API key Mandatory