An advanced API library for seamless integration with Musixmatch. 🎶
This method requires authentication. 🔐
What does the Musixmatch API do? 🤔
The Musixmatch API allows you to read objects from our huge 100% licensed lyrics database. 📚
To make your life easier, we are providing you with one or more examples to show you how it could work in the wild. You'll find both the API request and API response in all the available output formats for each API call. Follow the links below for the details. 📝🔗
The current API version is 1.1, and the root URL is located at https://api.musixmatch.com/ws/1.1/. 🌐
Supported input parameters can be found on the page Input Parameters. Use UTF-8 to encode arguments when calling API methods. 📥
Every response includes a status_code
. You can consult a list of all status codes at Status Codes. 📊
apikey
- Your Personal API Key. You can set the API Key by using thesetApiKey()
method or in the constructor parameter.
track_id
- Musixmatch track IDartist_id
- Musixmatch artist IDalbum_id
- Musixmatch album IDcommontrack_id
- Musixmatch commontrack IDtrack_mbid
- MusicBrainz recording or track IDartist_mbid
- MusicBrainz artist IDalbum_mbid
- MusicBrainz release ID
q_track
- Search for a text string among song titlesq_artist
- Search for a text string among artist namesq_lyrics
- Search for a text string among lyricsq
- Search for a text string among song titles, artist names, and lyrics
f_has_lyrics
- Filter by objects with available lyricsf_is_instrumental
- Filter instrumental songsf_has_subtitle
- Filter by objects with available subtitlesf_music_genre_id
- Filter by objects with a specific music categoryf_subtitle_length
- Filter subtitles by a given duration in secondsf_subtitle_length_max_deviation
- Apply a deviation to a given subtitle duration (in seconds)f_lyrics_language
- Filter the tracks by lyrics languagef_artist_id
- Filter by objects with a given Musixmatch artist IDf_artist_mbid
- Filter by objects with a given MusicBrainz artist ID
g_commontrack
- Group a track result set by commontrack_id
s_track_rating
- Sort the results by our popularity index for tracks. Possible values are ASC | DESCs_track_release_date
- Sort the results by track release date. Possible values are ASC | DESCs_artist_rating
- Sort the results by our popularity index for artists. Possible values are ASC | DESC
page
- Request a specific result page (default=1)page_size
- Specify the number of items per result page (default=10, range is 1 to 100)
subtitle_format
- Desired output format for the subtitle body. Possible values are LRC|DFXP|STLEDU. Defaults to LRC.
country
- The country code of the desired country.
const { Musixmatch } = require('node-musixmatch-api');
const mxm = new Musixmatch('YourAPIKeyHere');
mxm
.trackSearch(
'q_artist=Money Man Lil Baby',
'q_track=24',
's_track_rating=78',
'q=VPN'
)
.then((l) => {
console.log(l.message.body.track_list[0].track.album_name);
trackId = l.message.body.track_list[0].track.track_id;
});
Most of the functions have the AutoComplete feature. 🤩
Some of them don't have AutoComplete. In that case, you can make your own AutoComplete Interface by using the BaseInterface
interface. (Only works with TypeScript) 💡
const { BaseInterface, Musixmatch } = require('node-musixmatch-api');
const mxm = new Musixmatch('APIKEYHERE');
interface AutoCompleteInterface extends BaseInterface {
message: {
header: {
status_code: number;
execute_time: number;
};
body: {
suggestions: string[]; // Example property for AutoComplete suggestions
};
};
}
const getTrackInfo = async (): AutoCompleteInterface => {
const l = await mxm.trackSearch(
'q_artist=Money Man Lil Baby',
'q_track=24',
's_track_rating=78',
'q=VPN'
);
return l;
};
Feel free to explore different methods 🌟 with your creativity! ✨