DEV Community

Sijey
Sijey

Posted on • Updated on

YouTube Music API

An unofficial YouTube Music API For Python Programming Language.
A Python library which Quickly gather the metadata of a Song, Playlist, Artist existing on YouTube or YouTube Music.

Installation

pip install YouTubeMusicAPI

This library can be installed by the pip command, open your command prompt and type in the following command...

No Credential details required.

Basic GET usage:

from YouTubeMusicAPI import YouTubeMusicAPI

artist = YouTubeMusicAPI("marshmello").artist()

print(artist)

# output of this program

{
    'artist': 'Marshmello', 
    'artist_url': 'https://music.youtube.com/channel/6yIPyTp...', 
    'artist_id': 'UCEdvpU2pFRCVqU6yIPyTpMQ', 
    'artist_image': 'https://yt3.ggpht.com/3kmvsf3NN...'
} 
Enter fullscreen mode Exit fullscreen mode
from YouTubeMusicAPI import YouTubeMusicAPI

track = YouTubeMusicAPI("marshmello").track()

print(track)

# output of this program

{
    'track_name': 'Marshmello Live at Lollapalooza 2021 ...', 
    'datePublished': '2021-08-04', 
    'track_Id': '8eXFvzMEldk', 
    'track_url': 'https://music.youtube.com/watch?v=8eXFvzMEldk', 
    'track_image': 'https://i.ytimg.com/vi/8eXFvzMEldk/hqdef...'
}
Enter fullscreen mode Exit fullscreen mode
from YouTubeMusicAPI import YouTubeMusicAPI

playlist = YouTubeMusicAPI("marshmello").artist()

print(playlist)

# output of this program

{
    'playlist_name': 'Marshmallow Playlist', 
    'playlist_url': 'https://music.youtube.com/playlist...', 
    'playlist_id': 'PL4FB1JvhTLrGNSL4odYt72EqjDPJfjSdp'
}
Enter fullscreen mode Exit fullscreen mode

If you like this Package you can support me by giving a star ⭐ on
the GitHub Repository. πŸ‘

Source Code : https://github.com/Sijey-Praveen/YouTube-Music-API
PyPi : https://pypi.org/project/YouTubeMusicAPI/

Discussion (2)

Collapse
plexpert profile image
Saleh Ahmed

Wow. Thanks for sharing this information.

Collapse
sijeypraveen profile image
Sijey Author

my pleasure πŸ‘