API Reference¶
The following section outlines the API of musixmatch.
Album¶
-
class
album.Album¶ Get this list of albums and tracks from their musixmatch album id
-
album(album_id)¶ Lists the information about an album from the musixmatch album id
- Parameters
album_id (int) – The musixmatch album id
- Returns
The album details
-
album_track(album_id, f_has_lyrics=1, page=1, page_size=10)¶ Lists the tracks of an album
- Parameters
album_id (int) – The musixmatch album id
f_has_lyrics (int, Optional) – Filters the tracks with lyrics only (0 or 1), defaults to 1
page (int, Optional) – Define the page number for paginated results, defaults to 1
page_size (int, Optional) – Define the page size for paginated results. Range is 1 to 100, defaults to 10
- Returns
List of tracks in album
-
Artist¶
-
class
artist.Artist¶ Gives information about artist and there albums, tracks etc
-
artist_album(artist_id, group_album_name=1, release='desc', page=1, page_size=10)¶ Get the album discography of an artist
- Parameters
artist_id (int) – The artist musixmatch id
group_album_name (int, Optional) – Group by Album Name(0 or 1), defaults to 1
release (str, Optional) – Sort by release date (asc|desc)
page (int, Optional) – Define the page number for paginated results, defaults to 1
page_size (int, Optional) – Define the page size for paginated results. Range is 1 to 100. defaults to 10
- Returns
Get the album of artist
-
artist_id(id)¶ Gives information about the artist from there musixmatch artist id
- Parameters
id (int) – The artist musixmatch id
- Returns
The artist data
Get a list of artists somehow related to a given one.
- Parameters
artist_id (int) – The artist musixmatch id
page (int, Optional) – Define the page number for paginated results, defaults to 1
page_size (int, Optional) – Define the page size for paginated results. Range is 1 to 100. defaults to 10
- Returns
The artist details
-
artist_search(name, page=1, page_size=10)¶ Search and gives details of an artist by there name
- Parameters
name (str) – The artist name
page (int, Optional) – Define the page number for paginated results, defaults to 1
page_size (int, Optional) – Define the page size for paginated results. Range is 1 to 100. defaults to 10
- Returns
The artist detail
-
Chart¶
-
class
charts.Charts¶ Get the list of top Charts
-
get_top_artist(country, page=1, pagesize=10, format='json')¶ Get the list of top artist for a given country
- Parameters
country (str) – A valid country code (default US)
page (int, Optional) – Define the page number for paginated results (default 1)
pagesize (int, Optional) – Define the page size for paginated results. Range is 1 to 100. (default 10)
format (str, Optional) – Decide the output type (json or xml) (default json)
- Returns
The request response
-
get_top_song(country, page=1, pagesize=10, chart_name='top', f_has_lyrics=1)¶ Get the top song of a country
- Parameters
country (str) – Country name
page (int, Optional) – Define the page number for paginated results (default 1)
pagesize (int, Optional) – Define the page size for paginated results. Range is 1 to 100. (default 10)
chart_name (str, Optional) – Select among available charts: top : editorial chart hot : Most viewed lyrics in the last 2 hours defaults to top
f_has_lyrics (int, Optional) – When set, filter only contents with lyrics (0|1), defaults to 1
- Returns
The top song of a particular country
-
Matcher¶
-
class
matcher.Matcher¶ Matches the lyrics and returns the information
-
match_lyrics(lyrics, artist)¶ Get the lyrics for track based on title and artist
- Parameters
lyrics (str) – The song title
artist (str) – The song artist
- Returns
The lyrics based on title and artist
-
match_song(track, artist, album='')¶ Match your song against musixmatch database.
- Parameters
track (str) – The song title
artist (str) – The song artist
album (str, Optional) – The song album
- Returns
the details of the song
-
Track¶
-
class
tracks.Track¶ Get the tracks based on various attributes
-
lyrics_by_id(id)¶ Get lyrics info by musixmatch track id
- Parameters
id (int) – The Musixmatch track id
- Returns
the lyric details
-
lyrics_mood_by_id(id)¶ Get mood info of a track by it’s musixmatch commontrack id
- Parameters
id (int) – The Musixmatch commontrack id
- Returns
the lyric details
-
rich_sync_by_id(id, f_richsync_length=20, f_richsync_length_max_deviation=20)¶ Get the Rich sync for a track A rich sync is an enhanced version of the standard sync which allows: position offset by single characther endless formatting options at single char level multiple concurrent voices multiple scrolling direction You need a commercial plan to make this request
- Parameters
id (int) – The Musixmatch ntrack id
f_richsync_length (int, Optional) – The desired length of the sync (seconds), defaults to 20
f_richsync_length_max_deviation (int, Optional) – The maximum deviation allowed from the f_sync_length (seconds), default to 20
-
search_track(q_track, q_artist='', q_lyrics='', f_artist_id='', f_music_genre_id='', f_lyrics_language='', f_has_lyrics=1, f_track_release_group_first_release_date_min='', f_track_release_group_first_release_date_max='', s_artist_rating='', s_track_rating='', page=1, page_size=5)¶ Search for track in musixmatch database.
- Parameters
q_track (str) – The song title
q_artist (str, Optional) – The song artist
q_lyrics (str, Optional) – The song lyric
f_artist_id (int, Optional) – When set, filter by this artist id
f_music_genre_id (int, Optional) – When set, filter by this music category id
f_lyrics_language (str, Optional) – Filter by the lyrics language (en,it,..)
f_has_lyrics (int, Optional) – When set, filter only contents with lyrics
f_track_release_group_first_release_date_min (int, Optional) – When set, filter the tracks with release date newer than value, format is YYYYMMDD
f_track_release_group_first_release_date_max (int, Optional) – When set, filter the tracks with release date older than value, format is YYYYMMDD
s_artist_rating (int, Optional) – Sort by our popularity index for artists (asc|desc)
s_track_rating (int, Optional) – Sort by our popularity index for tracks (asc|desc)
page (int, Optional) – Define the page number for paginated results, defaults to 1
page_size (int, Optional) – Define the page size for paginated results. Range is 1 to 100. defaults to 10
- Returns
The track details
-
subtitle_track_by_id(id, subtitle_format='lrc', f_subtitle_length=20, f_subtitle_length_max_deviation=20)¶ Get the subtitles of track by their common track ID. Requires a commercial plan. You need a commercial plan to make this request
- Parameters
id (int) – The Musixmatch commontrack id
subtitle_format (str, Optional) – The format of the subtitle (lrc,dfxp,stledu). Default to lrc
f_subtitle_length (int, Optional) – The desired length of the subtitle (seconds), defaults to 20
f_subtitle_length_max_deviation (int, Optional) – The maximum deviation allowed from the f_subtitle_length (seconds), defaults to 20
- Returns
the subitle details
-
track_by_id(id)¶ Get a track info
- Parameters
id (int) – The Musixmatch commontrack id
- Returns
the track details
-
translate_lyrics(id, language, min_completed=1)¶ Get a translated lyrics for a given language. You need a commercial plan to make this request.
- Parameters
id (int) – The Musixmatch ntrack id
language (str) – The language of the translated lyrics
min_completed (int, Optional) – 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, defaults to 1
-