# Last.fm API **Provider:** Last.fm **Category:** entertainment **Base URL:** `https://ws.audioscrobbler.com/2.0` **Auth:** api-key — `?api_key=YOUR_API_KEY&format=json` **Rate Limit:** 5 requests/sec (unofficial fair-use limit) **Free Tier:** Yes — [object Object] **Pricing:** Free tier available (freemium) **Docs:** https://www.last.fm/api ## Description The Last.fm API provides rich music metadata from a 20+ year database of artist information, track metadata, album art, fan-curated tags, and music recommendations. Retrieve top tracks and albums for any artist, get personalized music stats (what users are listening to now), find similar artists, explore music recommendations by tag, and scrobble (record) user listening history. Loved by music apps, recommendation engines, and audio players. ## Endpoints | Method | Endpoint | Description | |--------|----------|-------------| | GET | `https://ws.audioscrobbler.com/2.0?method=artist.getinfo` | Get artist biography, tags, and listener stats | | GET | `https://ws.audioscrobbler.com/2.0?method=artist.getSimilar` | Get artists similar to a given artist | | GET | `https://ws.audioscrobbler.com/2.0?method=artist.getTopTracks` | Get the most popular tracks for an artist | | GET | `https://ws.audioscrobbler.com/2.0?method=chart.getTopArtists` | Get the top artists chart globally | | GET | `https://ws.audioscrobbler.com/2.0?method=tag.getTopTracks` | Get top tracks for a genre tag | | GET | `https://ws.audioscrobbler.com/2.0?method=user.getRecentTracks` | Get a user's scrobble history | ## Authentication Pass your API key as the api_key query parameter. User-write operations require OAuth-style session tokens. Register at last.fm/api/account/create. ``` ?api_key=YOUR_API_KEY&format=json ``` ## Sample Request ```bash curl "https://ws.audioscrobbler.com/2.0/?method=artist.getTopTracks&artist=Radiohead&api_key=$LASTFM_API_KEY&format=json&limit=5" ``` ## Sample Response ```json { "toptracks": { "track": [{ "name": "Creep", "playcount": "71234567", "listeners": "3456789", "artist": { "name": "Radiohead" }, "url": "https://www.last.fm/music/Radiohead/_/Creep" }] } } ``` ## Pricing Details The Last.fm API is free for non-commercial use. Commercial use requires a license agreement. Fair-use rate limits are enforced but not publicly published. --- *Source: [API Map](https://apimap.dev/apis/lastfm/) — CC BY 4.0*