- Docs
- Connect your users
Set up Apple Music
What you need from Apple
A paid Apple Developer Program membership, then:
| Apple value | Where you find it | MusicAPI field |
|---|---|---|
| Team ID | developer.apple.com/account, membership details | Team ID |
Key ID and private key (.p8) | Certificates, Identifiers & Profiles → Keys. Create a media identifier and private key. | Key ID, Private Key |
| Services ID | Identifiers → Services IDs. Register a Services ID. | Client ID |
The key must have both Media Services (MusicKit) and Sign in with Apple turned on. A key without both fails with {"message": "Invalid token specified"}.
Return URL and domains
On the Services ID, configure Sign in with Apple:
- Domains and subdomains:
api.musicapi.comandapp.musicapi.com - Return URL:
https://api.musicapi.com/callback/apple_sign_in
How the Apple sign-in works
The user signs in with Apple, then MusicKit asks for access to their library. MusicAPI signs the developer token with your private key, stores the MusicKit user token, and handles the storefront and the library-versus-catalog ids for you. Apple Music has no OAuth scopes to pick.
Add it to MusicAPI
- Open Integrations in the dashboard and pick Apple Music.
- Paste the Team ID, the Key ID, the Client ID (Services ID) and the private key, and save.
- Turn Is Enabled on.
- Press Test Apple Music and sign in once with your own Apple account.
Quirks
Apple's API allows less than most services. With Apple Music you cannot:
- rename or re-describe a playlist, or delete one;
- remove or reorder tracks in a playlist, or remove liked tracks;
- remove a saved album, or follow and unfollow artists.
Creating playlists, adding tracks, liking tracks and saving albums work. The email comes from the Sign in with Apple id token of each sign-in; an account that signed in before has it after its next sign-in. At most 25 items per page (limitParam). Tracks carry an ISRC, and the user search takes one.
Direct sign-in link
https://app.musicapi.com/{slug}/appleMusic/auth?returnUrl={returnUrl}