ytmusicapi: Unofficial API for YouTube Music
ytmusicapi is a Python 3 library to send requests to the YouTube Music API. It emulates YouTube Music web client requests using the user’s cookie data for authentication.
Features
search (including all filters) and suggestions
get artist information and releases (songs, videos, albums, singles, related artists)
get user information (videos, playlists)
get albums
get song metadata
get watch playlists (next songs when you press play/radio/shuffle in YouTube Music)
get song lyrics
get moods and genres playlists
get latest charts (globally and per country)
get library contents: playlists, songs, artists, albums and subscriptions, podcasts, channels
add/remove library content: rate songs, albums and playlists, subscribe/unsubscribe artists
get and modify play history
create and delete playlists
modify playlists: edit metadata, add/move/remove tracks
get playlist contents
get playlist suggestions
get podcasts
get episodes
get channels
get episodes playlists
upload songs and remove them again
list uploaded songs, artists and albums
all regions are supported (see locations FAQ
16 languages are supported (see languages FAQ
If you find something missing or broken, check the FAQ or feel free to create an issue.
Requirements
Python 3.10 or higher - https://www.python.org
Setup
See the Documentation for detailed instructions
Usage
from ytmusicapi import YTMusic
yt = YTMusic('oauth.json')
playlistId = yt.create_playlist('test', 'test description')
search_results = yt.search('Oasis Wonderwall')
yt.add_playlist_items(playlistId, [search_results[0]['videoId']])
The tests are also a great source of usage examples.
Contributing
Pull requests are welcome. There are still some features that are not yet implemented. Please, refer to CONTRIBUTING.rst for guidance.
Metadata
Release files for ytmusicapi 1.12.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ytmusicapi-1.12.3.tar.gz | 666.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ytmusicapi-1.12.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 777.3 kB
Release files / ytmusicapi-1.12.3.tar.gz
| Download URL | ytmusicapi-1.12.3.tar.gz |
|---|---|
| Size | 666.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
be81511af7494eec8e5970c56a10e51aada6253246649e4ea6714fd6aeb654ee
|
|
BLAKE2b-256 checksum How to use checksums |
4a0da536a685d8b021ff984a3f9902600bc1fb613afe3c0b143e2b0d791a3c5c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 16, 2026.
Transparency logRelease files / ytmusicapi-1.12.3-py3-none-any.whl
| Download URL | ytmusicapi-1.12.3-py3-none-any.whl |
|---|---|
| Size | 111.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f65db840907a43ca23b29bd563951a1e390fbe2089d7aa4ddbe2043824b2acd9
|
|
BLAKE2b-256 checksum How to use checksums |
29ad6d471ea9d81e1f59a4d01badda21e7f3f508b94ed171c677b6547b292f73
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 16, 2026.
Transparency log