colossusr
colossusr

Reputation: 33

How to get lyrics from Musixmatch

I have a webradio and and the player gives me the song name and song artist

I read those two in a jQuery var like this:

<script>
$('#GetLyrics').on('click', function(ev) {
  songArtistTitle.value = jQuery('#artist').text() + ' - '+ jQuery('#title').text() + jQuery('#year').text();
.
.

"#artist" and "#title" are 2 divs that are auto updated by the player

the Musixmatch API its going like this:

http://api.musixmatch.com/ws/1.1/track.search?apikey=***&q_track=Dire%20straits%20Sultans%20of%20Swing&page_size=10

and returns the list of songs with "track_id":3867545, and then you must get the lyrics with the API

http://api.musixmatch.com/ws/1.1/track.lyrics.get?track_id=3867545

I want to have a button "GetLyrics" and when pressed by the user to have the list of songs from Musixmatch (with TRACK.SEARCH)(most of the times it will have only one song) and when the user select the correct song to display the lyrics

Can anyone please help me with the code to read the lyrics from Musixmatch database and display them? my webradio is here

Upvotes: 3

Views: 8562

Answers (1)

Joe McKenna
Joe McKenna

Reputation: 135

Lastly, the track you are looking for 3867545 does not have lyrics, 'has_lyrics' param is zero 0. A track ID that works is: track_id=5850832.

Upvotes: 0

Related Questions