mxmapi
- class mxmapi.Musixmatch(API_key, requests_session=True, retries=3, requests_timeout=5, backoff_factor=0.3)
- album_get(album_id)
Get the album object using the musixmatch id.
- Parameters:
album_id – The musixmatch album id.
- album_tracks_get(album_id, f_has_lyrics=0, page=1, page_size=100)
This api provides you the list of the songs of an album.
- Parameters:
album_id – The musixmatch album id.
f_has_lyrics – When set, filter only contents with lyrics.
page – Define the page number for paginated results
page_size – Define the page size for paginated results. Range is 1 to 100.
- artist_albums_get(artist_id, page=1, page_size=100, g_album_name=1, s_release_date='desc')
Get the album discography of an artist
- Parameters:
q_artist – The song artist
page – Define the page number for paginated results
page_size – Define the page size for paginated results. Range is 1 to 100.
g_album_name – Group by Album Name
s_release_date – Sort by release date (asc|desc)
- artist_get(artist_id)
Get the artist data.
- Parameters:
artist_id – Musixmatch artist id
Get a list of artists somehow related to a given one.
- Parameters:
q_artist – The song artist
page – Define the page number for paginated results
page_size – Define the page size for paginated results. Range is 1 to 100.
- artist_search(q_artist, page=1, page_size=100, f_artist_id=None)
Search for artists
- Parameters:
q_artist – The song artist
page – Define the page number for paginated results
page_size – Define the page size for paginated results. Range is 1 to 100.
f_artist_id – When set, filter by this artist id
- chart_artists_get(page, page_size, country='US')
This api provides you the list of the top artists of a given country.
- Parameters:
page – Define the page number for paginated results
page_size – Define the page size for paginated results. Range is 1 to 100.
country – A valid country code (default US)
- chart_tracks_get(chart_name, page=1, page_size=100, f_has_lyrics=1, country='US')
This api provides you the list of the top artists of a given country.
- Parameters:
page – Define the page number for paginated results
page_size – Define the page size for paginated results. Range is 1 to 100.
chart_name – Select among available charts: top : editorial chart hot : Most viewed lyrics in the last 2 hours mxmweekly : Most viewed lyrics in the last 7 days mxmweekly_new : Most viewed lyrics in the last 7 days limited to new releases only
f_has_lyrics – When set, filter only contents with lyrics, Takes (0 or 1)
country – A valid country code (default US)
- matcher_lyrics_get(q_track=None, q_artist=None, q_album=None, commontrack_id=None, track_id=None, track_isrc=None, commontrack_vanity_id=None, track_spotify_id=None, track_itunes_id=None, **filters)
Get the lyrics for track based on title and artist
QUERYING: (At least one required) :param q_track: search for a text string among song titles :param q_artist: search for a text string among artist names :param q_album: The song album
Objects: (optional) :param commontrack_id: Musixmatch commontrack id :param track_id: Musixmatch track id :param track_isrc: A valid ISRC identifier :param commontrack_vanity_id: Musixmatch vanity id ex “Imagine-Dragons/Demons” :param track_spotify_id: Spotify Track ID :param track_itunes_id: Apple track ID
FILTERING: (optional) :param f_subtitle_length: The desired length of the subtitle (seconds) :param f_subtitle_length_max_deviation: The maximum deviation allowed from the f_subtitle_length (seconds) :param f_has_lyrics: Filter by objects with available lyrics :param f_is_instrumental: Filter instrumental songs :param f_has_subtitle: Filter by objects with available subtitles (1 or 0) :param f_music_genre_id: Filter by objects with a specific music category :param f_lyrics_language: Filter the tracks by lyrics language :param f_artist_id: Filter by objects with a given Musixmatch artist_id :param f_artist_mbid: Filter by objects with a given musicbrainz artist id
- matcher_subtitle_get(q_track=None, q_artist=None, q_album=None, commontrack_id=None, track_id=None, track_isrc=None, commontrack_vanity_id=None, track_spotify_id=None, track_itunes_id=None, **filters)
Get the subtitles for a song given his title,artist and duration. You can use the f_subtitle_length_max_deviation to fetch subtitles within a given duration range.
QUERYING: (At least one required) :param q_track: search for a text string among song titles :param q_artist: search for a text string among artist names :param q_album: The song album
Objects: (optional) :param commontrack_id: Musixmatch commontrack id :param track_id: Musixmatch track id :param track_isrc: A valid ISRC identifier :param commontrack_vanity_id: Musixmatch vanity id ex “Imagine-Dragons/Demons” :param track_spotify_id: Spotify Track ID :param track_itunes_id: Apple track ID
FILTERING: (optional) :param f_subtitle_length: The desired length of the subtitle (seconds) :param f_subtitle_length_max_deviation: The maximum deviation allowed from the f_subtitle_length (seconds) :param f_has_lyrics: Filter by objects with available lyrics :param f_is_instrumental: Filter instrumental songs :param f_has_subtitle: Filter by objects with available subtitles (1 or 0) :param f_music_genre_id: Filter by objects with a specific music category :param f_lyrics_language: Filter the tracks by lyrics language :param f_artist_id: Filter by objects with a given Musixmatch artist_id :param f_artist_mbid: Filter by objects with a given musicbrainz artist id
- matcher_track_get(q_track=None, q_artist=None, q_album=None, commontrack_id=None, track_id=None, track_isrc=None, commontrack_vanity_id=None, track_spotify_id=None, track_itunes_id=None, **filters)
Match your song against Musixmatch database.
QUERYING: (At least one required) :param q_track: search for a text string among song titles :param q_artist: search for a text string among artist names :param q_album: The song album
Objects: (optional) :param commontrack_id: Musixmatch commontrack id :param track_id: Musixmatch track id :param track_isrc: A valid ISRC identifier :param commontrack_vanity_id: Musixmatch vanity id ex “Imagine-Dragons/Demons” :param track_spotify_id: Spotify Track ID :param track_itunes_id: Apple track ID
FILTERING: (optional) :param f_has_lyrics: Filter by objects with available lyrics :param f_is_instrumental: Filter instrumental songs :param f_has_subtitle: Filter by objects with available subtitles (1 or 0) :param f_music_genre_id: Filter by objects with a specific music category :param f_subtitle_length: Filter subtitles by a given duration in seconds :param f_subtitle_length_max_deviation: Apply a deviation to a given subtitle duration (in seconds) :param f_lyrics_language: Filter the tracks by lyrics language :param f_artist_id: Filter by objects with a given Musixmatch artist_id :param f_artist_mbid: Filter by objects with a given musicbrainz artist id
- music_genres_get()
Get the list of the music genres of our catalogue.
- track_get(commontrack_id=None, track_id=None, track_isrc=None, commontrack_vanity_id=None, track_spotify_id=None, track_itunes_id=None)
Get a track info from their database by objects Just one Parameter is required :param commontrack_id: Musixmatch commontrack id :param track_id: Musixmatch track id :param track_isrc: A valid ISRC identifier :param commontrack_vanity_id: Musixmatch vanity id ex “Imagine-Dragons/Demons” :param track_spotify_id: Spotify Track ID :param track_itunes_id: Apple track ID
- track_lyrics_get(commontrack_id=None, track_id=None, track_spotify_id=None)
Get the lyrics of a track.
- Parameters:
commontrack_id – Musixmatch commontrack id
track_id – Musixmatch track id
track_spotify_id – Spotify Track ID
- track_lyrics_mood_get(commontrack_id=None, track_isrc=None)
Get the mood list (and raw value that generated it) of a lyrics
- Note:
Not available for the free plan
- Parameters:
commontrack_id – The track commontrack
track_isrc – A valid ISRC identifier
- track_lyrics_post(lyrics: str, commontrack_id=None, track_isrc=None)
Submit a lyrics to Musixmatch database.
- Parameters:
lyrics – The lyrics to be submitted
commontrack_id – The track commontrack
track_isrc – A valid ISRC identifier
- track_lyrics_translation_get(commontrack_id=None, track_id=None, track_isrc=None, track_spotify_id=None, selected_language=None, min_completed=None)
Get a translated lyrics for a given language
- Parameters:
commontrack_id – The track commontrack
track_id – Musixmatch track id
track_isrc – A valid ISRC identifier
track_spotify_id – Spotify Track ID
selected_language – he language of the translated lyrics (ISO 639-1)
min_completed – Teal from 0 to 1. If present, only the tracks with a translation ratio over this specific value, for a given language, are returned Set it to 1 for completed translation only, to 0.7 for a mimimum of 70% complete translation.
f_subtitle_length – The desired length of the subtitle (seconds)
f_subtitle_length_max_deviation – The maximum deviation allowed from the f_subtitle_length (seconds)
- track_richsync_get(commontrack_id=None, track_id=None, track_isrc=None, track_spotify_id=None, f_richsync_length=None, f_richsync_length_max_deviation=None)
A rich sync is an enhanced version of the standard sync.
- Parameters:
commontrack_id – The track commontrack
track_id – Musixmatch track id
track_isrc – A valid ISRC identifier
track_spotify_id – Spotify Track ID
f_richsync_length – The desired length of the sync (seconds)
f_richsync_length_max_deviation – The maximum deviation allowed from the f_sync_length (seconds)
- track_search(page=1, page_size=100, **params)
Search for track in Musixmatch database.
- Parameters:
q_track – The song title
q_artist – The song artist
q_lyrics – Any word in the lyrics
q_track_artist – Any word in the song title or artist name
q_writer – Search among writers
q – Any word in the song title or artist name or lyrics
f_artist_id – When set, filter by this artist id
f_music_genre_id – When set, filter by this music category id
f_lyrics_language – Filter by the lyrics language (en,it,..)
f_has_lyrics – When set, filter only contents with lyrics
f_track_release_group_first_release_date_min – When set, filter the tracks with release date newer than value, format is YYYYMMDD
f_track_release_group_first_release_date_max – When set, filter the tracks with release date older than value, format is YYYYMMDD
s_artist_rating – Sort by our popularity index for artists (asc|desc)
s_track_rating – Sort by our popularity index for tracks (asc|desc)
quorum_factor – Search only a part of the given query string.Allowed range is (0.1 - 0.9)
page – Define the page number for paginated results
page_size – Define the page size for paginated results. Range is 1 to 100.
- track_snippet_get(commontrack_id=None, track_id=None, track_isrc=None, track_spotify_id=None)
- 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
- Parameters:
commontrack_id – The track commontrack
track_id – Musixmatch track id
track_isrc – A valid ISRC identifier
track_spotify_id – Spotify Track ID
- track_subtitle_get(commontrack_id=None, track_id=None, subtitle_format=None, track_isrc=None, f_subtitle_length=None, f_subtitle_length_max_deviation=None)
Retreive the subtitle of a track. Return the subtitle of a track in LRC or DFXP format.
- Parameters:
commontrack_id – The track commontrack
track_id – Musixmatch track id
track_isrc – A valid ISRC identifier
subtitle_format – The format of the subtitle (lrc,dfxp,stledu). Default to lrc
f_subtitle_length – The desired length of the subtitle (seconds)
f_subtitle_length_max_deviation – The maximum deviation allowed from the f_subtitle_length (seconds)
- track_subtitle_translation_get(commontrack_id=None, track_id=None, track_isrc=None, track_spotify_id=None, selected_language=None, min_completed=None, f_subtitle_length=None, f_subtitle_length_max_deviation=None)
Get a translated subtitle for a given language
- Parameters:
commontrack_id – The track commontrack
track_id – Musixmatch track id
track_isrc – A valid ISRC identifier
track_spotify_id – Spotify Track ID
selected_language – he language of the translated lyrics (ISO 639-1)
min_completed – Teal from 0 to 1. If present, only the tracks with a translation ratio over this specific value, for a given language, are returned Set it to 1 for completed translation only, to 0.7 for a mimimum of 70% complete translation.