Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tombulled/innertube
Python Client for Google's Private InnerTube API. Works with YouTube, YouTube Music and more!
https://github.com/tombulled/innertube
api google innertube python youtube
Last synced: about 20 hours ago
JSON representation
Python Client for Google's Private InnerTube API. Works with YouTube, YouTube Music and more!
- Host: GitHub
- URL: https://github.com/tombulled/innertube
- Owner: tombulled
- License: mit
- Created: 2021-02-24T19:29:51.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-08-12T21:34:05.000Z (4 months ago)
- Last Synced: 2024-12-17T19:04:14.792Z (8 days ago)
- Topics: api, google, innertube, python, youtube
- Language: Python
- Homepage: https://pypi.org/project/innertube/
- Size: 294 KB
- Stars: 303
- Watchers: 7
- Forks: 23
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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:
* [Gizmodo - How Project InnerTube Helped Pull YouTube Out of the Gutter](https://gizmodo.com/how-project-innertube-helped-pull-youtube-out-of-the-gu-1704946491)
* [Fast Company - To Take On HBO And Netflix, YouTube Had To Rewire Itself](https://www.fastcompany.com/3044995/to-take-on-hbo-and-netflix-youtube-had-to-rewire-itself)## Installation
`innertube` uses [Poetry](https://github.com/python-poetry/poetry) under the hood and can easily be installed from source or from PyPI using *pip*.### Latest Release
```console
pip install innertube
```### Bleeding Edge
```console
pip install git+https://github.com/tombulled/innertube@develop
```## Usage
```python
>>> 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](https://developers.google.com/youtube/v3/)
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.