···13131414Because of how the Apple Music API works, Multi-Scrobbler (MS) requires two different tokens to function: a **Media User Token** (identifies your personal account) and an **Authentication Token** (authorizes API access).
15151616-#### 1. Getting a Media User Token
1616+### 1. Getting a Media User Token
17171818The `mediaUserToken` is required to access your recently played history. You can extract it directly from the Apple Music web app:
1919···2727The `mediaUserToken` will eventually expire. If Multi-Scrobbler begins throwing authentication errors in the logs, simply repeat these steps to obtain and configure a fresh token.
2828:::
29293030-#### 2. Authentication
3030+### 2. Authentication
31313232To 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···98989999---
100100101101-#### How Multi-Scrobbler handles Apple Music quirks
101101+### How Multi-Scrobbler handles Apple Music quirks
102102103103-**Timestamp Estimation**
103103+#### Timestamp Estimation
104104105105The 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:
106106* The most recent track is assumed to have finished playing **now**.
···108108109109*For the most accurate scrobble timestamps, it is highly recommended to keep the polling interval (`APPLEMUSIC_INTERVAL`) low (the default is 60 seconds).*
110110111111-**Duplicate Play Recovery**
111111+#### Duplicate Play Recovery
112112113113The Apple Music history API strictly deduplicates tracks. Instead of showing the same song multiple times in a row, it simply bumps the re-played track back to the #1 spot and removes the older entry.
114114