# 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/workflows/last-fm
- Handle: `@last-fm`
- Category: [Entertainment](https://fous.com/workflows/category/entertainment)
- Source website: https://last.fm
- Last verified: Sep 30, 2026
- Fous is not affiliated with Last.fm.

## Methods

### Get artist

Operation `get_artist`, version 1. 1 credit per call.

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 call.

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

Call the API with a Fous API key (`FOUS_API_KEY`). To create one, turn on Developer mode in Fous Studio, then open Keys & connections → API keys (https://app.fous.com/keys).

```bash
# First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
: "${FOUS_API_KEY:?Set FOUS_API_KEY before running this example}"

curl 'https://api.fous.com/v1/query' \
  --fail-with-body --silent --show-error --max-time 120 \
  -H "Authorization: Bearer $FOUS_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.
# First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
import json
import os
import urllib.error
import urllib.request

api_key = os.environ.get("FOUS_API_KEY")
if not api_key:
    raise RuntimeError("Set FOUS_API_KEY before running this example")

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=120) 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.
// First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
const apiKey = process.env.FOUS_API_KEY;
if (!apiKey) throw new Error("Set FOUS_API_KEY before running this example");

const response = await fetch("https://api.fous.com/v1/query", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  signal: AbortSignal.timeout(120_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);
```

Or describe the data in plain language: send `{"api":"@last-fm","prompt":"Describe the data you need, with every detail"}` to the same URL. Fous fills in the input, runs the method that fits and returns only the fields you asked for; `data.route.calls[].request` is the exact call it made. Routing is free; the run costs the same.

## 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

### Is Fous affiliated with Last.fm?

No. Fous is not affiliated with Last.fm. This workflow reads the public last.fm website and returns its data.

### How much does it cost?

Each run costs 1 credit. 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; repeating the same request within a day may return the saved result. Fous checks this workflow automatically; it last passed a check on Sep 30, 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/workflows/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/workflows/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/workflows/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/workflows/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/workflows/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/workflows/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/workflows/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/workflows/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 workflows](https://fous.com/workflows/category/entertainment)
