Skip to main content

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

*Even the InnerTube API has some request limits, however these are so high that you'll likely never hit them.

**The YouTube Data API has a default quota allocation of 10,000 units per day. You can read more here.

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.

Metadata

Release files for innertube 2.1.19

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

Source distribution (sdist)

Source distribution for innertube 2.1.19
File Size Uploaded
innertube-2.1.19.tar.gz 15.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for innertube 2.1.19
File Interpreter ABI Platform
innertube-2.1.19-py3-none-any.whl Python 3 none any Details

Total release size: 31.8 kB

Release files / innertube-2.1.19.tar.gz

Download URL innertube-2.1.19.tar.gz
Size 15.3 kB
Tags Source
SHA-256 checksum
How to use checksums
4fcfb2af13a4e602e4fa4a3c79855dbad4c4e7c389c9a75daa3876c552ca90e8
BLAKE2b-256 checksum
How to use checksums
7c87e759b080c7eb697f1cb76445eafee666afb53387b1604f6aa6428f8dcd3f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.10.12 Linux/5.15.0-142-generic

Release files / innertube-2.1.19-py3-none-any.whl

Download URL innertube-2.1.19-py3-none-any.whl
Size 16.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5c8d90a49e9a3f86c1820b137ff5a3ffb9324214da01f42016acd91767281317
BLAKE2b-256 checksum
How to use checksums
45fce670fa42c51260e34b88a97f7f4c896ca913de8aa3cb94a751fa58f4e9f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.10.12 Linux/5.15.0-142-generic

Release history Release notifications | RSS feed

This release

2.1.19 This release

2 release files

2.1.16

2 release files

2.1.15

2 release files

2.1.14

2 release files

2.1.13

2 release files

2.1.10

2 release files

2.1.9

2 release files

2.1.3

2 release files

2.1.0

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.0.13

2 release files

1.0.12

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

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