ytmusicapi
Unofficial API for YouTube Music
Decision gist · record as of 2026-08-14
Yes. ytmusicapi is actively maintained, has low install friction, carries no known vulnerabilities, uses a permissive MIT license, and solves a clear problem—programmatic access to YouTube Music. It's well-suited for automation and integration tasks. The main caveat is that it's unofficial and depends on YouTube Music's internal API, so changes on YouTube's side could break functionality without notice.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or higher and valid YouTube Music authentication credentials (oauth.json file).
- Low install friction with a single dependency (requests).
- Actively maintained with a recent release 6 days ago and 2940 repository stars, indicating steady community engagement.
License · maintenance · safety
MIT (permissive) — MIT license permits free use, modification, and distribution with minimal restrictions, making it suitable for both personal and commercial projects.
last release 2026-08-08 (6 days) · last repo commit 2026-08-14 · 2,940 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 330,939 downloads/mo, #7,526 on PyPI
Alternatives
Verify before relying
from ytmusicapi import YTMusic
yt = YTMusic('oauth.json')
playlist_id = yt.create_playlist('test', 'test description')
results = yt.search('Oasis Wonderwall')
yt.add_playlist_items(playlist_id, [results[0]['videoId']])- Whether YouTube Music API changes could break this library without warning, given its unofficial nature.
- Cookie-based authentication stability and whether account restrictions apply to programmatic access.
What it is and what it does
ytmusicapi is an unofficial Python library that lets you interact with YouTube Music programmatically by emulating web client requests using your account credentials. It wraps the YouTube Music API to provide a Python interface for common tasks like searching, browsing artist information, managing playlists, uploading songs, and accessing your library.
The library handles authentication through cookie or OAuth data and supports a wide range of operations: searching with filters, retrieving song metadata and lyrics, managing playlists and library content, accessing charts and mood playlists, and working with podcasts and uploads. It supports multiple languages and regions, making it useful for building automation tools, music discovery scripts, or integrations that need programmatic access to YouTube Music.
Use it for
- Automate playlist creation and management by searching for songs and adding them programmatically.
- Build a music discovery tool that retrieves charts, moods, and artist information across regions.
- Sync or backup your YouTube Music library contents (playlists, songs, uploads) to external storage.
- Create a bot or script that modifies your play history or rates songs based on custom logic.
- Integrate YouTube Music data into a personal music application or dashboard.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
ytmusicapi is actively maintained, has low install friction, carries no known vulnerabilities, uses a permissive MIT license, and solves a clear problem—programmatic access to YouTube Music. It's well-suited for automation and integration tasks. The main caveat is that it's unofficial and depends on YouTube Music's internal API, so changes on YouTube's side could break functionality without notice.
Install
ytmusicapi on PyPI
Before you install
Low install friction with a single dependency (requests). Actively maintained with a recent release 6 days ago and 2940 repository stars, indicating steady community engagement.
Requires Python 3.10 or higher and valid YouTube Music authentication credentials (oauth.json file).
License in practice
MIT license permits free use, modification, and distribution with minimal restrictions, making it suitable for both personal and commercial projects.
Quickstart
from ytmusicapi import YTMusic
yt = YTMusic('oauth.json')
playlist_id = yt.create_playlist('test', 'test description')
results = yt.search('Oasis Wonderwall')
yt.add_playlist_items(playlist_id, [results[0]['videoId']])
Verify before relying
- Whether YouTube Music API changes could break this library without warning, given its unofficial nature.
- Cookie-based authentication stability and whether account restrictions apply to programmatic access.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagerequests |
| Maintenance | Actively maintained 6 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 330,939 / month, #7,526 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Programming Language :: Python :: 3 |
Evidence: ytmusicapi-1.12.2-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “youtube music api python”
- ytmusicapiytmusicapi lets you programmatically interact with YouTube Music by…
- spotdlspotDL downloads songs from Spotify playlists on YouTube, embedding…
- youtube-search-pythonSearch YouTube for videos, channels, and playlists without the…
Give your agent the search over MCP, or paste the wish link into any chat.
More WWW/HTTP packages
urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.
Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.
h11 is a pure-Python HTTP/1.1 protocol implementation that handles parsing and serializing HTTP messages without any built-in I/O, letting you integrate it with any network layer you choose.
HTTPX is a fully featured HTTP client library for Python that provides both sync and async APIs, with support for HTTP/1.1 and HTTP/2, plus an integrated command-line client.
Install it if you are building new projects or modernizing existing ones that rely on HTTP.
A minimal low-level HTTP client library that sends HTTP requests with thread-safe and task-safe connection pooling, supporting HTTP/1.1, HTTP/2, proxies, and both sync and async interfaces.
aiohttp is an async HTTP client and server framework built on asyncio, supporting both WebSockets and middleware-based routing for building concurrent web applications.
Install it if you need async HTTP client or server capabilities in asyncio-based applications.
See also casttube · music-assistant-client · shazamio · spotifywebapipython · youtube-search-python · spotdl · discogs-client · spotapi · yelpapi · gkeepapi