# Last.fm API

> Last.fm returns artist profiles, listening statistics, tracks, albums, similar artists, and events as a workflow and API.

Get artist returns an artist’s profile, listening statistics, top tracks and albums, similar artists, and upcoming events; it needs an artist name. List similar artists returns artists in similarity order; it needs an artist name and can take a maximum result count.

- Page: https://fous.com/tools/last-fm
- Handle: `@last-fm`
- Category: [Entertainment](https://fous.com/tools/category/entertainment)
- Source website: https://last.fm
- Last verified: Oct 7, 2026

## Methods

### Get artist

Operation `get_artist`, version 1. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.

Get an artist’s listening statistics, profile, top tracks and albums, similar artists, and upcoming events by name. Lists can include up to 50 items each; some profiles may have no bio, image, or events.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `artist` | string | yes | `"Taylor Swift"` | Artist or band name, such as Taylor Swift. |
| `max_results` | integer | no | `10` | Maximum items in each top tracks, top albums, and similar artists list, such as 10. |

**Input schema**

```json
{
  "type": "object",
  "required": [
    "artist"
  ],
  "properties": {
    "artist": {
      "type": "string",
      "minLength": 1,
      "description": "Artist or band name, such as Taylor Swift.",
      "examples": [
        "Taylor Swift",
        "The xx"
      ]
    },
    "max_results": {
      "type": "integer",
      "default": 10,
      "maximum": 50,
      "minimum": 1,
      "description": "Maximum items in each top tracks, top albums, and similar artists list, such as 10.",
      "x-fous-developer": true,
      "examples": [
        10,
        12,
        50
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "artist": "Taylor Swift",
      "max_results": 10
    },
    {
      "artist": "The xx",
      "max_results": 12
    },
    {
      "artist": "Taylor Swift",
      "max_results": 50
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `link` | string | `"https://www.last.fm/music/Taylor%20Swift"` |  |
| `artist` | string | `"Taylor Swift"` |  |
| `short_bio` | string or null | `"Taylor Alison Swift is an American singer-songwriter. Her discography spans multiple genres, and her narrative songwrit` |  |
| `genre_tags` | array |  |  |
| `image_link` | string or null | `"https://lastfm-img.freetls.fastly.net/i/u/ar0/9b8de6ff6dcc577f3d2827624e2a3855.jpg"` |  |
| `top_albums` | array |  |  |
| `top_albums[].link` | string | `"https://www.last.fm/music/Taylor+Swift/Lover"` |  |
| `top_albums[].rank` | integer | `1` |  |
| `top_albums[].title` | string | `"Lover"` |  |
| `top_albums[].listener_count` | integer or null | `2379531` |  |
| `top_tracks` | array |  |  |
| `top_tracks[].link` | string | `"https://www.last.fm/music/Taylor+Swift/_/Blank+Space"` |  |
| `top_tracks[].rank` | integer | `1` |  |
| `top_tracks[].title` | string | `"Blank Space"` |  |
| `top_tracks[].listener_count` | integer or null | `1922546` |  |
| `listener_count` | integer or null | `6122046` |  |
| `scrobble_count` | integer or null | `3796784309` |  |
| `similar_artists` | array |  |  |
| `similar_artists[].link` | string | `"https://www.last.fm/music/Sabrina+Carpenter"` |  |
| `similar_artists[].name` | string | `"Sabrina Carpenter"` |  |
| `upcoming_events` | array |  |  |
| `upcoming_events[].city` | string or null | `"Austin"` |  |
| `upcoming_events[].date` | string | `"2026-10-02"` |  |
| `upcoming_events[].link` | string | `"https://www.last.fm/festival/5026867+Austin+City+Limits+Music+Festival+2026+Weekend+1"` |  |
| `upcoming_events[].venue` | string or null | `"Zilker Metropolitan Park"` |  |
| `upcoming_events[].country` | string or null | `"United States"` |  |
| `upcoming_events[].event_name` | string | `"Austin City Limits Music Festival 2026 Weekend 1"` |  |

**Example input**

```json
{
  "artist": "Taylor Swift",
  "max_results": 10
}
```

**Example output**

```json
{
  "link": "https://www.last.fm/music/Taylor%20Swift",
  "artist": "Taylor Swift",
  "short_bio": "Taylor Alison Swift is an American singer-songwriter. Her discography spans multiple genres, and her narrative songwriting, which is often inspired by her personal life, has received widespread media …",
  "genre_tags": [
    "pop",
    "country",
    "female vocalists"
  ],
  "image_link": "https://lastfm-img.freetls.fastly.net/i/u/ar0/9b8de6ff6dcc577f3d2827624e2a3855.jpg",
  "top_albums": [
    {
      "link": "https://www.last.fm/music/Taylor+Swift/Lover",
      "rank": 1,
      "title": "Lover",
      "listener_count": 2379531
    },
    {
      "link": "https://www.last.fm/music/Taylor+Swift/reputation",
      "rank": 2,
      "title": "reputation",
      "listener_count": 2111880
    },
    {
      "link": "https://www.last.fm/music/Taylor+Swift/folklore",
      "rank": 3,
      "title": "folklore",
      "listener_count": 2101724
    }
  ],
  "top_tracks": [
    {
      "link": "https://www.last.fm/music/Taylor+Swift/_/Blank+Space",
      "rank": 1,
      "title": "Blank Space",
      "listener_count": 1922546
    },
    {
      "link": "https://www.last.fm/music/Taylor+Swift/_/Cruel+Summer",
      "rank": 2,
      "title": "Cruel Summer",
      "listener_count": 1748964
    },
    {
      "link": "https://www.last.fm/music/Taylor+Swift/_/Shake+It+Off",
      "rank": 3,
      "title": "Shake It Off",
      "listener_count": 1698280
    }
  ],
  "listener_count": 6122046,
  "scrobble_count": 3796784309,
  "similar_artists": [
    {
      "link": "https://www.last.fm/music/Sabrina+Carpenter",
      "name": "Sabrina Carpenter"
    },
    {
      "link": "https://www.last.fm/music/Gracie+Abrams",
      "name": "Gracie Abrams"
    },
    {
      "link": "https://www.last.fm/music/Olivia+Rodrigo",
      "name": "Olivia Rodrigo"
    }
  ],
  "upcoming_events": []
}
```

### List similar artists

Operation `list_similar_artists`, version 1. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.

Find artists similar to a named artist on Last.fm, ordered by similarity. Similarity percentages are null because public pages do not show them; occasional visitor challenges can interrupt results.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `artist` | string | yes | `"Daft Punk"` | Artist or band name, for example Radiohead. |
| `max_results` | integer | no | `4` | Most similar artists to return, for example 20. |

**Input schema**

```json
{
  "type": "object",
  "required": [
    "artist"
  ],
  "properties": {
    "artist": {
      "type": "string",
      "minLength": 1,
      "description": "Artist or band name, for example Radiohead.",
      "examples": [
        "Daft Punk",
        "Nirvana"
      ]
    },
    "max_results": {
      "type": "integer",
      "default": 20,
      "maximum": 100,
      "minimum": 1,
      "description": "Most similar artists to return, for example 20.",
      "x-fous-developer": true,
      "examples": [
        4,
        3
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "artist": "Daft Punk",
      "max_results": 4
    },
    {
      "artist": "Nirvana",
      "max_results": 3
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `artists` | array |  | Artists in the order Last.fm lists them, most similar first. |
| `artists[].genre_tags` | array |  |  |
| `artists[].image_link` | string or null | `"https://lastfm-img.freetls.fastly.net/i/u/300x300/c6b7f7341be1a9e2ae68a76b0b70e66d.jpg"` |  |
| `artists[].artist_name` | string | `"Justice"` |  |
| `artists[].last_fm_link` | string | `"https://www.last.fm/music/Justice"` |  |
| `artists[].listener_count` | integer or null | `2888080` |  |
| `artists[].similarity_percent` | number or null |  | Similarity from 0 to 100 when shown, otherwise null. |
| `matched_artist` | string | `"Daft Punk"` | Name of the matched Last.fm artist. |

**Example input**

```json
{
  "artist": "Daft Punk",
  "max_results": 4
}
```

**Example output**

```json
{
  "artists": [
    {
      "genre_tags": [
        "electronic",
        "french",
        "electro"
      ],
      "image_link": "https://lastfm-img.freetls.fastly.net/i/u/300x300/c6b7f7341be1a9e2ae68a76b0b70e66d.jpg",
      "artist_name": "Justice",
      "last_fm_link": "https://www.last.fm/music/Justice",
      "listener_count": 2888080,
      "similarity_percent": null
    },
    {
      "genre_tags": [
        "house",
        "electronic",
        "dance"
      ],
      "image_link": "https://lastfm-img.freetls.fastly.net/i/u/300x300/b1cb5257d113cf2f62031c3dc2c76f98.jpg",
      "artist_name": "Modjo",
      "last_fm_link": "https://www.last.fm/music/Modjo",
      "listener_count": 1726073,
      "similarity_percent": null
    },
    {
      "genre_tags": [
        "house",
        "electronic",
        "dance"
      ],
      "image_link": "https://lastfm-img.freetls.fastly.net/i/u/300x300/983b09e46b5cfee7184bf164a808f5e2.jpg",
      "artist_name": "Stardust",
      "last_fm_link": "https://www.last.fm/music/Stardust",
      "listener_count": 1251635,
      "similarity_percent": null
    }
  ],
  "matched_artist": "Daft Punk"
}
```

## Quick start

Replace `YOUR_API_KEY` with a Fous API key. To create one, open Developers at the bottom of Fous Studio, turn on Developer mode, then go to API keys (https://app.fous.com/keys). Change the values in `input` to run the same tool on new data.

```bash
curl 'https://api.fous.com/v1/query' \
  --fail-with-body --silent --show-error --max-time 180 \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "api": "@last-fm",
  "visibility": "public",
  "operation": "get_artist",
  "version": 1,
  "input": {
    "artist": "Taylor Swift",
    "max_results": 10
  },
  "response": {
    "format": "json"
  }
}'
```

```python
# Save as fous.py and run with python3 fous.py. No packages needed.
import json
import urllib.error
import urllib.request

