# Apple Music Details Extractor (`coder_zoro/apple-music-details-extractor`) Actor

Apple Music Extractor - An Apify actor that concurrently searches multiple artists on Apple Music via AWS Lambda API, returning songs, albums, and artist data in organized JSON format.

- **URL**: https://apify.com/coder\_zoro/apple-music-details-extractor.md
- **Developed by:** [Zoro](https://apify.com/coder_zoro) (community)
- **Categories:** Developer tools, Automation
- **Stats:** 1 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$9.99/month + usage

To use this Actor, you pay a monthly rental fee to the developer. The rent is subtracted from your prepaid usage every month after the free trial period.You also pay for the Apify platform usage, which gets cheaper the higher Apify subscription plan you have.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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 Artist Search - Apify Actor

This Apify Actor searches for artist information on Apple Music with flexible filtering options. Add multiple artists and customize the type of results you want.

### Features

- **Multiple Artists**: Add one or multiple artist names (click + to add more)
- **Filter by Type**: Choose what to get - all info, artist details, songs only, or albums only
- **Result Limit**: Control how many results to return (default: 10)
- **Response Format**: Choose between organized or simple format
- **Concurrent Processing**: All searches run simultaneously for maximum speed

### Prerequisites

Before running this actor, you must set the API URL as an environment variable in Apify Console:

### Input Schema

```json
{
  "artistNames": ["Taylor Swift", "The Beatles"],
  "type": "all",
  "limit": 10,
  "format": "organized"
}
```

#### Input Parameters

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| **artistNames** | array of strings | Yes | - | List of artist names to search. Click '+' to add multiple artists. |
| **type** | string | No | `"all"` | Filter results by type: `"all"`, `"artist"`, `"songs"`, or `"albums"` |
| **limit** | integer | No | `10` | Limit number of results (1-100) |
| **format** | string | No | `"organized"` | Response format: `"organized"` or `"simple"` |

#### Filter Type Options

- **all** - Get everything: artist info, songs, and albums
- **artist** - Get only artist information (no songs or albums)
- **songs** - Get only songs from the artist
- **albums** - Get only albums from the artist

#### Response Format Options

- **organized** - Results grouped by type (artist, songs, albums)
- **simple** - Raw results without grouping

### Output

The actor outputs results in two ways:

1. **Dataset**: Each artist search result is pushed to the dataset
2. **OUTPUT Key-Value Store**: Summary with all results

#### Output Structure

Each result in the dataset contains:

```json
{
  "artist": "Taylor Swift",
  "status": "success",
  "status_code": 200,
  "data": {
    "artist_searched": "Taylor Swift",
    "data": {
      "artist": {
        "name": "Taylor Swift",
        "id": "...",
        ...
      },
      "songs": [
        {
          "title": "Anti-Hero",
          "album": "Midnights",
          ...
        }
      ],
      "albums": [
        {
          "title": "Midnights",
          "release_date": "2022",
          ...
        }
      ]
    }
  }
}
```

#### Summary Output (Key-Value Store)

```json
{
  "total_searches": 4,
  "successful": 4,
  "errors": 0,
  "filter_settings": {
    "type": "all",
    "limit": 10,
    "format": "organized"
  },
  "results": [...]
}
```

### Usage Examples

#### Example 1: Single Artist - Get All Information

```json
{
  "artistNames": [
    "Taylor Swift"
  ],
  "type": "all",
  "limit": 10,
  "format": "organized"
}
```

#### Example 2: Multiple Artists - Get All Information

```json
{
  "artistNames": [
    "Taylor Swift",
    "The Beatles",
    "Drake",
    "Adele"
  ],
  "type": "all",
  "limit": 10,
  "format": "organized"
}
```

#### Example 3: Get Only Songs

```json
{
  "artistNames": [
    "Beyoncé",
    "Ed Sheeran",
    "Ariana Grande"
  ],
  "type": "songs",
  "limit": 15,
  "format": "organized"
}
```

#### Example 4: Get Only Albums

```json
{
  "artistNames": [
    "The Weeknd",
    "Coldplay"
  ],
  "type": "albums",
  "limit": 5,
  "format": "organized"
}
```

#### Example 5: Get Only Artist Info

```json
{
  "artistNames": [
    "Bruno Mars",
    "Post Malone",
    "Dua Lipa"
  ],
  "type": "artist",
  "limit": 10,
  "format": "organized"
}
```

#### Example 6: Simple Format Response

```json
{
  "artistNames": [
    "Billie Eilish"
  ],
  "type": "all",
  "limit": 20,
  "format": "simple"
}
```

### How It Works

1. **Add Artist Names**: Enter one or more artist names
2. **Select Filter Type**: Choose what information you want (all, artist, songs, albums)
3. **Set Result Limit**: Decide how many results to get per artist (default: 10)
4. **Choose Format**: Pick organized (grouped) or simple format
5. **Run**: The actor searches all artists concurrently and returns results

### Error Handling

If a search fails, the result will have:

```json
{
  "artist": "Artist Name",
  "status": "error",
  "error": "Error message here"
}
```

Common errors:

- `Missing required environment variable: API_URL` - API URL not set in environment
- `HTTP error: ...` - API request failed
- `Request timeout` - API took too long to respond (>30 seconds)

### Performance

- All searches run concurrently for maximum speed
- Default timeout: 30 seconds per request
- No limit on the number of artists you can search
- Filter settings apply to all artists in the batch

### Setup Instructions

1. **Create the Actor in Apify Console**
2. **Set Environment Variables**:
   - Go to Actor Settings → Environment variables
   - Add `API_URL` with your API endpoint
   - (Optional) Add `API_KEY` if authentication is required
3. **Configure Input**:
   - Add artist names (click + to add more)
   - Select filter type
   - Set result limit (default: 10)
   - Choose response format
4. **Run the Actor**

### API Authentication

If your API requires authentication, the actor will automatically include the API key from the `API_KEY` environment variable in the request headers:

```
Authorization: Bearer YOUR_API_KEY
```

### Local Development

1. Create input file `input.json`:

```json
{
  "artistNames": ["Taylor Swift", "The Beatles"],
  "type": "all",
  "limit": 10,
  "format": "organized"
}
```

2. Run locally:

```bash
apify run
```

### Tips

- Use **type: "songs"** when you only need song information (faster)
- Use **type: "albums"** when you only need album information (faster)
- Use **type: "artist"** when you only need basic artist details (fastest)
- Increase **limit** to get more results per artist
- Use **format: "simple"** if you want raw, ungrouped data

### Support

For issues or questions, please contact support or create an issue in the repository.

# Actor input Schema

## `artistNames` (type: `array`):

Enter artist names to search (one per line)

## `type` (type: `string`):

Filter results by type

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

Maximum number of results per artist

## `format` (type: `string`):

How to organize the response data

## `concurrency` (type: `integer`):

Maximum number of concurrent API requests

## Actor input object example

```json
{
  "artistNames": [
    "Lana Del Rey",
    "Drake",
    "The Beatles"
  ],
  "type": "all",
  "limit": 10,
  "format": "organized",
  "concurrency": 5
}
```

# 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 = {
    "artistNames": [
        "Lana Del Rey",
        "Drake",
        "The Beatles"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("coder_zoro/apple-music-details-extractor").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 = { "artistNames": [
        "Lana Del Rey",
        "Drake",
        "The Beatles",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("coder_zoro/apple-music-details-extractor").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 '{
  "artistNames": [
    "Lana Del Rey",
    "Drake",
    "The Beatles"
  ]
}' |
apify call coder_zoro/apple-music-details-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=coder_zoro/apple-music-details-extractor",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/6XbJAr96579Wc7oNy/builds/Fnf0u4e06L7jkRwWh/openapi.json
