Contents

MusicKit

Integrate your app with Apple Music.

Overview

Use MusicKit to integrate your app with Apple Music API, a web service you use to access information about music items in the Apple Music catalog. Using MusicKit, you can more easily build apps that tie into Apple Music.

The framework provides a model layer for accessing music items in Swift, as well as playback support so you can add music to your app. Additionally, it provides some related user interface elements, such as a view to display images that correspond to artwork for a music item, or a way to present music subscription offers to users who may not have an active Apple Music subscription.

Request permission for your app to use MusicKit with MusicAuthorization. Check specific capabilities for the current MusicSubscription to ensure your music-related functionality is available to the user. Find music items using a search term with MusicCatalogSearchRequest, or find music items using a filter with MusicCatalogResourceRequest. Play music in your app with one of the two music players that MusicKit offers. Allow the user to begin a free trial for Apple Music from within your app by presenting a music subscription offer.

You can load content from an arbitrary Apple Music API endpoint with MusicDataRequest to take further advantage of additional functionality available in Apple Music API.

Topics

Essentials

Music Items

Music Item Attributes

Catalog Search

Resource Loading Using Filters

General Purpose Data Request

Playback

Artwork

Authorization

Apple Music Subscription

Token management

Utility

Classes

Protocols

Structures

Type Aliases

Enumerations

See Also

Related Documentation