# Apple Music Search Scraper (`headlessagent/applemusic-search-scraper`) Actor

Search Apple Music for songs, albums, artists, playlists, music videos, and more. Get structured data with artwork URLs in multiple resolutions, track details, ISRC codes, audio traits (Lossless, Atmos), and complete metadata.

- **URL**: https://apify.com/headlessagent/applemusic-search-scraper.md
- **Developed by:** [Headless Agent](https://apify.com/headlessagent) (community)
- **Categories:** Developer tools, Other, Integrations
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## Apple Music Search Scraper

Search Apple Music for songs, albums, artists, playlists, music videos, and more. Get structured JSON with detailed metadata, artwork URLs, and more.

### 🤔 What can Apple Music Search Scraper do?

This Actor lets you **search Apple Music and extract music data**. Just provide search queries and get structured results:

🔍 Search Apple Music by song title, artist name, album, or any keyword

🎵 Get results across multiple types: songs, albums, artists, playlists, music videos, stations, and more

🖼️ Get artwork URLs in multiple resolutions (120x120, 240x240, 640x640, 1024x1024) in WebP format

📝 Get rich metadata: release dates, track numbers, composers, genres, audio traits (Lossless, Atmos), ISRC codes

👤 Collect artist info including artist URLs and related data

📦 Download results in **JSON, CSV, XML, or Excel** from the Apify Dataset

🦾 Integrate via **API, webhooks, SDKs** (Python & Node.js), or connect with tools like Zapier, n8n, Make, and more

### ✅ What data can I scrape from Apple Music?

#### From each search result:

- 🆔 Apple Music ID and direct URL
- 📝 Name, artist name, and type (songs, albums, artists, etc.)
- 🖼️ Artwork URLs in 4 resolutions (120, 240, 640, 1024) in WebP format with color palette info
- 🎵 Genre names and content rating
- 📅 Release date
- 👤 Artist URL

#### Type-specific fields:

| Type | Additional Fields |
|------|------------------|
| 🎤 Songs | `albumName`, `composerName`, `trackNumber`, `discNumber`, `durationInMillis`, `hasLyrics`, `hasTimeSyncedLyrics`, `isrc`, `audioTraits` (Lossless, Atmos, Spatial) |
| 💿 Albums | `trackCount`, `artistUrl`, `description` |
| 🧑‍🎤 Artists | `artistUrl` |
| 📋 Playlists | `curatorName`, `description`, `playlistType`, `isChart`, `lastModifiedDate` |
| 🎬 Music Videos | `durationInMillis`, `description`, `has4K`, `hasHDR` |
| 📻 Stations/Radio | `isLive`, `durationInMillis`, `description`, `showHostName` |
| 🎥 Music Movies | `studioName`, `description`, `durationInMillis` |

Each result also includes a `rawAttributes` object with the complete API response attributes for maximum flexibility.

### 🔧 How to scrape Apple Music

1. [Create](https://console.apify.com/sign-up) a free Apify account.
2. Open Apple Music Search Scraper.
3. Add **search queries** (one or more) to search Apple Music.
4. Optionally set **limit** per query and configure **proxy**.
5. Click **Save & Start** and wait for the data to be extracted.
6. Download your data in JSON, CSV, XML, Excel, or access it via API.

### ⬇️ Input

| Field | Type | Description |
|-------|------|-------------|
| `queries` | `string[]` | List of search queries to search on Apple Music. |
| `limit` | `integer` | Maximum number of results per query (default: 21, max: 100). |
| `proxy` | `object` | Optional. Apify proxy configuration with `useApifyProxy`, `apifyProxyGroups`, `apifyProxyCountry`. |

#### Example input — Search

```json
{
    "queries": ["Taylor Swift", "Billie Eilish", "Bohemian Rhapsody"],
    "limit": 5
}
````

#### Example input — With proxy

```json
{
    "queries": ["Bohemian Rhapsody"],
    "limit": 3,
    "proxy": {
        "useApifyProxy": true,
        "apifyProxyGroups": ["RESIDENTIAL"],
        "apifyProxyCountry": "US"
    }
}
```

### ⬆️ Output

Results are pushed to the Apify Dataset. Each entry contains all results for one query grouped together.

#### 🔎 Output sample

```json
{
    "search_query": "Bohemian Rhapsody",
    "totalResults": 19,
    "results": [
        {
            "id": "1125281672",
            "type": "songs",
            "name": "Bohemian Rhapsody",
            "artistName": "Panic! At the Disco",
            "url": "https://music.apple.com/us/album/bohemian-rhapsody/1125281254?i=1125281672",
            "artwork": {
                "url": "https://is1-ssl.mzstatic.com/image/thumb/.../640x640bb.webp",
                "url120": ".../120x120bb.webp",
                "url640": ".../640x640bb.webp",
                "url1024": ".../1024x1024bb.webp",
                "bgColor": "9cda9c"
            },
            "genreNames": ["Alternative", "Music"],
            "releaseDate": "2016-08-04",
            "durationInMillis": 361800,
            "albumName": "Suicide Squad: The Album",
            "composerName": "Freddie Mercury",
            "trackNumber": 11,
            "hasLyrics": true,
            "isrc": "USAT21601936",
            "artistUrl": "https://music.apple.com/us/artist/panic-at-the-disco/80456331"
        },
        {
            "id": "914076292",
            "type": "albums",
            "name": "Bohemian Rhapsody - Single",
            "artistName": "The Forest Rangers",
            "url": "https://music.apple.com/us/album/.../914076292",
            "artwork": {
                "url": ".../640x640bb.webp",
                "bgColor": "020001"
            },
            "releaseDate": "2014-09-09",
            "trackCount": 1
        }
    ]
}
```

### 🔗 Integrations

You can connect Apple Music Search Scraper with almost any cloud service or web app through [Apify integrations](https://apify.com/integrations). Connect with **Zapier, n8n, Make, Slack, Google Sheets, Google Drive, Airbyte, GitHub**, and many more.

You can also use [webhooks](https://docs.apify.com/integrations/webhooks) to trigger actions whenever a run finishes — for example, getting a notification or automatically processing the scraped data.

### 🦾 Using the Apify API

The Apify [API](https://docs.apify.com/api/v2) gives you programmatic access to Apple Music Search Scraper. You can start runs, fetch datasets, monitor execution, and integrate the scraper into your own workflows.

- **Python**: Use the [`apify-client`](https://pypi.org/project/apify-client/) PyPI package
- **Node.js**: Use the [`apify-client`](https://www.npmjs.com/package/apify-client) NPM package

### ❓ FAQ

#### Can I search multiple queries in one run?

Yes. The `queries` field accepts an array. Each query is processed sequentially and results are tagged with the `search_query` field.

#### What types can I search?

By default, all types are searched: songs, albums, artists, playlists, music videos, stations, curators, music movies, radio shows, and more.

#### How many results can I get per query?

You can control it with the `limit` field (default: 21, max: 100).

#### Can I use Apify proxy?

Yes. The `proxy` field uses the standard Apify proxy configuration. You can enable `useApifyProxy`, select proxy groups with `apifyProxyGroups`, or set a country with `apifyProxyCountry`. IPs are rotated automatically.

#### Does this require an Apple Music subscription?

No. The search API is publicly accessible without an Apple Music subscription.

#### How does the token work?

The scraper automatically fetches a temporary access token from Apple Music's website, similar to how music.apple.com works in a browser. No manual token setup required.

#### Is it legal to scrape Apple Music?

This scraper only extracts publicly available search data from Apple Music. Ensure you comply with Apple Music's Terms of Service and applicable regulations.

# Actor input Schema

## `queries` (type: `array`):

List of search queries to search on Apple Music.

## `limit` (type: `integer`):

Maximum number of results per query. Default 21.

## `proxy` (type: `object`):

Proxy settings for the actor.

## Actor input object example

```json
{
  "queries": [
    "Taylor Swift",
    "Billie Eilish",
    "Bohemian Rhapsody"
  ],
  "limit": 21,
  "proxy": {
    "useApifyProxy": false
  }
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "queries": [
        "Taylor Swift",
        "Billie Eilish",
        "Bohemian Rhapsody"
    ],
    "limit": 21
};

// Run the Actor and wait for it to finish
const run = await client.actor("headlessagent/applemusic-search-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "queries": [
        "Taylor Swift",
        "Billie Eilish",
        "Bohemian Rhapsody",
    ],
    "limit": 21,
}

# Run the Actor and wait for it to finish
run = client.actor("headlessagent/applemusic-search-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "queries": [
    "Taylor Swift",
    "Billie Eilish",
    "Bohemian Rhapsody"
  ],
  "limit": 21
}' |
apify call headlessagent/applemusic-search-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=headlessagent/applemusic-search-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Apple Music Search Scraper",
        "description": "Search Apple Music for songs, albums, artists, playlists, music videos, and more. Get structured data with artwork URLs in multiple resolutions, track details, ISRC codes, audio traits (Lossless, Atmos), and complete metadata.",
        "version": "1.1",
        "x-build-id": "FD3Qb1QinNb9YiHxF"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/headlessagent~applemusic-search-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-headlessagent-applemusic-search-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/headlessagent~applemusic-search-scraper/runs": {
            "post": {
                "operationId": "runs-sync-headlessagent-applemusic-search-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/headlessagent~applemusic-search-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-headlessagent-applemusic-search-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "queries": {
                        "title": "Search Queries",
                        "type": "array",
                        "description": "List of search queries to search on Apple Music.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "limit": {
                        "title": "Limit",
                        "minimum": 1,
                        "maximum": 100,
                        "type": "integer",
                        "description": "Maximum number of results per query. Default 21."
                    },
                    "proxy": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Proxy settings for the actor.",
                        "default": {
                            "useApifyProxy": false
                        }
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
