--- id: ytmusicapi version: "1.12.2" license: MIT license_treatment: permissive maintenance: active --- # ytmusicapi — Unofficial API for YouTube Music License: permissive · Maintenance: active · Downloads: 330.9K/mo ## 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 above — verify before relying. ytmusicapi lets you programmatically interact with YouTube Music by sending authenticated requests to its API, enabling you to search, browse, manage playlists, and control your library. 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 pip install ytmusicapi uv add ytmusicapi poetry add ytmusicapi ## Installing ytmusicapi 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. 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']]) Requires Python 3.10 or higher and valid YouTube Music authentication credentials (oauth.json file). 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_current - Install friction: low - Maintenance: active - Downloads: 330.9K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags youtube music api python, youtube music library automation, playlist management youtube music, youtube music search programmatic, youtube music unofficial client, youtube music authentication python, youtube music metadata retrieval, music-api, youtube-integration, automation [View on SkillFed](https://skillfed.io/packages/ytmusicapi) · [View on PyPI](https://pypi.org/project/ytmusicapi/)