Skip to content

Python Client for Google's Private InnerTube API. Works with YouTube, YouTube Music and more!

License

Notifications You must be signed in to change notification settings

peterxjang/innertube

This branch is up to date with tombulled/innertube:main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
github-actions
Aug 12, 2024
80c85c6 Β· Aug 12, 2024
Aug 7, 2022
Aug 12, 2024
May 9, 2024
May 2, 2022
Jan 22, 2023
Feb 24, 2021
Jan 22, 2023
Jan 22, 2023
Aug 12, 2024

Repository files navigation

innertube

Python Client for Google's Private InnerTube API. Works with YouTube, YouTube Music, YouTube Kids, YouTube Studio and more!

About

This library handles low-level interactions with the underlying InnerTube API used by each of the YouTube services.

Here are a few articles available online relating to the InnerTube API:

Installation

innertube uses Poetry under the hood and can easily be installed from source or from PyPI using pip.

Latest Release

pip install innertube

Bleeding Edge

pip install git+https://github.com/tombulled/innertube@develop

Usage

>>> import innertube
>>>
>>> # Construct a client
>>> client = innertube.InnerTube("WEB")
>>>
>>> # Get some data!
>>> data = client.search(query="foo fighters")
>>>
>>> # Power user? No problem, dispatch requests yourself
>>> data = client("browse", body={"browseId": "FEwhat_to_watch"})
>>>
>>> # The core endpoints are implemented, so the above is equivalent to:
>>> data = client.browse("FEwhat_to_watch")

Comparison with the YouTube Data API

The InnerTube API provides access to data you can't get from the Data API, however it comes at somewhat of a cost (explained below).

This Library YouTube Data API
Google account required No Yes
Request limit No Yes
Clean data No Yes

The InnerTube API is used by a variety of YouTube services and is not designed for consumption by users. Therefore, the data returned by the InnerTube API will need to be parsed and sanitised to extract data of interest.

Endpoints

Currently only the following core, unauthenticated endpoints are implemented:

YouTube YouTubeMusic YouTubeKids YouTubeStudio
config βœ“ βœ“ βœ“ βœ“
browse βœ“ βœ“ βœ“ βœ“
player βœ“ βœ“ βœ“ βœ“
next βœ“ βœ“ βœ“
search βœ“ βœ“ βœ“
guide βœ“ βœ“
get_transcript βœ“
music/get_search_suggestions βœ“
music/get_queue βœ“

Authentication

The InnerTube API uses OAuth2, however this has not yet been implemented, therefore this library currently only provides unauthenticated API access.

About

Python Client for Google's Private InnerTube API. Works with YouTube, YouTube Music and more!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%