Select the types of activity you want to include in your feed.
docs: update Apple Music configuration guide
Reorganized the Apple Music documentation to prioritize the Browser Token (Free) authentication method and clarify requirements for the paid MusicKit Key approach.
···29293030#### 2. Authentication
31313232-The Apple Music API requires a Developer Token (JWT). Multi-Scrobbler can either automatically **generate** this JWT for you using an Apple Music API key, or you can manually provide a **pre-generated token**.
3232+To authorize API access, Multi-Scrobbler requires an Authentication Token (JWT). Because the official Apple Music API is designed for developers, there are two ways to provide this token depending on your situation:
3333+3434+* **Browser Token (Free & Most Common):** Best for 99% of users. You can easily extract a temporary token from the Apple Music web player without needing an Apple Developer account.
3535+* **MusicKit Key (Requires Paid Apple Developer Account):** If you happen to be enrolled in the paid Apple Developer Program ($99/year), you can provide a private key to automatically generate permanent tokens.
3636+3737+Choose your preferred method below:
33383439<Tabs groupId="appleMusicAuth" queryString>
3535- <TabItem value="key" label="MusicKit Key (Recommended)">
4040+ <TabItem value="token" label="Browser Token (Free)">
4141+4242+ Since most users don't have a paid developer account, extracting the token from the web player is the standard approach.
4343+4444+ While browsing [music.apple.com](https://music.apple.com) with Developer Tools open, inspect the **Network** tab. Look at the request headers for any request made to `amp-api.music.apple.com`. Copy the `authorization` header value (use everything *after* the `Bearer ` prefix).
4545+4646+ ```json
4747+ {
4848+ "data": {
4949+ "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NiIsIm...",
5050+ "mediaUserToken": "your-media-user-token-here",
5151+ "headers": {
5252+ "Origin": "https://music.apple.com"
5353+ }
5454+ }
5555+ }
5656+ ```
5757+5858+ :::info[Custom Header Required]
5959+ When using a JWT extracted from the browser, Apple requires the request to match the domain it was issued to. You **must** include the `Origin` header in your config as shown above.
6060+ :::
6161+6262+ *Note: Browser-generated JWTs are valid for a maximum of 35 days and must be updated manually when they expire.*
6363+6464+ </TabItem>
6565+ <TabItem value="key" label="MusicKit Key (Paid Account)">
6666+6767+ :::warning[Apple Developer Account Required]
6868+ To generate JWTs automatically, you must be enrolled in the paid [Apple Developer Program](https://developer.apple.com/programs/) ($99/year) and create a MusicKit key. If you don't have an account, use the **Browser Token (Free)** tab instead.
6969+ :::
36703771 To generate JWTs automatically and avoid manual token refreshes, you need an Apple Music API key:
3872···6094 :::
61956296 </TabItem>
6363- <TabItem value="token" label="Pre-generated Token">
6464-6565- If you don't have an Apple Developer account, you can piggyback off the web app's token.
6666-6767- While browsing [music.apple.com](https://music.apple.com) with Developer Tools open, inspect the **Network** tab. Look at the request headers for any request made to `amp-api.music.apple.com`. Copy the `authorization` header value (use everything *after* the `Bearer ` prefix).
6868-6969- ```json
7070- {
7171- "data": {
7272- "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NiIsIm...",
7373- "mediaUserToken": "your-media-user-token-here",
7474- "headers": {
7575- "Origin": "https://music.apple.com"
7676- }
7777- }
7878- }
7979- ```
8080-8181- :::info[Custom Header Required]
8282- When using a JWT extracted from the browser, Apple requires the request to match the domain it was issued to. You **must** include the `Origin` header in your config as shown above.
8383- :::
8484-8585- *Note: Browser-generated JWTs are valid for a maximum of 35 days and must be updated manually when they expire.*
8686-8787- </TabItem>
8897</Tabs>
89989099---
···92101#### How Multi-Scrobbler handles Apple Music quirks
9310294103**Timestamp Estimation**
104104+95105The Apple Music API **does not provide timestamps** for when tracks were played. Multi-Scrobbler estimates play times by taking the current time and subtracting track durations backwards:
96106* The most recent track is assumed to have finished playing **now**.
97107* Each older track is estimated to have played `duration` seconds before the previous one.
981089999-*For the most accurate scrobble timestamps, it is highly recommended to keep the polling `APPLEMUSIC_INTERVAL` low (the default is 60 seconds).*
109109+*For the most accurate scrobble timestamps, it is highly recommended to keep the polling interval (`APPLEMUSIC_INTERVAL`) low (the default is 60 seconds).*
100110101111102112## Configuration Reference
···109119 | `APPLEMUSIC_KEY_ID` | No | | Key ID from your MusicKit key. |
110120 | `APPLEMUSIC_TEAM_ID` | No | | Team ID from your Apple Developer account. |
111121 | `APPLEMUSIC_KEY_P8` | No | | The contents of your MusicKit `.p8` private key file.|
112112- | `APPLEMUSIC_TOKEN` | No | | A pre-generated JWT (alternative to key properties). |
122122+ | `APPLEMUSIC_TOKEN` | No | | The authentication JWT extracted from the browser. |
113123 | `APPLEMUSIC_INTERVAL` | No | `60` | Polling interval in seconds. |
114124 | `APPLEMUSIC_NAME` | No | | A vanity name different than the ID. |
115125</Config>