A basic Python YouTube v3 API to fetch data from YouTube using public API-Key without OAuth
It fetches comments and some other information in a pandas DataFrame. Forked from srcecde and altered to fit my own data science pipelines.
You are required to get the API key from Google API console in order to use this script
- y = YouTubeAPI(api_key='*API key*')
data = y.get_video_comment(vid='dQw4w9WgXcQ')
- max_return: parameter for defining the maximum result you want (maxlimit = 100, default=100)
- vid: parameter for defining the youtube ID
- vid parameter mandatory. max_return parameter is optional