LastFm
Music
- Authentication
- API Key
- HTTPS
- Yes
- CORS
- Unknown
- Category
- Music
- Documentation / URL
- https://www.last.fm/api
Overview
The Last.fm API serves music metadata — artists, albums, tracks, and user scrobbles. Public reads use an API key; user actions need a session token.
Note (verified 2026-08): invalid keys return HTTP 403 with
{"message":"Invalid API key...","error":10}— not 401. Check theerrorcode in the JSON.
Quick Start
Artist search (replace YOUR_KEY):
curl "https://ws.audioscrobbler.com/2.0/?method=artist.search&artist=queen&api_key=YOUR_KEY&format=json"
{
"results": {
"artistmatches": {
"artist": [
{ "name": "Queen", "url": "https://www.last.fm/music/Queen", "image": [{ "#text": "https://..." }] }
]
}
}
}
Top tracks:
curl "https://ws.audioscrobbler.com/2.0/?method=chart.gettoptracks&api_key=YOUR_KEY&format=json"
Authentication
- Register at last.fm/api → create an API account → API key.
- Send it as the
api_keyparameter (format=jsonfor JSON). - Invalid keys → 403 with
error: 10(verified).
Rate Limits & Notes
- Free: ~5 requests/second per key (check docs); no paid requirement for reads.
- Methods:
artist.*,album.*,track.*,user.*,chart.*. - User scrobbling requires a session key from the auth flow.
FAQ
Is Last.fm API free? Yes — free key with rate limits.
Why 403 with error 10?
Invalid API key returns 403 + error: 10 (verified).
How do I get user scrobbles?
The auth flow gives a session key for user.* methods.
More in Music
| API | Auth | HTTPS | CORS | |
|---|---|---|---|---|
| 7digital Api of Music store 7digital | OAuth | Yes | Unknown | ↗ |
| AI Mastering Automated Music Mastering | API Key | Yes | Yes | ↗ |
| Audiomack Api of the streaming music hub Audiomack | OAuth | Yes | Unknown | ↗ |
| Bandcamp API of Music store Bandcamp | OAuth | Yes | Unknown | ↗ |
| Bandsintown Music Events | No auth | Yes | Unknown | ↗ |