0
votes

I am trying to get a track's metadata from Last.fm web api. I tried getting the details using the track name and track artists and it worked. But to get more accurate results I wanted to use a song's MusicBrainzId(mbid) to get the details.

last.fm api's documentaion for reference

Now I am using the following GET request to get a json response

http://ws.audioscrobbler.com/2.0/?method=track.getInfo&api_key=INSERT_API_KEY&format=json&mbid=bfcc6d75-a6a5-4bc6-8282-47aec8531818

But I am getting an error response i.e.

{"error":6,"message":"Track not found","links":[]}

As I understood from the api documentation we can use mbid instead of track and artist params. Its not working for me. Please help me on this.

1
The MBId you reference as an example is of the artist (Cher) herself, but the documentation states that you needed to use the MBId for a specific track. If you used the other MBId on the documentation page, or one like 189002e7-3285-4e2e-92a3-7f6c30d407a2 (courtesy of [musicbrainz.org/doc/MusicBrainz_Identifier](MusicBrainz)), does the problem persist?Martijn
Okay I got it, I was using a wrong mbid.nick.tdr

1 Answers

1
votes

That mbid is for an artist, Cher

That API is for getting information about tracks, not artists

Try, for example http://ws.audioscrobbler.com/2.0/?method=track.getInfo&api_key=INSERT_API_KEY&format=json&mbid=251f6d72-a1d9-4b9d-944a-2df9b26f6212

or http://ws.audioscrobbler.com/2.0/?method=artist.getTopTracks&api_key=INSERT_API_KEY&format=json&mbid=bfcc6d75-a6a5-4bc6-8282-47aec8531818