0

I'm using the last fm api to get data from a user but when using the User.getTopTracks method with the time period 1month, it returns nothing:

{
  toptracks: {
    #text: " ",
    user: "RJ",
    type: "1month",
    page: "",
    perPage: "",
    totalPages: "",
    total: "0"
  }
}

This error does not occur when using similar methods (e.g. User.getTopAlbums)

Amja
  • 1,315
  • 9
  • 25
  • Can you provide some code for example? I want to see how do you call method. – Vlad Holubiev Nov 23 '13 at 14:36
  • @VladGolubev I'm using sinatra so I make a request like this: `Net::HTTP.get(URI("http://ws.audioscrobbler.com/2.0/?method=User.getTopTracks&user=amosjackson&api_key=XXXXXXXXXX&period=1month&format=json"))` – Amja Nov 23 '13 at 23:10
  • It isn't your fault. Seems like we use &period parametr wrong. I can't get response too. `$.getJSON('http://ws.audioscrobbler.com/2.0/?method=user.gettoptracks&period=1month&user=samosfator&api_key=XXXX&format=json', function(response) {result = response}).done(function (result) {console.log(result)})` The most probable variant is that last.fm's api has changed. I'll inform you as soon as I found solution. – Vlad Holubiev Nov 24 '13 at 14:04

1 Answers1

0

This is a bug in the Last.fm API.

The issue used to exist for getTopArtists as well. It has been fixed for the artists call, but not for getTopTracks.

My solution is to use 3month when the user selects 1month. If I have time I will update the UI to work around this issue.

myanimal
  • 3,580
  • 26
  • 26