Web Service

Apple Music API

Integrate streaming music with Apple Music content.

Overview

The Apple Music API is the web services portion of MusicKit. Using the Apple Music API, you can access information about media—such as albums, songs, artists, and playlists—in the Apple Music Catalog and in a user’s personal iCloud Music Library. If authorized by a user, you can also access or modify data associated with that user. For example, you can find music recommendations for the user or change their rating of a particular song, both in the catalog and in their library.

Topics

First Steps

About the Apple Music API

Learn how Apple Music data is handled using this API.

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.

Using Storefronts and Localizations

Get storefront and localization information for the Apple Music catalog.

Handling Relationships and Pagination

Fetch relationships and paginate response results from the Apple Music API.

Storefronts

Get a Storefront

Fetch a single storefront by using its identifier.

Get Multiple Storefronts

Fetch one or more storefronts by using their identifiers.

Get All Storefronts

Fetch all the storefronts in alphabetical order.

Get a User's Storefront

Fetch a user’s storefront.

Resource Data

Catalog Resources

Get resources from the Apple Music catalog.

Library Resources

Get resources from a user's iCloud Music Library.

Search

Search for Catalog Resources

Search the catalog by using a query.

Search for Library Resources

Search the library by using a query.

Get Catalog Search Hints

Fetch the search term results for a hint.

Charts

Get Catalog Charts

Fetch one or more charts from the Apple Music Catalog.

Recent History

Get Heavy Rotation Content

Fetch the resources in heavy rotation for the user.

Get Recently Played Resources

Fetch the recently played resources for the user.

Get Recently Played Stations

Fetch recently played radio stations for the user.

Get Recently Added Resources

Fetch the resources recently added to the library.

iCloud Music Library and Library Playlists

Add a Resource to a Library

Add a catalog resource to a user’s iCloud Music Library.

Create a New Library Playlist

Create a new playlist in a user’s library.

Add Tracks to a Library Playlist

Add new tracks to the end of a library playlist.

Recommendations

Get a Recommendation

Fetch a recommendation by using its identifier.

Get Multiple Recommendations

Fetch one or more recommendations by using their identifiers.

Ratings

Catalog Ratings

Get, add, and delete ratings for resources in the Apple Music catalog.

Library Ratings

Get, add, and delete ratings for resources in a user's iCloud Music Library.

Object Models

Apple Music API Objects

Object models for requests, responses, and resources in the Apple Music API.

See Also