Skip to main content

ytmusicapi: Unofficial API for YouTube Music

PyPI Downloads Ask questions at https://gitter.im/sigma67/ytmusicapi Code coverage Latest release Commits since latest release

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

Browsing:
  • 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

Exploring music:
  • get moods and genres playlists

  • get latest charts (globally and per country)

Library management:
  • 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

Playlists:
  • create and delete playlists

  • modify playlists: edit metadata, add/move/remove tracks

  • get playlist contents

  • get playlist suggestions

Podcasts:
  • get podcasts

  • get episodes

  • get channels

  • get episodes playlists

Uploads:
  • upload songs and remove them again

  • list uploaded songs, artists and albums

Localization:

If you find something missing or broken, check the FAQ or feel free to create an issue.

Requirements

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.4

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

Source distribution (sdist)

Source distribution for ytmusicapi 1.12.4
File Size Uploaded Provenance Actions
ytmusicapi-1.12.4.tar.gz 683.5 kB With provenance Details for ytmusicapi-1.12.4.tar.gz

Built distribution (wheel)

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

Total release size: 795.1 kB

Release files / ytmusicapi-1.12.4.tar.gz

Download URL ytmusicapi-1.12.4.tar.gz
Size 683.5 kB
Tags Source
SHA-256 checksum
How to use checksums
bb9e827aba9f9dac956583c9c9bb6de738a810721d449ab9fd4bb58457fd6d59
BLAKE2b-256 checksum
How to use checksums
1a32f43664949ae6f56dc8cae7a66724fbc49eae192488c6acf78f9a673d351f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 17, 2026.

Transparency log

Release files / ytmusicapi-1.12.4-py3-none-any.whl

Download URL ytmusicapi-1.12.4-py3-none-any.whl
Size 111.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6f2dd849f76850c8053cd40ecd7ae26e1195c0874463784a5203158a1ac453b0
BLAKE2b-256 checksum
How to use checksums
ac36dcd31faf354db266171a869ddc0026d568c801312f5fea790ebfb2e9bf68
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 17, 2026.

Transparency log

Security for ytmusicapi 1.12.4

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ytmusicapi-1.12.4.tar.gz

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 Nov 17, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.12.4 This release

2 release files Full provenance

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