Home

Awesome

Python Musixmatch

Simple integrate of API musixmatch.com with python

Github Issues MIT licensed

Logo

Quick start

$ pip install pymusixmatch

or

$ python setup.py install

Authentication

Register for an API key:

All you need to do is register in order to get your API key, a mandatory parameter for most of our API calls. It’s your personal identifier and should be kept secret.

Usage

With your key in hand, it's time to authenticate, so run:

>>> from musixmatch import Musixmatch

>>> musixmatch = Musixmatch('<apikey>')

Chart Artists Get

This api provides you the list of the top artists of a given country.

Parameters:

>>> musixmatch.chart_artists(1, 1)

Chart Tracks Get

This api provides you the list of the top songs of a given country.

Parameters:

>>> musixmatch.chart_tracks_get(1, 1)

Chart Tracks Get

Search for track in our database.

Parameters:

>>> musixmatch.track_search(q_track='Stressed Out', q_artist='twentyonepilots', page_size=10, page=1, s_track_rating='desc')

Track Get

Get a track info from our database: title, artist, instrumental flag and cover art.

Parameters:

>>> musixmatch.track_get(15445219)

Track Lyrics Get

Get the lyrics of a track.

Parameters:

>>> musixmatch.track_lyrics_get(15953433)

Track Snippet Get

Get the snippet for a given track.

A lyrics snippet is a very short representation of a song lyrics. It’s usually twenty to a hundred characters long and it’s calculated extracting a sequence of words from the lyrics.

Parameters:

>>> musixmatch.track_snippet_get(16860631)

Track Snippet Get

Retreive the subtitle of a track.

Return the subtitle of a track in LRC or DFXP format. Refer to Wikipedia LRC format page or DFXP format on W3c for format specifications.

Parameters:

>>> musixmatch.track_subtitle_get(14201829)

Track Richsync Get

Get the Rich sync for a track.

A rich sync is an enhanced version of the standard sync which allows:

Parameters:

>>> musixmatch.track_richsync_get(14201829)

Track Lyrics Post

Submit a lyrics to our database.

It may happen we don’t have the lyrics for a song, you can ask your users to help us sending the missing lyrics. We’ll validate every submission and in case, make it available through our api.

Please take all the necessary precautions to avoid users or automatic software to use your website/app to use this commands, a captcha solution like http://www.google.com/recaptcha or an equivalent one has to be implemented in every user interaction that ends in a POST operation on the musixmatch api.

Parameters:

>>> musixmatch.track_lyrics_post(1471157, 'test')

Track Lyrics Post

This API method provides you the opportunity to help us improving our catalogue.

We aim to provide you with the best quality service imaginable, so we are especially interested in your detailed feedback to help us to continually improve it.

Please take all the necessary precautions to avoid users or automatic software to use your website/app to use this commands, a captcha solution like http://www.google.com/recaptcha or an equivalent one has to be implemented in every user interaction that ends in a POST operation on the musixmatch api.

Parameters:

>>> musixmatch.track_lyrics_feedback_post(1471157, 4193713, 'wrong_verses')

Matcher Lyrics Get

Get the lyrics for track based on title and artist.

Parameters:

>>> musixmatch.matcher_lyrics_get('Sexy and I know it', 'LMFAO')

Matcher Track Get

Match your song against our database.

In some cases you already have some informations about the track title, artist name, album etc. A possible strategy to get the corresponding lyrics could be:

The matcher.track.get method does all the job for you in a single call. This way you dont’t need to worry about the details, and you’ll get instant benefits for your application without changing a row in your code, while we take care of improving the implementation behind. Cool, uh?

Parameters:

>>> musixmatch.matcher_track_get('Lose Yourself (soundtrack)', 'Eminem')

Matcher Subtitle Get

You can use the f_subtitle_length_max_deviation to fetch subtitles within a given duration range.

Parameters:

Note: This method requires a commercial plan.

>>> musixmatch.matcher_subtitle_get('Sexy and I know it', 'LMFAO', 200, 3)

Artist Get

Get the artist data from our database.

Parameters:

>>> musixmatch.artist_get(118)

Artist Search

Search for artists in our database.

Parameters:

>>> musixmatch.artist_search('prodigy', 1, 1, 16439, '4a4ee089-93b1-4470-af9a-6ff575d32704')

Artist Album Get

Get the album discography of an artist.

Parameters:

>>> musixmatch.artist_albums_get(1039, 1, 1, 1, 'desc')

Artist Related Get

Get a list of artists somehow related to a given one.

Parameters:

>>> musixmatch.artist_related_get(56, 1, 1)

Album Get

Get an album from our database: name, release_date, release_type, cover art.

Parameters:

>>> musixmatch.album_get(14250417)

Album Tracks Get

This api provides you the list of the songs of an album.

Parameters:

>>> musixmatch.album_tracks_get(13750844, 1, 1, '')

Tracking Url Get

Get the base url for the tracking script

With this api you’ll be able to get the base url for the tracking script you need to insert in your page to legalize your existent lyrics library.

Read more here: rights-clearance-on-your-existing-catalog

In case you’re fetching the lyrics by the musiXmatch api called track.lyrics.get you don’t need to implement this API call.

Parameters:

>>> musixmatch.album_tracks_get(13750844, 1, 1, '')

Catalogue Dump Get

Get the list of our songs with the lyrics last updated information

CATALOGUE_COMMONTRACKS

Dump of our catalogue in this format:

{
    "track_name": "Shape of you",
    "artist_name": "Ed Sheeran",
	"commontrack_id": 12075763,
    "instrumental": false,
    "has_lyrics": yes,
    "updated_time": "2013-04-08T09:28:40Z"
}

Note: This method requires a commercial plan.

>>> musixmatch.catalogue_dump_get('test')

Features

Dependencies

License

MIT