Skip to main content

How to search among Youtube videos and extract their metadata using an easy interface.

Project description

An Easy Wrapper for Youtube API 3.0

YouTube is one of the main sources of education, entertainment, advertisement, and much more. This service has so much data that one can use to run data science projects or build machine learning products. For example, YouTube video comments can be an excellent source of NLP projects. YouTube API enables you to search for videos matching specific search criteria but it might be a bit confusing for some people. This library provides you a very easy interface to extract Youtube video metadata including title, comments, and stats. Hope you enjoy it.

Note- You must setup your credentials before being able to use this library. To learn how to setup credentials, read this link: Extracting YouTube Comments with YouTube API & Python. This is an excellent post about Youtube API service, and help you step-by-step configure the credentials. You need to pass the FOLDER_PATH of the credentials when you want to initialize the youtube-easy-api library.


The library requires the following libraries:

  • urllib
  • googleapiclient
  • google_auth_oauthlib
  • google


It can be installed using pip:

pip install youtube-easy-api


You can search Youtube service using a keyword, and receive an ordered lists of videos according to the search configs.

from youtube_easy_api.easy_wrapper import *

easy_wrapper = YoutubeEasyWrapper()
search_keyword = 'python'
results = easy_wrapper.search_videos_by_keywords(q=search_keyword, part='id,snippet', type='video', order='relevance')
order_id = 0
video_id = results[order_id]['video_id']


You can also extract the metadata of a video by passing its video_id.

from youtube_easy_api.easy_wrapper import *

easy_wrapper = YoutubeEasyWrapper()
metadata = easy_wrapper.get_video_details(video_id='rdjnkb4ONWk')

'The Pink Panther Show Episode 59 - Slink Pink'

And, that's pretty much it!

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

youtube_easy_api-0.0.3.tar.gz (4.2 kB view hashes)

Uploaded source

Built Distribution

youtube_easy_api-0.0.3-py3-none-any.whl (4.7 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page