api_key = "YOUR_API_KEY"

body = json.loads("{\n  \"api\": \"@last-fm\",\n  \"visibility\": \"public\",\n  \"operation\": \"get_artist\",\n  \"version\": 1,\n  \"input\": {\n    \"artist\": \"Taylor Swift\",\n    \"max_results\": 10\n  },\n  \"response\": {\n    \"format\": \"json\"\n  }\n}")
request = urllib.request.Request(
    "https://api.fous.com/v1/query",
    data=json.dumps(body).encode("utf-8"),
    headers={
        "Authorization": f"Bearer {api_key}",
        "Content-Type": "application/json",
    },
    method="POST",
)
try:
    with urllib.request.urlopen(request, timeout=180) as response:
        result = json.load(response)
except urllib.error.HTTPError as error:
    raise RuntimeError(f"HTTP {error.code}: {error.read().decode('utf-8', errors='replace')}") from error
if result.get("success") is False:
    raise RuntimeError(result.get("error", {}).get("message", "Request failed"))
print(json.dumps(result["data"]["output"], indent=2))
```

```typescript
// Save as fous.mts and run with npx tsx fous.mts.
const apiKey = "YOUR_API_KEY";

const response = await fetch("https://api.fous.com/v1/query", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  signal: AbortSignal.timeout(180_000),
  body: JSON.stringify({
  "api": "@last-fm",
  "visibility": "public",
  "operation": "get_artist",
  "version": 1,
  "input": {
    "artist": "Taylor Swift",
    "max_results": 10
  },
  "response": {
    "format": "json"
  }
}),
});
type ApiResult = { success: boolean; data?: { output: unknown }; error?: { message: string } };
const result: ApiResult = await response.json();
if (!response.ok || result.success === false) {
  throw new Error(result.error?.message ?? `HTTP ${response.status}`);
}
if (!result.data) throw new Error("Missing API response data");
console.log(result.data.output);
```

## Use from an AI assistant

Connect this tool to Claude Code, Claude Desktop, Cursor, VS Code, Codex and any MCP client as its own MCP server. Each method is a typed tool whose arguments are the method’s input.

- Server URL: `https://api.fous.com/mcp/tools/last-fm`
- Authorization: `Authorization: Bearer <Fous API key>`

