# Apple 🍎 Music Extractor (`jupri/apple-music`) Actor

💫 All-In-One Apple Music Scraper

- **URL**: https://apify.com/jupri/apple-music.md
- **Developed by:** [cat](https://apify.com/jupri) (community)
- **Categories:** Videos, Social media
- **Stats:** 303 total users, 4 monthly users, 36.3% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$5.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

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

## 💫 Welcome To Apple Music Scraper

<img height="32" src="https://apify.com/actor-badge?actor=jupri~apple-music" align="right">

![dont be sad readme is here](https://raw.githubusercontent.com/JupriGH/resources/main/cats/catframe.png)

### 🎵 About Apple Music

<img width="40%" align="right" src="https://upload.wikimedia.org/wikipedia/commons/9/9d/AppleMusic_2019.svg">

**Apple Music** is an audio and video [streaming](https://en.wikipedia.org/wiki/Streaming_media "Streaming media") service developed by [Apple Inc.](https://en.wikipedia.org/wiki/Apple_Inc. "Apple Inc.") Users select music to stream to their device on-demand, or they can listen to existing [playlists](https://en.wikipedia.org/wiki/Playlist "Playlist"). The service also includes the sister [internet radio](https://en.wikipedia.org/wiki/Internet_radio "Internet radio") stations [Apple Music 1](https://en.wikipedia.org/wiki/Apple_Music_1 "Apple Music 1"), Apple Music Hits, and Apple Music Country, which are [broadcast](https://en.wikipedia.org/wiki/Broadcasting "Broadcasting") live to over 200 countries 24 hours a day. The service was announced on June  8, 2015, and launched on June  30, 2015. New subscribers get a one-month free or six months free trial with the purchase of select products before the service requires a monthly subscription.

### About This Scraper

💫 **All-In-One Apple Music Scraper**

### 🎵 Tutorial

#### 🎧 Parameters

| Input| Type |  Description |
|-|-|-|
| `query` | ***string array*** | List of `QUERY`, `KEYWORD` or `URL` |
| `limit` | ***integer*** | Number of results (`per-query`) |

#### 🎧 Basic Usage

***Search for songs (tracks)***

```yaml
{ "query": ["Nightwish"], "search_type": "song", "limit": 10 } 
```

or

```yaml
{ "query": ["song:Nightwish"], "limit": 10 } 
```

***Get song (track) info***

```yaml
{ "query": ["song:1458860453"] } 
```

or

```yaml
{ "query": ["https://music.apple.com/us/album/amaranth-remastered/1458860429?i=1458860453"] } 
```

***Search for albums***

```yaml
{ "query": ["Highest hopes"], "search_type": "album", "limit": 10 } 
```

or

```yaml
{ "query": ["album:Highest hopes"], "limit": 10 } 
```

#### 🎧 Advanced Usage

***APPLE Query Language (AQL)***

```html
[ <COMMAND:> | # | @ ] [ <NAME> | <ID> | <KEYWORD> | <URL> ] [ /<SECTION> ] 
```

***Possible QUERY  values***

| Format | Example | Description |
|-|-|-|
| **<*KEYWORDS*>** | `square pants` | ***Search Anything*** |
| `song:<KEYWORDS>` | `song:oemar bakri` | Search for songs (default) |
| `artist:<KEYWORDS>` | `artist:iwan fals` | Search for artists |
| `album:<KEYWORDS>` | `album:sarjana muda` | Search for albums |
| `playlist:<KEYWORDS>` | `playlist:top pop` | Search for playlists |
| `radio:<KEYWORDS>` | `radio:comedy` | Search for radio/shows |
| `episode:<KEYWORDS>` | `episode:news` | Search for episodes |
| `station:<KEYWORDS>` | `station:comedy` | Search for stations |
| `video:<KEYWORDS>` | `video:gun n roses` | Search for music videos |
| `extra:<KEYWORDS>` | `extra:bon jovi` | Search for extra-videos (posts) |
| `label:<KEYWORDS>` | `label:music` | Search for labels |
| **song:<*SONG\_ID*>** | `song:1458860453` | ***Song (Track) Data***
| `/info` | `song:1458860453/info` | Song info |
| `/credits` | `song:1458860453/credits` | Credits list |
| `/albums` | `song:1458860453/albums` | Album list
| `/artists` | `song:1458860453/artists` | Artists list
| `/videos` | `song:1458860453/videos` | Music videos
| **video:<*VIDEO\_ID*>** | `video:266626695` | ***Music Video Data***
| `/info` | `video:266626695/info` | Video info
| `/artists` | `video:266626695/artists` | Artists list
| `/related` | `video:266626695/related` | Other similar videos
| **album:<*ALBUM\_ID*>** | `album:1458860429` | ***Album Data***
| `/info` | `album:1458860429/info` | Album info
| `/tracks` | `album:1458860429/tracks` | Song (Track) list
| **artist:<*ARTIST\_ID*>** | `artist:126609479` | ***Artist Data***
| `/info` | `artist:126609479/info` | Artist info |
| `/albums` | `artist:126609479/albums` | Artist albums |
| `/playlists` | `artist:126609479/playlists` | Artist playlists |
| `/singles` | `artist:126609479/singles` | Artist singles |
| `/compilations` | `artist:126609479/compilations` | Compilations |
| `/videos` | `artist:126609479/videos` | Video musics |
| `/top-songs` | `artist:126609479/top-songs` | Top songs |
| `/appears` | `artist:126609479/appears` | Artist appearances |
| `/lives` | `artist:126609479/lives` | Live albums |
| `/similars` | `artist:126609479/similar` | Similar artists |
| **radio:<*RADIO\_ID*>** | `radio:1496850261` | ***Radio (Curator) Data***
| **label:<*LABEL\_ID*>** | `label:1556907688` | ***Record Label Data***
| `/info` | `label:1556907688/info` |
| `/top-releases` | `label:1556907688/top-releases` |
| `/new-releases` | `label:1556907688/new-releases` |
| `/featured` | `label:1556907688/featured` |
| **room:<*ROOM\_ID*>** | `room:6503108878` | ***Room Data***
| `/info` | `room:6503108878/info` |
| `/content` | `room:6503108878/content` |
| **<*PLAYLIST\_ID*>** | `pl.b1598359b09d495d9a5a373c788ecea9` | ***Playlist Data***
| `/info` |
| `/tracks` |
| **<*STATION\_ID*>** | `ra.1460912634` | ***Station Data***
| **https:<*URL*>** | `https://music.apple.com/...` | ***Start URL*** |

### 🎵 Input Examples

<img width="240" src="https://www.healthprochiro.com/wp-content/uploads/2022/09/under-const.jpg">

### 🎵 Output Samples

<img width="240" src="https://www.healthprochiro.com/wp-content/uploads/2022/09/under-const.jpg">

### 🍎 Support

⚡️ Feel free to [reach out](https://console.apify.com/actors/Mk8kSRFSXNMhxTtK6/issues) to the developer for any issues or suggestions for improvement.

<img src="https://apify-uploads-prod.s3.us-east-1.amazonaws.com/5SxZhwYwpknFk8ek9-cat.gif" width="240">

# Actor input Schema

## `query` (type: `array`):

💡 Search Terms, Query, or Start URL(s)

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

💡 Number of results

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

No description

## `dev_proxy_config` (type: `object`):

💡 <b>Supported protocol:</b><br><br><b>HTTP(S), SOCKS5</b><br><code>{http|socks5}://{user:pass}@{hostname|ip-address}:port</code><br><br><b>Example</b>: <code>socks5://example.com:9000</code>

## `dev_custom_headers` (type: `array`):

💡 Additional HTTP Headers

## `dev_custom_cookies` (type: `array`):

💡 Additional HTTP Cookies

## `dev_transform_fields` (type: `array`):

💡 <b>Transform the resulting output. Select only needed fields.</b><br><br>For nested object use <b>DOT</b>. For example: <pre>address.streetAddress</pre><br>For nested array use <b>NUMBER</b> <i>(index of array element starting from index=0)</i>. For example: <pre>images.0.url</pre>

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

💡 <b>Save results into custom named Dataset, use mask to customize dataset name</b><br><br><code>{ACTOR} = actor name<br>{DATE} = date (YYYYMMDD)<br>{TIME} = time (HHMMSS)</code><br><br>This masks can be used to autogenerate Dataset Name.<br><br>example: <i><code>data-{DATE}</code></i><br>Depending on today date the dataset name will be: <code>data-20230603</code><i><br><br>default: <code>data-{ACTOR}-{DATE}-{TIME}</code></i>

## `dev_dataset_clear` (type: `boolean`):

Clear Dataset before insert/update.

## `dev_no_strip` (type: `boolean`):

💡 Keep/Save empty values <i><code>(NULL, FALSE, empty ARRAY, empty OBJECT, empty STRING)</code></i>

## Actor input object example

```json
{
  "query": [
    "Lana Del Rey"
  ],
  "limit": 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 = {
    "query": [
        "Lana Del Rey"
    ],
    "limit": 5
};

// Run the Actor and wait for it to finish
const run = await client.actor("jupri/apple-music").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 = {
    "query": ["Lana Del Rey"],
    "limit": 5,
}

# Run the Actor and wait for it to finish
run = client.actor("jupri/apple-music").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "query": [
    "Lana Del Rey"
  ],
  "limit": 5
}' |
apify call jupri/apple-music --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,jupri/apple-music"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/Mk8kSRFSXNMhxTtK6/builds/cwxFW4SloIzUaIURv/openapi.json
