Apple Music API Python Client

Extract Apple Music data with our Apple Music API Python client. Get programmatic access to playlist content, search results, artist data, album details, song information, and more using simple Python code. Start free, no credit card required.

Trusted by industry leaders all over the world

Integrate our Apple Music API

The Apify API client for Python is the official library that allows you to use Apple Music API in Python, providing convenience functions and automatic retries on errors. Get started with simple pip installation and robust error handling built-in.

Python

Python

JavaScript

JavaScript

HTTP

HTTP

MCP

MCP

1from apify_client import ApifyClient
2
3# Initialize the ApifyClient with your Apify API token
4# Replace '<YOUR_API_TOKEN>' with your token.
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7# Prepare the Actor input
8run_input = {
9 "query": ["Lana Del Rey"],
10 "limit": 5,
11}
12
13# Run the Actor and wait for it to finish
14run = client.actor("jupri/apple-music").call(run_input=run_input)
15
16# Fetch and print Actor results from the run's dataset (if there are any)
17print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
18for item in client.dataset(run["defaultDatasetId"]).iterate_items():
19 print(item)
20
21# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

Get data with Apple Music API Python client

Use our Python API client to extract Apple Music data by providing search queries, keywords, or URLs as inputs. The API returns structured data, including artist profiles, song metadata, album information, playlists, and detailed music content.

Input

{
"urls": [
"<https://music.apple.com/cn/album/toxic-till-the-end/1771105914?i=1771105929>"
]
}

Output

[
{
"album": "rosie",
"artist": "ROSÉ",
"trackName": "toxic till the end",
"downloadedAt": "2024-12-06T05:37:57.137Z",
"appleMusicUrl": "<https://music.apple.com/cn/album/toxic-till-the-end/1771105914?i=1771105929>",
"storedFileUrl": "<https://api.apify.com/v2/key-value-stores/1QNnsfyyiRvaWgZkx/records/ROS_-toxic_till_the_end.mp3>"
}
]

How to use Apple Music API

Sign up for Apify account01

Creating an account is quick and free — no credit card required. Your account gives you access to more than 5,000 scrapers and APIs.

Get started for free
Install Apify Python client02

Install the Apify Python client using pip: pip install apify-client. This package provides a simple interface to interact with Apple Music API from your Python applications.

Get your Apify API token03

Go to settings in the Apify console and navigate to the “API & Integrations” tab. There, create a new token and save it for later.

Integrate Apple Music API04

Navigate to the Apple Music API page and click on the API dropdown menu in the top right corner. In the dropdown menu, you can see API clients, API endpoints, and more. Use the provided Python code examples to integrate Apple Music API into your Python application.

Open Apple Music Python API
Get your Apple Music data via API05

The Apple Music API returns structured JSON data that works perfectly with pandas, NumPy, and other Python data analysis libraries.

Why use Apify?

Never get blocked

Every plan (free included) comes with Apify Proxy, which is great for avoiding blocking and giving you access to geo-specific content.

Customers love us

We truly care about the satisfaction of our users and thanks to that we're one of the best-rated data extraction platforms on both G2 and Capterra.

Monitor your runs

With our latest monitoring features, you always have immediate access to valuable insights on the status of your web scraping tasks.

Export to various formats

Your datasets can be exported to any format that suits your data workflow, including Excel, CSV, JSON, XML, HTML table, JSONL, and RSS.

Integrate Apify to your workflow

You can integrate your Apify runs with platforms such as Zapier, Make, Keboola, Google Drive, or GitHub. Connect with practically any cloud service or web app.

Large developer community

Apify is built by developers, so you'll be in good hands if you have any technical questions. Our Discord server is always here to help!

Frequently asked questions

Apple Music does not provide an official Python API client for general use. However, this Apify Actor serves as an unofficial Python API client for Apple Music that allows you to extract publicly available data from the platform. The Actor can search for songs, artists, albums, playlists, and other music content using keywords or direct URLs, providing structured data output that functions similarly to an official Python API client.

Yes, you can try the Apple Music Python API client for free! Apify offers free credits for new users to test the Actor. Simply sign up for an Apify account and you'll receive starter credits to run the Python API client and see the results. After using your free credits, the pricing is $5.00 per 1,000 results extracted.

The Python Apple Music API client can retrieve comprehensive music data including artist information with profiles and top songs, song details with metadata, album information and track listings, playlists and their contents, music videos, radio shows and episodes, record labels, and search results across all categories. The client supports advanced querying using Apple Query Language (AQL) for precise data extraction.

Getting started with our Apple Music Python API is easy — simply create a free Apify account, get your API token, and start using the Apple Music API in Python, JavaScript, CLI, cURL, OpenAPI, or MCP.

Get started with Apple Music API Python client today

Get your first Apple Music data in Python in less than 5 minutes. No credit card required. No commitment. Cancel anytime.