**Tools**

- `get_artist`: Get artist. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.
- `list_similar_artists`: List similar artists. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.
- `fous_get_run`: the result of a run that was still going, by its `request_id`. Free.

Claude Code:

```bash
claude mcp add --scope user --transport http fous-last-fm https://api.fous.com/mcp/tools/last-fm --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"
```

To give the assistant every tool, connect `https://api.fous.com/mcp`: it finds one with `fous_search_tools` and runs it with `fous_run_tool`. Setup for other clients: https://fous.com/llms-full.txt.

## Use cases

- Compare listener counts across artists
- Find artists similar to a favorite band
- Review an artist’s most-listened-to tracks and albums
- Explore artist genres and short biographies
- Check listed upcoming events by city and venue

## FAQ

### Can I run it with my own inputs?

Yes. Change the inputs in Studio and press Run, or send new inputs from your code, or ask a connected AI assistant.

### Can I call this Last.fm tool as an API?

Yes. Send a POST request to /v1/query with your Fous API key and the inputs, and get JSON back.

### How much does it cost?

Each completed run costs 1 credit. Failed runs without a completed receipt are free; completed work can remain charged if delivery is interrupted. With pay as you go, a credit costs 1¢. Monthly plans cost less per credit.

### Do I need a Last.fm account?

