# Apple Music API

> Apple Music returns album, artist, song search, and chart data as a workflow and API.

Get artist returns an artist profile, latest release, top songs, and albums; provide an artist name or link, with optional country and album count. Search songs matches title or artist words; List top charts returns chart entries by country. Provide a search query or chart and country.

- Page: https://fous.com/tools/apple-music
- Handle: `@apple-music`
- Category: [Entertainment](https://fous.com/tools/category/entertainment)
- Source website: https://music.apple.com
- Last verified: Sep 29, 2026

## Methods

### Get album

Operation `get_album`, 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 an Apple Music album by title and optional artist, or by album link. Returns its matched release, purchase details, and tracks in order. Record label is shown only when identifiable from the copyright notice; some albums have no price or previews.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `album` | string | yes | `"Rumours"` | Album name or Apple Music album link, for example Rumours or https://music.apple.com/us/album/rumours/594061854. |
| `artist` | string | no | `"Fleetwood Mac"` | Artist to match, for example Fleetwood Mac. |
| `country` | string | no | `"United Kingdom"` | Country name or two-letter code for the music catalog, for example United States or GB. |

**Input schema**

```json
{
  "type": "object",
  "required": [
    "album"
  ],
  "properties": {
    "album": {
      "type": "string",
      "description": "Album name or Apple Music album link, for example Rumours or https://music.apple.com/us/album/rumours/594061854.",
      "examples": [
        "Rumours",
        "https://music.apple.com/us/album/rumours/594061854",
        "21"
      ]
    },
    "artist": {
      "type": "string",
      "default": "",
      "description": "Artist to match, for example Fleetwood Mac.",
      "examples": [
        "Fleetwood Mac",
        "Adele"
      ]
    },
    "country": {
      "type": "string",
      "default": "United States",
      "description": "Country name or two-letter code for the music catalog, for example United States or GB.",
      "examples": [
        "United Kingdom"
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "album": "Rumours",
      "artist": "Fleetwood Mac"
    },
    {
      "album": "https://music.apple.com/us/album/rumours/594061854"
    },
    {
      "album": "21",
      "artist": "Adele",
      "country": "United Kingdom"
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `genre` | string or null | `"Rock"` | Album genre. |
| `artist` | string or null | `"Fleetwood Mac"` | Matched performing artist. |
| `tracks` | array |  | Tracks in disc and track order. |
| `tracks[].title` | string or null | `"Second Hand News"` | Track title. |
| `tracks[].length` | string or null | `"2:56"` | Track duration in m:ss. |
| `tracks[].track_id` | integer or null | `594061855` | Apple Music track ID. |
| `tracks[].preview_link` | string or null | `"https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview211/v4/4f/69/e6/4f69e68c-224c-39ce-e80c-6015940fb338/mzaf_` | 30-second preview link, if available. |
| `tracks[].track_number` | integer or null | `1` | Track number on its disc. |
| `tracks[].apple_music_link` | string or null | `"https://music.apple.com/us/album/second-hand-news/594061854?i=594061855"` | Apple Music track page link. |
| `tracks[].length_milliseconds` | integer or null | `176307` | Track duration in milliseconds. |
| `album_id` | integer or null | `594061854` | Apple Music album ID. |
| `explicit` | string or null | `"no"` | Whether the album is marked explicit: yes or no. |
| `copyright` | string or null | `"℗ 2004 Warner Records Inc."` | Album copyright notice. |
| `album_title` | string or null | `"Rumours"` | Matched album title. |
| `itunes_price` | number or null | `10.99` | Album purchase price in iTunes, if available. |
| `record_label` | string or null | `"Warner Records Inc."` | Record label when the listed rights holder names a recording label. |
| `release_date` | string or null | `"1977-02-04"` | Release date, YYYY-MM-DD. |
| `total_length` | string or null | `"39 minutes 57 seconds"` | Total duration of the listed tracks. |
| `currency_code` | string or null | `"USD"` | Currency of the iTunes price. |
| `cover_art_link` | string or null | `"https://is1-ssl.mzstatic.com/image/thumb/Music124/v4/4d/13/ba/4d13bac3-d3d5-7581-2c74-034219eadf2b/081227970949.jpg/120` | Cover art image link. |
| `apple_music_link` | string or null | `"https://music.apple.com/us/album/rumours/594061854"` | Apple Music album page link. |
| `number_of_tracks` | integer or null | `11` | Number of album tracks. |
| `total_length_milliseconds` | integer or null | `2396893` | Total duration in milliseconds. |

**Example input**

```json
{
  "album": "Rumours",
  "artist": "Fleetwood Mac"
}
```

**Example output**

```json
{
  "genre": "Rock",
  "artist": "Fleetwood Mac",
  "tracks": [
    {
      "title": "Second Hand News",
      "length": "2:56",
      "track_id": 594061855,
      "preview_link": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview211/v4/4f/69/e6/4f69e68c-224c-39ce-e80c-6015940fb338/mzaf_8292619002307513028.plus.aac.p.m4a",
      "track_number": 1,
      "apple_music_link": "https://music.apple.com/us/album/second-hand-news/594061854?i=594061855",
      "length_milliseconds": 176307
    },
    {
      "title": "Dreams",
      "length": "4:18",
      "track_id": 594061856,
      "preview_link": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview211/v4/d4/37/e7/d437e72a-c41b-332c-f196-bee295a9d673/mzaf_11574904347171701919.plus.aac.p.m4a",
      "track_number": 2,
      "apple_music_link": "https://music.apple.com/us/album/dreams/594061854?i=594061856",
      "length_milliseconds": 257800
    },
    {
      "title": "Never Going Back Again",
      "length": "2:14",
      "track_id": 594061857,
      "preview_link": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview211/v4/cc/40/a3/cc40a34c-abd6-9d92-0550-334961e8d97f/mzaf_3772783327912029759.plus.aac.p.m4a",
      "track_number": 3,
      "apple_music_link": "https://music.apple.com/us/album/never-going-back-again/594061854?i=594061857",
      "length_milliseconds": 134400
    }
  ],
  "album_id": 594061854,
  "explicit": "no",
  "copyright": "℗ 2004 Warner Records Inc.",
  "album_title": "Rumours",
  "itunes_price": 10.99,
  "record_label": "Warner Records Inc.",
  "release_date": "1977-02-04",
  "total_length": "39 minutes 57 seconds",
  "currency_code": "USD",
  "cover_art_link": "https://is1-ssl.mzstatic.com/image/thumb/Music124/v4/4d/13/ba/4d13bac3-d3d5-7581-2c74-034219eadf2b/081227970949.jpg/1200x1200bb.jpg",
  "apple_music_link": "https://music.apple.com/us/album/rumours/594061854",
  "number_of_tracks": 11,
  "total_length_milliseconds": 2396893
}
```

### 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 Apple Music artist profile by name or artist link, including the latest release, top songs and albums. Very prolific artists may have older albums beyond the public catalog's listing limit.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `artist` | string | yes | `"Billie Eilish"` | Artist name or Apple Music artist link, for example Billie Eilish or https://music.apple.com/us/artist/billie-eilish/1065981054. |
| `country` | string | no | `"United Kingdom"` | Country name or two-letter country code, for example United Kingdom or GB. |
| `max_albums` | integer | no | `5` | Maximum albums to return, for example 50 (up to 200). |

**Input schema**

```json
{
  "type": "object",
  "required": [
    "artist"
  ],
  "properties": {
    "artist": {
      "type": "string",
      "description": "Artist name or Apple Music artist link, for example Billie Eilish or https://music.apple.com/us/artist/billie-eilish/1065981054.",
      "examples": [
        "Billie Eilish",
        "https://music.apple.com/gb/artist/taylor-swift/159260351",
        "Daft Punk"
      ]
    },
    "country": {
      "type": "string",
      "default": "United States",
      "description": "Country name or two-letter country code, for example United Kingdom or GB.",
      "examples": [
        "United Kingdom",
        "US"
      ]
    },
    "max_albums": {
      "type": "integer",
      "default": 50,
      "maximum": 200,
      "minimum": 1,
      "description": "Maximum albums to return, for example 50 (up to 200).",
      "x-fous-developer": true,
      "examples": [
        5,
        3
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "artist": "Billie Eilish"
    },
    {
      "artist": "https://music.apple.com/gb/artist/taylor-swift/159260351",
      "country": "United Kingdom",
      "max_albums": 5
    },
    {
      "artist": "Daft Punk",
      "country": "US",
      "max_albums": 3
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `albums` | array |  |  |
| `albums[].link` | string | `"https://music.apple.com/us/album/hit-me-hard-and-soft/1739659134"` |  |
| `albums[].title` | string | `"HIT ME HARD AND SOFT"` |  |
| `albums[].release_year` | integer or null | `2024` |  |
| `albums[].number_of_tracks` | integer or null | `11` |  |
| `top_songs` | array |  |  |
| `top_songs[].album` | string or null | `"dont smile at me"` |  |
| `top_songs[].title` | string or null | `"ocean eyes"` |  |
| `top_songs[].song_link` | string | `"https://music.apple.com/us/album/ocean-eyes/1440898929?i=1440899467"` |  |
| `top_songs[].preview_link` | string or null | `"https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview221/v4/d6/59/2b/d6592b0b-1e7e-4743-b2e4-f2af038fd783/mzaf_` |  |
| `main_genre` | string or null | `"Alternative"` |  |
| `artist_name` | string | `"Billie Eilish"` |  |
| `latest_release` | object or null |  |  |
| `latest_release.title` | string | `"INTRO (HIT ME HARD AND SOFT TOUR) - Single"` |  |
| `latest_release.release_date` | string or null | `"2026-04-24"` |  |
| `apple_artist_id` | string | `"1065981054"` |  |
| `apple_music_link` | string | `"https://music.apple.com/us/artist/billie-eilish/1065981054"` |  |
| `artist_image_link` | string or null | `"https://is1-ssl.mzstatic.com/image/thumb/AMCArtistImages211/v4/e1/f3/6a/e1f36a60-9897-162d-3697-7501eeafbc3b/a1d41336-4` |  |

**Example input**

```json
{
  "artist": "Billie Eilish"
}
```

**Example output**

```json
{
  "albums": [
    {
      "link": "https://music.apple.com/us/album/hit-me-hard-and-soft/1739659134",
      "title": "HIT ME HARD AND SOFT",
      "release_year": 2024,
      "number_of_tracks": 11
    },
    {
      "link": "https://music.apple.com/us/album/happier-than-ever/1564530719",
      "title": "Happier Than Ever",
      "release_year": 2021,
      "number_of_tracks": 16
    }
  ],
  "top_songs": [
    {
      "album": "dont smile at me",
      "title": "ocean eyes",
      "song_link": "https://music.apple.com/us/album/ocean-eyes/1440898929?i=1440899467",
      "preview_link": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview221/v4/d6/59/2b/d6592b0b-1e7e-4743-b2e4-f2af038fd783/mzaf_7697277787797935735.plus.aac.p.m4a"
    },
    {
      "album": "HIT ME HARD AND SOFT",
      "title": "WILDFLOWER",
      "song_link": "https://music.apple.com/us/album/wildflower/1739659134?i=1739659144",
      "preview_link": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview221/v4/de/c3/e8/dec3e884-7237-9622-718a-12c5f48c5ca2/mzaf_3134455671785145822.plus.aac.p.m4a"
    }
  ],
  "main_genre": "Alternative",
  "artist_name": "Billie Eilish",
  "latest_release": {
    "title": "INTRO (HIT ME HARD AND SOFT TOUR) - Single",
    "release_date": "2026-04-24"
  },
  "apple_artist_id": "1065981054",
  "apple_music_link": "https://music.apple.com/us/artist/billie-eilish/1065981054",
  "artist_image_link": "https://is1-ssl.mzstatic.com/image/thumb/AMCArtistImages211/v4/e1/f3/6a/e1f36a60-9897-162d-3697-7501eeafbc3b/a1d41336-49bd-4212-8787-57547ca3f87e_ami-identity-ef10a72d4764d04743b17fa13520b756-2024-04-…"
}
```

### List top charts

Operation `list_top_charts`, 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.

List the current top songs, albums, or music videos in chart order for a country. Countries without an Apple Music chart are unavailable.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `chart` | string | no | `"top_albums"` | Chart to list, for example top_albums. |
| `country` | string | no | `"Canada"` | Country name or two-letter code, for example Canada or CA. |
| `max_results` | integer | no | `8` | Number of entries, for example 25 (maximum 100). |

**Input schema**

```json
{
  "type": "object",
  "properties": {
    "chart": {
      "enum": [
        "top_songs",
        "top_albums",
        "top_music_videos"
      ],
      "type": "string",
      "default": "top_songs",
      "description": "Chart to list, for example top_albums.",
      "examples": [
        "top_albums",
        "top_songs",
        "top_music_videos"
      ]
    },
    "country": {
      "type": "string",
      "default": "United States",
      "description": "Country name or two-letter code, for example Canada or CA.",
      "examples": [
        "Canada",
        "United States",
        "GB"
      ]
    },
    "max_results": {
      "type": "integer",
      "default": 50,
      "maximum": 100,
      "minimum": 1,
      "description": "Number of entries, for example 25 (maximum 100).",
      "x-fous-developer": true,
      "examples": [
        8,
        5
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "chart": "top_albums",
      "country": "Canada",
      "max_results": 8
    },
    {
      "chart": "top_songs",
      "country": "United States"
    },
    {
      "chart": "top_music_videos",
      "country": "GB",
      "max_results": 5
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `items` | array |  |  |
| `items[].rank` | integer | `1` | Position in the chart. |
| `items[].genre` | string or null | `"Pop"` |  |
| `items[].title` | string or null | `"The Life of a Showgirl: The Encore"` |  |
| `items[].artist` | string or null | `"Taylor Swift"` |  |
| `items[].apple_id` | string or null | `"6814997249"` |  |
| `items[].release_date` | string or null | `"2026-09-24"` | Release date in YYYY-MM-DD format. |
| `items[].apple_music_url` | string or null | `"https://music.apple.com/ca/album/the-life-of-a-showgirl-the-encore/6814997249"` |  |
| `items[].cover_image_url` | string or null | `"https://is1-ssl.mzstatic.com/image/thumb/Music221/v4/a0/dd/fd/a0ddfd72-ee9e-f046-6466-a5dbefc696fa/26UM1IM21436.rgb.jpg` |  |

**Example input**

```json
{
  "chart": "top_albums",
  "country": "Canada",
  "max_results": 8
}
```

**Example output**

```json
{
  "items": [
    {
      "rank": 1,
      "genre": "Pop",
      "title": "The Life of a Showgirl: The Encore",
      "artist": "Taylor Swift",
      "apple_id": "6814997249",
      "release_date": "2026-09-24",
      "apple_music_url": "https://music.apple.com/ca/album/the-life-of-a-showgirl-the-encore/6814997249",
      "cover_image_url": "https://is1-ssl.mzstatic.com/image/thumb/Music221/v4/a0/dd/fd/a0ddfd72-ee9e-f046-6466-a5dbefc696fa/26UM1IM21436.rgb.jpg/100x100bb.jpg"
    },
    {
      "rank": 2,
      "genre": "Hip-Hop/Rap",
      "title": "AUJLA SZN 1 - EP",
      "artist": "Karan Aujla",
      "apple_id": "6814002539",
      "release_date": "2026-09-25",
      "apple_music_url": "https://music.apple.com/ca/album/aujla-szn-1-ep/6814002539",
      "cover_image_url": "https://is1-ssl.mzstatic.com/image/thumb/Music211/v4/74/b9/74/74b974cc-a8e3-ab69-1675-65b29e5324d1/5064089826918_cover.jpg/100x100bb.jpg"
    },
    {
      "rank": 3,
      "genre": "Pop",
      "title": "you seem pretty sad for a girl so in love",
      "artist": "Olivia Rodrigo",
      "apple_id": "1889992111",
      "release_date": "2026-06-12",
      "apple_music_url": "https://music.apple.com/ca/album/you-seem-pretty-sad-for-a-girl-so-in-love/1889992111",
      "cover_image_url": "https://is1-ssl.mzstatic.com/image/thumb/Music221/v4/1d/1b/f9/1d1bf9b1-44c6-9a6c-6ffb-c158488c06ce/26UMGIM39303.rgb.jpg/100x100bb.jpg"
    }
  ]
}
```

### Search songs

Operation `search_songs`, 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.

Search Apple Music songs by title and artist words. Returns matching tracks in relevance order, with purchase prices and previews when available.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `query` | string | yes | `"Espresso Sabrina Carpenter"` | Song title and/or artist words, such as Espresso Sabrina Carpenter. |
| `country` | string | no | `"United Kingdom"` | Country name or two-letter code, such as United States or GB. |
| `max_results` | integer | no | `5` | Maximum number of matches to return, such as 20 (up to 200). |

**Input schema**

```json
{
  "type": "object",
  "required": [
    "query"
  ],
  "properties": {
    "query": {
      "type": "string",
      "minLength": 1,
      "description": "Song title and/or artist words, such as Espresso Sabrina Carpenter.",
      "examples": [
        "Espresso Sabrina Carpenter",
        "Heroes David Bowie",
        "zzzznotarealsongnameuniqueqyyu"
      ]
    },
    "country": {
      "type": "string",
      "default": "United States",
      "description": "Country name or two-letter code, such as United States or GB.",
      "examples": [
        "United Kingdom",
        "US"
      ]
    },
    "max_results": {
      "type": "integer",
      "default": 20,
      "maximum": 200,
      "minimum": 1,
      "description": "Maximum number of matches to return, such as 20 (up to 200).",
      "x-fous-developer": true,
      "examples": [
        5,
        200
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "query": "Espresso Sabrina Carpenter"
    },
    {
      "query": "Heroes David Bowie",
      "country": "United Kingdom",
      "max_results": 5
    },
    {
      "query": "Espresso Sabrina Carpenter",
      "country": "US",
      "max_results": 200
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `songs` | array |  |  |
| `songs[].album` | string or null | `"Espresso EP"` |  |
| `songs[].genre` | string or null | `"Pop"` |  |
| `songs[].title` | string or null | `"Espresso (On Vacation Version)"` |  |
| `songs[].artist` | string or null | `"Sabrina Carpenter"` |  |
| `songs[].length` | string or null | `"2:55"` |  |
| `songs[].currency` | string or null | `"USD"` |  |
| `songs[].explicit` | string or null | `"no"` |  |
| `songs[].track_id` | integer or null | `1746801012` |  |
| `songs[].itunes_price` | number or null | `1.29` |  |
| `songs[].preview_link` | string or null | `"https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview211/v4/e9/4d/02/e94d0230-11ee-ef94-d2cf-a5d547bd73f4/mzaf_` |  |
| `songs[].release_date` | string or null | `"2024-05-17"` |  |
| `songs[].apple_music_link` | string or null | `"https://music.apple.com/us/album/espresso-on-vacation-version/1746800651?i=1746801012&uo=4"` |  |
| `songs[].length_milliseconds` | integer or null | `175459` |  |

**Example input**

```json
{
  "query": "Espresso Sabrina Carpenter"
}
```

**Example output**

```json
{
  "songs": [
    {
      "album": "Espresso EP",
      "genre": "Pop",
      "title": "Espresso (On Vacation Version)",
      "artist": "Sabrina Carpenter",
      "length": "2:55",
      "currency": "USD",
      "explicit": "no",
      "track_id": 1746801012,
      "itunes_price": 1.29,
      "preview_link": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview211/v4/e9/4d/02/e94d0230-11ee-ef94-d2cf-a5d547bd73f4/mzaf_554140808559155562.plus.aac.p.m4a",
      "release_date": "2024-05-17",
      "apple_music_link": "https://music.apple.com/us/album/espresso-on-vacation-version/1746800651?i=1746801012&uo=4",
      "length_milliseconds": 175459
    },
    {
      "album": "Short n' Sweet",
      "genre": "Pop",
      "title": "Espresso",
      "artist": "Sabrina Carpenter",
      "length": "2:55",
      "currency": "USD",
      "explicit": "no",
      "track_id": 1752214923,
      "itunes_price": 1.29,
      "preview_link": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview211/v4/99/da/ff/99daffce-cdde-59c6-5ae0-7f922ce411a8/mzaf_5621292401829922816.plus.aac.p.m4a",
      "release_date": "2024-06-14",
      "apple_music_link": "https://music.apple.com/us/album/espresso/1752214909?i=1752214923&uo=4",
      "length_milliseconds": 175459
    },
    {
      "album": "Espresso - Single",
      "genre": "Pop",
      "title": "Espresso",
      "artist": "Sabrina Carpenter",
      "length": "2:55",
      "currency": "USD",
      "explicit": "no",
      "track_id": 1744253558,
      "itunes_price": 1.29,
      "preview_link": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview211/v4/48/14/5f/48145fa9-a5b6-32a0-45e8-05af48e52b9c/mzaf_6315924685303002328.plus.aac.p.m4a",
      "release_date": "2024-06-14",
      "apple_music_link": "https://music.apple.com/us/album/espresso/1744253545?i=1744253558&uo=4",
      "length_milliseconds": 175459
    }
  ]
}
```

## 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": "@apple-music",
  "visibility": "public",
  "operation": "get_album",
  "version": 1,
  "input": {
    "album": "Rumours",
    "artist": "Fleetwood Mac"
  },
  "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\": \"@apple-music\",\n  \"visibility\": \"public\",\n  \"operation\": \"get_album\",\n  \"version\": 1,\n  \"input\": {\n    \"album\": \"Rumours\",\n    \"artist\": \"Fleetwood Mac\"\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": "@apple-music",
  "visibility": "public",
  "operation": "get_album",
  "version": 1,
  "input": {
    "album": "Rumours",
    "artist": "Fleetwood Mac"
  },
  "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/apple-music`
- Authorization: `Authorization: Bearer <Fous API key>`

**Tools**

- `get_album`: Get album. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.
- `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_top_charts`: List top charts. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.
- `search_songs`: Search songs. 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-apple-music https://api.fous.com/mcp/tools/apple-music --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

- Review album tracks, release dates, and available purchase prices.
- Compare an artist’s albums, latest release, and top songs.
- Find songs by title or artist and check available previews.
- Compare song, album, or music video chart rankings by country.

## 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 Apple Music 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 Apple Music account?

No. You only need a Fous account.

### How current is the data?

Fous gets the data from music.apple.com 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 Sep 29, 2026.

### What tracks appear on an album?

Get album returns the matched album’s tracks in disc and track order.

### What are an artist’s latest release and top songs?

Get artist returns an artist’s latest release and top songs.

### Which songs, albums, or videos top a country’s charts?

List top charts returns chart entries in rank order for a country.

## Related

- [Deezer API](https://fous.com/tools/deezer.md): Deezer provides albums with ordered tracklists, song recording details, and current worldwide charts or official country-playlist tracks; previews and some tempo data may be unavailable or expire.
- [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.
- [Shazam API](https://fous.com/tools/shazam.md): Shazam helps discover music and explore trending songs, returning current top charts and country-specific lists of up to 10 rapidly rising Discovery songs where available.
- [Apple Podcasts API](https://fous.com/tools/apple-podcasts.md): Apple Podcasts returns chart listings, relevant show search results, show details with newest available episodes, and country-specific ratings and reviews; results are capped, and older or subscription episodes 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.
- [Apple App Store API](https://fous.com/tools/apple-app-store.md): Apple App Store returns public app listings, keyword search, ratings, prices, listed purchases, country-specific reviews and visible replies, and up to 200 ranked chart apps.
- [Last.fm API](https://fous.com/tools/last-fm.md): Last.fm provides listening statistics, artist profiles, discovery, up to 50 tracks or albums, similar artists without percentages, and upcoming events that may be absent.
- [YouTube API](https://fous.com/tools/youtube.md): YouTube returns public video, caption, comment and channel details, company channels, and the latest weekly Top Songs chart; inferred dates and some counts may be approximate.
- [All Entertainment tools](https://fous.com/tools/category/entertainment)
