Last.fm API & Scraper
This API reads Last.fm as JSON, logged out, the way a visitor of last.fm sees it, without a Last.fm API key.
🤖 Using an AI assistant? Copy this link into ChatGPT / Claude / Cursor — it reads every endpoint and parameter instantly and tells you if this API fits your use case.
`artist` returns an artist page in one call: the exact listener and scrobble totals (8,518,422 listeners and 1,436,195,464 scrobbles for Radiohead, where the page shows 8.5M and 1.44B), the position in the global Top Artists chart, tags, bio summary, facts such as years active and where the band was founded, the latest release, top tracks, top albums with listeners, similar artists with listeners and a daily listening trend covering about six months. `artist_top_tracks` ranks an artist's tracks by listeners for the last 7, 30, 90, 180 or 365 days or all time, 50 per page up to 500 tracks. `album` returns listeners, scrobbles, release date, length and every track with its duration and listeners; `track` returns listeners, scrobbles, duration, tags, the albums it appears on, similar tracks and its YouTube, Spotify and Apple Music links. Tag pages give the top artists, albums and tracks of a genre; `charts` and `charts_weekly` give the global charts, the weekly one with each artist's listeners and scrobbles for the week. For public user profiles it returns total scrobbles, recent scrobbles with time, top artists, albums and tracks per period, loved tracks, followers, following, neighbours and tags. Full wikis in 12 languages and public comments (shouts) are included.
What a Last.fm field actually contains
Fields that read differently from how they look. Every row was measured against live Last.fm on 2026-11-16.
| Field | What it holds |
|---|---|
| listeners, scrobbles (artist, album, track) | The exact all-time figures Last.fm prints in the page header, as integers. The page shows them rounded (Radiohead: 8.5M listeners, 1.44B scrobbles); the API returns 8,518,422 and 1,436,195,464. |
| top_tracks on artist | Ranked by listeners in the last 7 days, the window the artist page opens with (Radiohead Creep: 55,816). All-time and other windows are in artist_top_tracks (Creep all time: 4,271,204). |
| recently_popular on artist_albums | Albums with the most listeners in the last 7 days (OK Computer: 107,126). The rows of the same call carry all-time listeners (OK Computer: 4,958,963). |
| listener_trend | The Recent Listening Trend table of the page: one point per day with listeners, 181 days (2026-05-18 to 2026-11-14 on 2026-11-16) for an artist, album or track. |
| global_chart_position | The artist's place in Last.fm's global Top Artists chart (Radiohead: 3). Null for artists outside it: 8 of 9 artists sampled across genres had none. |
| scrobbles on user top lists | How many times this user played that artist, album or track in the chosen period (RJ, all time: Dream Theater 1,877). |
| timestamp on user_recent_tracks | When the track was scrobbled, as Last.fm prints it to a visitor who is not logged in: in UTC ("Monday 16 Nov 2026, 2:17pm" → 2026-11-16T14:17:00). |
| posted_at on shouts | The comment's time with the UTC offset Last.fm sends (2026-06-03T16:29:51-04:00). |
| page_age_seconds | How old the Last.fm page behind the answer is. 0 means the current page. Last.fm also keeps cached copies (up to about 23 hours old were seen); when the current page cannot be read in time, the cached copy is returned and its age is given here. |
| play_links on track | YouTube video id, Spotify track id and Apple Music link where Last.fm lists them (Creep: Spotify 70LcF31zb1H0PyJoS1Sx1r). |
Data is what Last.fm shows to a visitor who is not logged in. Last.fm's own website shows only the first page of a user's scrobble history and the default period of the library to such a visitor; the API returns the same.
Real request and response JSON
Captured from the indexed primary action, search, on .
{
"method": "POST",
"url": "https://api.reefapi.com/lastfm/v1/search",
"headers": {
"x-api-key": "$REEF_KEY",
"content-type": "application/json"
},
"body": {
"query": "radiohead",
"type": "artists"
}
}{
"ok": true,
"meta": {
"api": "lastfm",
"endpoint": "search",
"mode": "live",
"latency_ms": 1060.2,
"record_count": 20,
"bytes": 94477,
"cache_hit": false,
"upstream_requests": 1,
"page_cache": "MISS",
"charged_credits": 1,
"version": "0.1.0",
"request_id": "5f3468478f7246f4",
"queue_ms": 1.8,
"fetched_at": "2026-11-16T21:05:25.523Z"
},
"data": {
"artists": [
{
"name": "Radiohead",
"url": "https://www.last.fm/music/Radiohead",
"listeners": 8518422,
"image": "https://lastfm-img.freetls.fastly.net/i/u/avatar70s/351f9b2397e475c24e3fc214efb50ade.jpg"
},
{
"name": "RADİOHEAD",
"url": "https://www.last.fm/music/RAD%C4%B0OHEAD",
"listeners": 36,
"image": "https://lastfm-img.freetls.fastly.net/i/u/avatar70s/2a96cbd8b46e442fc41c2b86b821562f.jpg"
},
{
"name": "Radiohead • Lossless",
"url": "https://www.last.fm/music/Radiohead+%E2%80%A2+Lossless",
"listeners": 798,
"image": "https://lastfm-img.freetls.fastly.net/i/u/avatar70s/8ec0c273775694f6d35beeb73d0e2ac4.jpg"
}
],
"query": "radiohead",
"type": "artists",
"count": 20,
"duplicate_urls": 0,
"page_age_seconds": 0
}
}What the Last.fm API does
| Action | Description | Concrete use case | Key params |
|---|---|---|---|
| search | Search last.fm for artists, albums and tracks by name. `type=all` returns the search overview (artists with listeners, albums, tracks); `artists` / `albums` / `tracks` return that list alone (measured: up to 30 rows each; the site has no further pages — its `page` parameter returns the same rows, so none is offered). Every row's `url` feeds `artist` / `album` / `track`. | Content platforms call search to search last.fm for artists, albums and tracks by name. | query, type |
| artist | One artist's last.fm page: exact listener and scrobble totals, position in the global Top Artists chart, tags, bio summary, facts (years active, founded in / born), latest release, the track popular this week, top tracks (listeners in the last 7 days), top albums (all-time listeners), similar artists with listeners, the daily listening trend (about 6 months), photos and external links. Events: `artist_events`. | Research tools call artist to get one artist's last.fm page. | artist, url |
| wiki | The full wiki (biography / album or track description) of an artist, album or track, with the artist factbox (years active, founded in, born, members) and edit history line. Give `artist` alone for the artist, add `album` or `track` for those. Other languages: `lang`. | Community analysts call wiki to get the full wiki (biography / album or track description) of an artist, album or track, with the…. | artist, album, track, url, lang |
| artist_top_tracks | An artist's tracks ranked by listeners in a time window, 50 per page. The site stops at page 10 (500 tracks); a later page returns `page_beyond_last`. | Media monitors call artist_top_tracks to get an artist's tracks ranked by listeners in a time window, 50 per page. | artist, period, page, url |
| artist_albums | An artist's albums, 20 per page, by popularity (all-time listeners) or by release date, plus the site's 'Recently Popular' block (albums with the most listeners in the last 7 days — a different listener scope, kept apart). | Content platforms call artist_albums to get an artist's albums, 20 per page, by popularity (all-time listeners) or by release date, plus…. | artist, order, page, url |
| artist_similar | Artists similar to this one (last.fm's similarity list), 10 per page, each with listeners, top tags and bio summary. | Research tools call artist_similar to get artists similar to this one (last.fm's similarity list), 10 per page, each with listeners, to…. | artist, page, url |
| tags_of | All tags users gave an artist, album or track, most used first, each with the artists the tag is best known for ('Including …'). | Community analysts call tags_of to get all tags users gave an artist, album or track, most used first, each with the artists the tag…. | artist, album, track, url |
| artist_events | An artist's events (concerts, festivals): upcoming by default, or one past year (`year`). Each with date, venue, city/country, line-up and attendance counts. `years_with_events` lists the years the site has. | Media monitors call artist_events to get an artist's events (concerts, festivals). | artist, year, page, url |
| artist_top_listeners | The last.fm users who listen to this artist the most (as published on the artist's Listeners page), with the track each one plays a lot. | Content platforms call artist_top_listeners to get the last.fm users who listen to this artist the most (as published on the artist's Listeners…. | artist, url |
| artist_images | An artist's photo gallery on last.fm, 40 per page (image id, full-size image url, thumbnail, caption, which one is the preferred image). | Research tools call artist_images to get an artist's photo gallery on last.fm, 40 per page (image id, full-size image url, thumbnail,…. | artist, page, url |
| shouts | Public comments ('shouts') on an artist, album, track, tag or user page, with author, time (ISO with the site's UTC offset), text, vote count and the replies under each, 50 top-level shouts per page, most voted or newest first. | Community analysts call shouts to get public comments ('shouts') on an artist, album, track, tag or user page, with author, time (I…. | artist, album, track, url, tag, ... |
| album | One album: exact listeners and scrobbles, release date, number of tracks and total length, the tracklist (each track's duration and listeners), tags, wiki summary, similar albums with listeners, daily listening trend and the artist's external links. | Media monitors call album to get one album. | artist, album, url |
| track | One track: exact listeners and scrobbles, duration, tags, wiki summary, the albums it is featured on (with listeners) and how many more there are, similar tracks, YouTube / Spotify / Apple Music links (Spotify track id included) and the daily listening trend. | Content platforms call track to get one track. | artist, track, url |
| track_albums | Every album a track appears on (originals, compilations, live releases), 20 per page, most listened first. | Research tools call track_albums to get every album a track appears on (originals, compilations, live releases), 20 per page, most li…. | artist, track, page, url |
| tag | A tag (genre) overview: wiki summary, its top artists, top albums (with listeners) and top tracks, and related tags. | Community analysts call tag to get a tag (genre) overview. | tag |
| tag_artists | Top artists for a tag, 21 per page, each with listeners and bio summary. | Media monitors call tag_artists to get top artists for a tag, 21 per page, each with listeners and bio summary.. | tag, page |
| tag_albums | Top albums for a tag, 20 per page, each with artist and listeners. | Content platforms call tag_albums to get top albums for a tag, 20 per page, each with artist and listeners.. | tag, page |
| tag_tracks | Top tracks for a tag, 50 per page. | Research tools call tag_tracks to get top tracks for a tag, 50 per page.. | tag, page |
| charts | last.fm's daily global charts page: Top Tracks, Top Artists, Top New Releases, Most Loved, and the 'Out Now' list of new releases with release dates. The page publishes ranks only (no counts); the weekly chart with listener and scrobble counts is `charts_weekly`. | Community analysts call charts to get last.fm's daily global charts page. | none |
| charts_weekly | last.fm's weekly global Top Artists chart with each artist's listeners and scrobbles for the week and the movement (up / down) — 50 per page. | Media monitors call charts_weekly to get last.fm's weekly global Top Artists chart with each artist's listeners and scrobbles for the…. | page |
| user | A public last.fm profile: total scrobbles, average per day, artists scrobbled, loved tracks, scrobbling since, display name, status labels, the top track, the most recent scrobbles, and the profile's top artists / albums / tracks in its default windows. | Content platforms call user to get a public last.fm profile. | user |
| user_recent_tracks | A user's latest 50 scrobbles with the time of each (UTC as the page shows it to a logged-out visitor) and whether the user loves the track. last.fm shows a logged-out visitor page 1 only (page 2 redirects to its login). | Research tools call user_recent_tracks to get a user's latest 50 scrobbles with the time of each (UTC as the page shows it to a logged-out…. | user |
| user_top_artists | A user's most-scrobbled artists in a time window with scrobble counts (50 rows; `all` also returns the number of artists scrobbled). | Community analysts call user_top_artists to get a user's most-scrobbled artists in a time window with scrobble counts (50 rows; `all` also. | user, period |
| user_top_albums | A user's most-scrobbled albums in a time window with scrobble counts. | Media monitors call user_top_albums to get a user's most-scrobbled albums in a time window with scrobble counts.. | user, period |
| user_top_tracks | A user's most-scrobbled tracks in a time window with scrobble counts. | Content platforms call user_top_tracks to get a user's most-scrobbled tracks in a time window with scrobble counts.. | user, period |
| user_loved_tracks | Tracks a user has loved, newest first, with the date loved, 50 per page. | Research tools call user_loved_tracks to get tracks a user has loved, newest first, with the date loved, 50 per page.. | user, page |
| user_following | Users this user follows, 30 per page. | Community analysts call user_following to get users this user follows, 30 per page.. | user, page |
| user_neighbours | Users last.fm lists as this user's musical neighbours (similar taste), as published on the profile (measured: 50 rows, one page). | Media monitors call user_neighbours to get users last.fm lists as this user's musical neighbours (similar taste), as published on the pr…. | user |
| user_tags | Tags this user has applied, with how many times each was used, 50 per page. | Content platforms call user_tags to get tags this user has applied, with how many times each was used, 50 per page.. | user, page |
| user_followers | Users who follow this user, 30 per page. | Research tools call user_followers to get users who follow this user, 30 per page.. | user, page |
Call search from your stack
curl -X POST https://api.reefapi.com/lastfm/v1/search \
-H "x-api-key: $REEF_KEY" \
-H "content-type: application/json" \
-d '{"query":"radiohead","type":"artists"}'import os
import requests
REEF_KEY = os.environ["REEF_KEY"]
r = requests.post(
"https://api.reefapi.com/lastfm/v1/search",
headers={"x-api-key": REEF_KEY},
json={
"query": "radiohead",
"type": "artists"
},
timeout=90,
)
print(r.json()["data"])const res = await fetch("https://api.reefapi.com/lastfm/v1/search", {
method: "POST",
headers: {
"x-api-key": process.env.REEF_KEY,
"content-type": "application/json",
},
body: JSON.stringify({
"query": "radiohead",
"type": "artists"
}),
});
const { ok, data, meta, error } = await res.json();Ask your MCP-connected assistant: call reefapi.lastfm.search with {"query":"radiohead","type":"artists"}.Who uses this API and why
- Track exact listener and scrobble counts of a roster of artists, albums and tracks day by day.
- Rank an artist's catalogue by listeners this week, this month or all time.
- Build genre charts from Last.fm tags with listeners per artist and album.
- Find similar artists and similar tracks for recommendations and playlist curation.
- Read public listening profiles: top artists per period, recent scrobbles and loved tracks.
Questions developers ask before integrating
Do I need a Last.fm account or a Last.fm API key?
No. Everything is read from the public Last.fm website without logging in; you only need a ReefAPI key.
Are the listener and scrobble numbers exact?
Yes. The API returns the exact integers Last.fm puts behind its rounded figures. For 24 artists, albums and tracks checked on 2026-11-16, the rounded figure on the page (for example 5.3M) matched the exact value returned in 24 of 24 cases.
Can I get an artist's top tracks for the last week or month?
Yes. artist_top_tracks takes period 7d, 30d, 90d, 180d, 365d or all and returns 50 tracks per page with listeners in that window, up to page 10 (500 tracks), which is where Last.fm stops.
Are country charts available?
No. Last.fm's website publishes only global charts: the daily charts page (Top Tracks, Top Artists, Top New Releases, Most Loved and Out Now, ranks only) and the weekly Top Artists chart with listeners and scrobbles, 4 pages of 50. Country chart pages answered 404 and a country parameter returned the global chart unchanged.
How deep does search go?
One page per query: up to 20 to 30 artists, 30 albums and 30 tracks. Last.fm ignores further pages of search, so the API does not offer them. Album search can list the same album twice when Last.fm does.
What can I read about a user?
Public profiles only: total scrobbles, artists scrobbled, loved tracks count, scrobbling since, the latest 50 scrobbles, top artists, albums and tracks per period (up to 50 artists, 5 albums or 10 tracks for a period window; 50 of each for all time), loved tracks page by page, followers, following, neighbours and tags.
Is the full artist biography included?
Yes. wiki returns the complete text in paragraphs, the factbox (years active, founded in or born, members) and the edit line, for artists, albums and tracks, in English or 11 other languages Last.fm has (de, es, fr, it, ja, pl, pt, ru, sv, tr, zh).
What is the Last.fm API?
Last.fm API is a ReefAPI endpoint group for exact listener and scrobble counts for artists, albums and tracks, tags, similar artists, global charts, search and public user listening stats. It returns live JSON through POST requests under /lastfm/v1.
Is the Last.fm API free to try?
Yes. ReefAPI starts with 1,000 free credits, no card required. Last.fm calls use the same shared credit balance as every other ReefAPI engine.
Do I need a Last.fm login or account?
No login to Last.fm is needed for the API response. You call ReefAPI with your x-api-key header, and the playground can run live examples before you create a production key.
How fresh is the Last.fm data?
The page example is captured from a live search call, and production requests fetch live data through ReefAPI rather than a static sample.
How many credits does the Last.fm API use?
Last.fm actions currently cost 1-2 credits per successful call. Failed or blocked calls are free. All APIs draw from one credit pool.
Can I call Last.fm from an AI assistant or MCP client?
Yes. Connect ReefAPI once through MCP and your assistant can call lastfm actions with the same key, credit pool and JSON envelope used by normal REST requests.
Is the Last.fm API a Last.fm scraper?
It is the managed alternative to a DIY Last.fm scraper. Instead of building and maintaining your own scraper — proxies, headless browsers, captcha and constant breakage — you call one ReefAPI endpoint and get the same exact listener and scrobble counts for artists, albums and tracks, tags, similar artists, global charts, search and public user listening stats back as clean JSON.