ChartsAPI¶
- class minim.api.musixmatch.ChartsAPI(client: APIClient, /)[source]¶
Bases:
MusixmatchResourceAPICharts API endpoints for the Musixmatch Lyrics API.
Important
This class is managed by
MusixmatchLyricsAPIClientand should not be instantiated directly.- Parameters:
- clientminim.api._shared.APIClient
API client instance used to make HTTP requests.
Methods
Charts > music.genres.get: Get Musixmatch catalog information for available genres.
Charts > chart.artists.get: Get Musixmatch catalog information for the top artists on Musixmatch.
Charts > chart.tracks.get: Get Musixmatch catalog information for the top tracks on Musixmatch.
- get_genres() dict[str, Any][source]¶
Charts > music.genres.get: Get Musixmatch catalog information for available genres.
Subscription
- Musixmatch Basic plan
Access music metadata and static lyrics. Learn more.
- Returns:
- genresdict[str, Any]
Musixmatch metadata for the available genres.
Sample response
{ "message": { "body": { "music_genre_list": [ { "music_genre": { "music_genre_id": <int>, "music_genre_name": <str>, "music_genre_name_extended": <str>, "music_genre_parent_id": <int>, "music_genre_vanity": <str> } } ] }, "header": { "execute_time": <float>, "status_code": <int> } } }
- get_top_artists(*, country_code: str | None = None, limit: int | None = None, page: int | None = None) dict[str, Any][source]¶
Charts > chart.artists.get: Get Musixmatch catalog information for the top artists on Musixmatch.
Subscription
- Musixmatch Basic plan
Access music metadata and static lyrics. Learn more.
- Parameters:
- country_codestr; keyword-only; optional
ISO 3166-1 alpha-2 country code. Use
"XW"for worldwide.Example:
"it".API default:
"US".- limitint; keyword-only; optional
Maximum number of artists to return.
Valid range:
1to100.- pageint; keyword-only; optional
Page number. Use with limit to get the next page of artists.
Minimum value:
1.API default:
1.
- Returns:
- artistsdict[str, Any]
Page of Musixmatch metadata for the top artists.
Sample response
{ "message": { "body": { "artist_list": [ { "artist": { "artist_alias_list": [ { "artist_alias": <str> } ], "artist_comment": <str>, "artist_country": <str>, "artist_credits": { "artist_list": [] }, "artist_id": <int>, "artist_name": <str>, "artist_name_translation_list": [ { "artist_name_translation": { "language": <str>, "translation": <str> } } ], "artist_twitter_url": <str>, "begin_date": <str>, "begin_date_year": <str>, "end_date": <str>, "end_date_year": <str>, "restricted": <int>, "updated_time": <str> } } ] }, "header": { "execute_time": <float>, "status_code": <int> } } }
- get_top_tracks(chart_name: str | None = None, *, country_code: str | None = None, has_lyrics: bool | None = None, limit: int | None = None, page: int | None = None) dict[str, Any][source]¶
Charts > chart.tracks.get: Get Musixmatch catalog information for the top tracks on Musixmatch.
Subscription
- Musixmatch Basic plan
Access music metadata and static lyrics. Learn more.
- Parameters:
- chart_namestr; optional
Name of the chart to retrieve.
Valid values:
"top"– Editorial chart."hot"– Most viewed lyrics in the last two hours."mxmweekly"– Most viewed lyrics in the last seven days."mxmweekly_new"– Most viewed lyrics in the last seven days, limited to new releases only.
- country_codestr; keyword-only; optional
ISO 3166-1 alpha-2 country code. Use
"XW"for worldwide. Only applicable when chart_name is not"top".Example:
"it".API default:
"US".- has_lyricsbool; keyword-only; optional
Whether to only include tracks that have lyrics.
API default:
False.- limitint; keyword-only; optional
Maximum number of tracks to return.
Valid range:
1to100.- pageint; keyword-only; optional
Page number. Use with limit to get the next page of tracks.
Minimum value:
1.API default:
1.
- Returns:
- tracksdict[str, Any]
Page of Musixmatch metadata for the top tracks.
Sample response
{ "message": { "body": { "track_list": [ { "track": { "album_coverart_100x100": <str>, "album_coverart_350x350": <str>, "album_coverart_500x500": <str>, "album_coverart_800x800": <str>, "album_id": <int>, "album_name": <str>, "album_vanity_id": <str>, "artist_id": <int>, "artist_mbid": <str>, "artist_name": <str>, "commontrack_7digital_ids": <list[int]>, "commontrack_id": <int>, "commontrack_isrcs": <list[list[str]]>, "commontrack_itunes_ids": <list[int]>, "commontrack_spotify_ids": <list[str]>, "commontrack_vanity_id": <str>, "explicit": <int>, "first_release_date": <str>, "has_lyrics": <int>, "has_lyrics_crowd": <int>, "has_richsync": <int>, "has_subtitles": <int>, "has_track_structure": <int>, "instrumental": <int>, "lyrics_id": <int>, "num_favourite": <int>, "primary_genres": { "music_genre_list": [ { "music_genre": { "music_genre_id": <int>, "music_genre_name": <str>, "music_genre_name_extended": <str>, "music_genre_parent_id": <int>, "music_genre_vanity": <str> } } ] }, "restricted": <int>, "secondary_genres": { "music_genre_list": [] }, "subtitle_id": <int>, "track_edit_url": <str>, "track_id": <int>, "track_isrc": <str>, "track_length": <int>, "track_mbid": <str>, "track_name": <str>, "track_name_translation_list": [], "track_rating": <int>, "track_share_url": <str>, "track_soundcloud_id": <int>, "track_spotify_id": <str>, "track_xboxmusic_id": <str>, "updated_time": <str> } } ] }, "header": { "execute_time": <float>, "status_code": <int> } } }