APIYard
Back to APIs
EntertainmentAPI KeyFree tier

Last.fm

Access Last.fm's music data — top charts, artist biographies, similar artists, user listening history, and scrobble tracking.

Base URL

https://ws.audioscrobbler.com/2.0
musicchartsscrobblingartistshistory

Endpoints

GET/

Fetch global top tracks from Last.fm charts.

const response = await fetch("https://ws.audioscrobbler.com/2.0/?method=chart.getTopTracks&api_key=YOUR_KEY&format=json&limit=5&api_key=YOUR_API_KEY", {
  method: "GET",
  headers: {
  "Content-Type": "application/json",
  "X-API-Key": "YOUR_API_KEY"
  }
});

const data = await response.json();
console.log(data);

Response Preview

{
  "tracks": {
    "track": [{
      "name": "Blinding Lights",
      "artist": { "name": "The Weeknd" },
      "playcount": "2141900",
      "listeners": "982000",
      "url": "https://www.last.fm/music/The+Weeknd/_/Blinding+Lights"
    }]
  }
}