Skip to main content

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ytmusicapi-1.12.2.tar.gz (663.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ytmusicapi-1.12.2-py3-none-any.whl (110.9 kB view details)

Uploaded Python 3

File details

Details for the file ytmusicapi-1.12.2.tar.gz.

File metadata

  • Download URL: ytmusicapi-1.12.2.tar.gz
  • Upload date:
  • Size: 663.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for ytmusicapi-1.12.2.tar.gz
Algorithm Hash digest
SHA256 8674ab9a02d2c1bdf137166c78dcf4c4568360e46ede1b31549edf6750db530a
MD5 387bfdf24b119d07735c67481ee09f0f
BLAKE2b-256 f5563813d8fb327f5d91777dfb715d73030324920f030ffdc10fd05fd1f79761

See more details on using hashes here.

Provenance

The following attestation bundles were made for ytmusicapi-1.12.2.tar.gz:

Publisher: pythonpublish.yml on sigma67/ytmusicapi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ytmusicapi-1.12.2-py3-none-any.whl.

File metadata

  • Download URL: ytmusicapi-1.12.2-py3-none-any.whl
  • Upload date:
  • Size: 110.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for ytmusicapi-1.12.2-py3-none-any.whl
Algorithm Hash digest
SHA256 54b42b26d76de9b954f306a44e1ba4413a830cb2c41c019d255a297af941711e
MD5 572c3073ab57019aa77f011275b04e17
BLAKE2b-256 5cb85a925aabd5fa7c31f20bf84d352a3fc372aa62cc0965f27dd43f8a22289f

See more details on using hashes here.

Provenance

The following attestation bundles were made for ytmusicapi-1.12.2-py3-none-any.whl:

Publisher: pythonpublish.yml on sigma67/ytmusicapi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page