# Apple API: Search songs

> Searches the Apple Music song catalog by title and artist words, returning matching tracks in relevance order with prices and previews when available.

Unofficial. Not affiliated with or endorsed by Apple.

- Page: https://fous.com/methods/music.apple.com/search-songs
- Method: `music.apple.com/search_songs`, version 1
- Website: music.apple.com
- Returns: title, artist, album, release date, length, genre, explicit flag, price, preview and Apple Music links
- Effect: read (it gets data and changes nothing)
- Sign-in: none needed
- Cost: 1 credit per completed run (1¢ with pay as you go); failed runs are free
- Verified: Nov 2, 2026

## Inputs

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

## Output

From a run on Oct 23, 2026, shortened. Its input:

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

Its 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
    }
  ]
}
```

## Run it

From code, with a Fous API key in `FOUS_API_KEY`; the answer's `data` holds the output:

```bash
curl https://api.fous.com/v1/runs \
  -H "Authorization: Bearer $FOUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"method":"music.apple.com/search_songs","input":{"query":"Espresso Sabrina Carpenter"}}'
```

From an AI agent connected to the Fous MCP server: its `run` with the same method and input. To connect one, give it `set up https://fous.com/SKILL.md`.

## Ask your agent

- Find songs by Sabrina Carpenter with prices and preview links on Apple Music
- I need the top 10 tracks matching 'Espresso' in the UK store, with album and release date
- Look up tracks titled Blinding Lights by The Weeknd and show explicit flags
- Which songs match the words 'midnight rain Taylor' in Canada, max 5 results?
- Search Apple Music for Bad Guy by Billie Eilish and give me genre and song length

## 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."
    },
    "country": {
      "type": "string",
      "default": "United States",
      "description": "Country name or two-letter code, such as United States or GB."
    },
    "max_results": {
      "type": "integer",
      "default": 20,
      "maximum": 200,
      "minimum": 1,
      "description": "Maximum number of matches to return, such as 20 (up to 200)."
    }
  }
}
```

## Output schema

```json
{
  "type": "object",
  "required": [
    "songs"
  ],
  "properties": {
    "songs": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "title",
          "artist",
          "album",
          "release_date",
          "length",
          "genre",
          "explicit",
          "itunes_price",
          "currency",
          "preview_link",
          "apple_music_link",
          "track_id",
          "length_milliseconds"
        ],
        "properties": {
          "album": {
            "type": [
              "string",
              "null"
            ]
          },
          "genre": {
            "type": [
              "string",
              "null"
            ]
          },
          "title": {
            "type": [
              "string",
              "null"
            ]
          },
          "artist": {
            "type": [
              "string",
              "null"
            ]
          },
          "length": {
            "type": [
              "string",
              "null"
            ]
          },
          "currency": {
            "type": [
              "string",
              "null"
            ]
          },
          "explicit": {
            "enum": [
              "yes",
              "no",
              null
            ],
            "type": [
              "string",
              "null"
            ]
          },
          "track_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "itunes_price": {
            "type": [
              "number",
              "null"
            ]
          },
          "preview_link": {
            "type": [
              "string",
              "null"
            ]
          },
          "release_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "apple_music_link": {
            "type": [
              "string",
              "null"
            ]
          },
          "length_milliseconds": {
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "additionalProperties": false
      }
    }
  },
  "additionalProperties": false
}
```

## See more

- [Apple API: Search podcasts](https://fous.com/methods/podcasts.apple.com/search-podcasts.md): Finds Apple Podcasts shows by name or topic in a country, ordered by search relevance, with ratings when the show page provides them.
- [Apple API: Search apps](https://fous.com/methods/apps.apple.com/search-apps.md): Finds iPhone and iPad apps by keyword in a chosen country's App Store, with ratings, prices, categories and App Store links.
- [Apple API: Get album](https://fous.com/methods/music.apple.com/get-album.md): Finds an Apple Music album by title and optional artist, or by album link, and returns its matched release, purchase details and tracks in order.
- [Apple API: List top charts](https://fous.com/methods/music.apple.com/list-top-charts.md): Lists the current top songs, albums, or music videos on Apple Music for a country, in chart order. Countries without an Apple Music chart return no results.
- [Apple API: Get artist](https://fous.com/methods/music.apple.com/get-artist.md): Gets an Apple Music artist profile by name or artist link. The profile includes the latest release, top songs and albums.
- [Apple API: Get podcast](https://fous.com/methods/podcasts.apple.com/get-podcast.md): Gets an Apple Podcasts show's details and its newest available episodes, by show name or Apple Podcasts link.
- [Apple API: Get App Store app](https://fous.com/methods/apps.apple.com/get-app.md): Gets an iPhone or iPad app's public App Store listing by name or link. You can narrow it by developer and country. In-app purchases are included when the page lists them.
- [Apple API: Get app reviews](https://fous.com/methods/apps.apple.com/get-app-reviews.md): Gets customer reviews for an iPhone or iPad app, found by name or App Store link, from the selected country's App Store.
- [All Apple methods](https://fous.com/methods/apple.com.md)
