Web Service

Apple Music API

Integrate streaming music with Apple Music content.

Overview

The Apple Music API is a web service that lets you access information about the media found in the Apple Music Catalog and the user's personal iCloud Music Library. Here's what each one includes:

  • The Apple Music Catalog includes all resources available in Apple Music.

  • The user's iCloud Music Library contains only those resources that the user added to their personal library. For example, it contains items from Apple Music, songs purchased from iTunes Store, and imports from discs and other apps. This library may include content not found in the Apple Music Catalog.

Use this service to retrieve information about albums, songs, artists, playlists, music videos, Apple Music stations, ratings, charts, recommendations, and the user's most recently played content. With proper authorization from the user, you can also create or modify playlists and apply ratings to the user's content.

Topics

Essentials

Getting Keys and Creating Tokens

Obtain developer tokens and keys needed to make requests to the Apple Music API.

Handling Requests and Responses

Write a request and handle a response from the Apple Music API.

Handling Relationships and Pagination

Fetch related objects as part of your original request and paginate the results from the Apple Music API.

Storefronts and Localization

Pick a country-specific geographic region from which to retrieve catalog information, or retrieve information from the user's personal library.

Common Objects

Understand the base types used to construct the JSON data you receive.

Albums, Artists, Songs, and Videos

Albums

Get an album's name, artist, list of tracks, artwork, release date, and recording information, and add new albums to the user's library.

Artists

Get information about an artist, including the content they created and references to them in playlists and radio stations.

Songs

Get information about a particular song, including the artist who created it and the album on which it appeared.

Music Videos

Get information about a music video, including the artist who created it and the associated album, and add new videos to the user's library.

Playlists and Stations

Playlists

Get the contents of playlists, add new playlists to the user's library, and add tracks to an existing playlist.

Apple Music Stations

Get information about streaming content offered by Apple Music.

Search

Search

Search for albums, songs, artists, and other information in the user's personal library or the Apple Music Catalog.

Ratings and Charts

Ratings

Get and set ratings for albums, songs, playlists, music videos, and stations.

Charts

Get chart information that shows the popularity of albums, songs, and music videos.

Genres, Curators, and Recommendations

Music Genres

Get information about the genres associated with the user's music or with items in the Apple Music Catalog.

Curators

Get information about the person who curated a playlist or station.

Recommendations

Get music recommendations based on the user's library and purchase history.

Activities and History

Activities

Get the activities associated with the Apple Music Catalog.

History

Get historical information about which songs and stations the user played recently.

Endpoints

Get Multiple Library Albums

Fetch one or more library albums by using their identifiers.

Get All Library Albums

Fetch all the library albums in alphabetical order.

Get a Library Album

Fetch a library album by using its identifier.

Get a Library Album's Relationship Directly by Name

Fetch a library album's relationship by using its identifier.

See Also