Skip to main content

license doc

An Easy Wrapper for YouTube Data API 3.0

This module provides you an easy interface to extract YouTube video metadata including title, comments, and stats. You must setup your API KEY before being able to use this module. If you have your Google API key, you can skip this section; otherwise, check out this video: Getting Started - Creating an API Key and Querying the API. You must enter the API_KEY when you want to initialize the youtube-easy-api module. Check out the examples below. For more detailed description, you can read this article: An Easy Python Wrapper for YouTube Data API 3.0

Install

The module requires the following libraries:

  • google-api-python-client
  • google-auth-oauthlib
  • google

The, it can be installed using pip:

pip3 install youtube-easy-api

Make sure the pip is upgraded to the latest version.

Usage

The module currently support the methods below.

  • search_videos
  • get_metadata

You can search YouTube service by passing a search_keyword to the search_videos method. You will receive an ordered lists of videos according to the search configs.

from youtube_easy_api.easy_wrapper import *

easy_wrapper = YoutubeEasyWrapper()
easy_wrapper.initialize(api_key=API_KEY)
results = easy_wrapper.search_videos(search_keyword='python', order='relevance')
order_id = 1
video_id = results[order_id]['video_id']

print(video_id)
'_uQrJ0TkZlc'

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

from youtube_easy_api.easy_wrapper import *

easy_wrapper = YoutubeEasyWrapper()
easy_wrapper.initialize(api_key=API_KEY)
metadata = easy_wrapper.get_metadata(video_id='rdjnkb4ONWk')

print(metadata['title']) 
'The Pink Panther Show Episode 59 - Slink Pink'

print(metadata['statistics']['likeCount'])
285373

And, that's pretty much it!

Release files for youtube-easy-api 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for youtube-easy-api 0.2.2
File Size Uploaded
youtube_easy_api-0.2.2.tar.gz 4.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for youtube-easy-api 0.2.2
File Interpreter ABI Platform
youtube_easy_api-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 10.1 kB

Release files / youtube_easy_api-0.2.2.tar.gz

Download URL youtube_easy_api-0.2.2.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
c18d0b86aae97b470586fb011e270dc7349f065523dab621c37cf12e1f03638e
BLAKE2b-256 checksum
How to use checksums
70c0a47ac978a58b299c572362e95cdeb5b7c3f30eeb00b16ec0ea25b4a92e5f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0.post20200714 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.8.3

Release files / youtube_easy_api-0.2.2-py3-none-any.whl

Download URL youtube_easy_api-0.2.2-py3-none-any.whl
Size 5.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dbaa939490856a091ddde424b64ff1232e899f512caef27304fb6367c1d6e170
BLAKE2b-256 checksum
How to use checksums
e7bbfeff8a91c9c8ee241be70c776c21be452a013a242b95026c0a967dbaa449
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0.post20200714 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.8.3

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page