No. You only need a Fous account.

### How current is the data?

Fous gets the data from last.fm when you run it. Some results are reused for up to 24 hours, and results that use your account or key are never reused. It was last verified on Oct 7, 2026.

### What are an artist’s most-listened-to tracks?

Get artist returns top tracks with their ranks and listener counts.

### Which artists are similar to a named artist?

List similar artists returns artists in the order Last.fm lists them, most similar first.

### What upcoming events are listed for an artist?

Get artist returns listed upcoming events, including their city, date, venue, and country.

## Related

- [Spotify API](https://fous.com/tools/spotify.md): Spotify returns public artist profiles, album credits and ordered tracks, song details and play counts, up to 500 playlist songs, keyword results, and country-based podcast charts; dates and regional options vary.
- [Apple Music API](https://fous.com/tools/apple-music.md): Apple Music returns albums, tracks, artist profiles, latest releases, top music, matching songs, and current charts; prices, previews, and older albums may be unavailable.
- [MusicBrainz API](https://fous.com/tools/musicbrainz.md): MusicBrainz provides community-maintained recording and release information, matching songs to identifiers and release dates and providing artist details and links when available; some release information may be incomplete.
- [SoundCloud API](https://fous.com/tools/soundcloud.md): SoundCloud lets people listen to and share music, find public tracks with play stats, and browse artists’ tracks, with popular lists limited to 30.
- [Discogs API](https://fous.com/tools/discogs.md): Discogs provides releases, collections and marketplace information, including edition and track details, community counts, available price statistics, and artists’ discographies; sold prices may be unavailable.
- [Genius API](https://fous.com/tools/genius.md): Genius provides lyrics, annotations, credits, and music knowledge, plus song stories, relationships, page details, and artist song lists by popularity or release date; dates and views may be unavailable.
- [Bandsintown API](https://fous.com/tools/bandsintown.md): Bandsintown provides artist tour dates and concert listings with venues, lineups and ticket or event links; results reflect listed upcoming shows and may include nearby venues.
- [setlist.fm API](https://fous.com/tools/setlist-fm.md): setlist.fm provides artists’ newest past concerts with performed songs, individual concert details and songs, and most-played songs by tour or year based on published setlists.
- [All Entertainment tools](https://fous.com/tools/category/entertainment)
