This API overrides the Spotify API endpoint used in the Spotify mobile app to fetch lyrics for the currently playing song.
You can use this API in xManager to fetch lyrics without having a Spotify Premium account.
-
The Spotify mobile app sends a request to the Mobile Spotify API to get the lyrics for the currently playing song.
-
The official Mobile Spotify API endpoint is overridden in the app code to point to the modified API.
-
The modified API fetches the lyrics from the WEB API of Spotify, which doesn't require a Premium account.
-
The lyrics are returned in the correct format (Protobuf) to the Spotify mobile app.
-
The mobile app displays the lyrics.
Note
The latest versions of xManager already have the lyrics patch applied.
If you have an older version or want to use a different server, you can patch it manually.
Go to the releases page and download the latest release of Spotify patched with xManager and the Spotify Mobile Lyrics API.
The script patch:xmanager
will automatically download the latest release of xManager and apply the lyrics patch.
npm run patch:xmanager -- --server "lyrics.natanchiodi.fr" --apk "Spotify v8.9.84.594 [xManager] (Merged).apk" --ks-file "keystore.jks" --ks-pass "******"
Script arguments:
--server
the lyrics API host (see Public servers list).--apk
the path to the Spotify APK. If not provided, the script will download the latest release (user input required).--ks-file
(optional) the path to the keystore file.--ks-pass
(optional) the keystore password.
If no keystore is provided, the script will sign the APK with your username.
Server name | Host | Owner |
---|---|---|
Default | lyrics.natanchiodi.fr |
Natan Chiodi |
Team xManager | xmanager-lyrics.dev |
xC3FFF0E |
- | - | - |
➕ Add your server | See Adding a public server |
You can run the API in a Docker container.
The container will expose the API on port 3000. You can change the port by changing the -p
argument.
Environment variables:
SP_DC
thesp_dc
cookie value from the Spotify Web Player (see Finding sp_dc).SSL_CERT
(optional) the SSL certificate string.SSL_KEY
(optional) the SSL key string.
You can also mount a volume to /usr/src/app/certs
to provide the SSL certificate and key (cert.pem
and private.key
).
- Pull the image:
docker pull ghcr.io/natoune/spotify-mobile-lyrics-api:latest
- Run the container:
docker run -d -p 443:3000 -e SP_DC=spotify-cookie -v /path/to/certs:/usr/src/app/certs ghcr.io/natoune/spotify-mobile-lyrics-api:latest
Warning
The Free plan of Vercel is rate-limited (see Limits).
It should be enough for personal use, but consider upgrading to a paid plan or using another provider if you need more requests.
You can deploy the API to Vercel with the following steps:
- Click the "Deploy with Vercel" button.
- Set the
SP_DC
environment variable to thesp_dc
cookie value from the Spotify Web Player (see Finding sp_dc). - Set up the redis integration.
- Deploy the API.
You can deploy the API to Cloudflare Workers with the following steps:
- Install the Wrangler CLI.
- Clone the repository:
git clone https://github.com/Natoune/SpotifyMobileLyricsAPI.git
cd SpotifyMobileLyricsAPI
- Install the dependencies:
npm install
- Copy the
wrangler.example.toml
file towrangler.toml
:
cp wrangler.example.toml wrangler.toml
- Create a new KV namespace and add it to the
wrangler.toml
file:
npx wrangler kv namespace create sp_redis
wrangler.toml:
...
[[kv_namespaces]]
binding = "sp_redis"
id = "YOUR_KV_ID"
- Add an
SP_DC
secret
Get the sp_dc
cookie value from the Spotify Web Player (see Finding sp_dc) and set it as a secret:
npx wrangler secret put SP_DC
- Deploy the API:
npx wrangler deploy
You can run the API on your own server with Node.js or Bun.
- Clone the repository:
git clone https://github.com/Natoune/SpotifyMobileLyricsAPI.git
cd SpotifyMobileLyricsAPI
- Install the dependencies:
npm install
or
bun install
- Set the environment variables:
.env:
# The API must be available over HTTPS on port 443.
# Change this value only if you are behind a reverse proxy.
PORT=443
# Find a detailed guide on how to get your Spotify SP_DC cookie here: https://github.com/akashrchandran/syrics/wiki/Finding-sp_dc
SP_DC=your-spotify-cookie
- Set up SSL [REQUIRED]
You have multiple options to set up SSL:
- Use a reverse proxy like Nginx or Caddy.
- Use a service like Cloudflare.
- Use a certificate
- Place the certificate and key at
certs/private.key
andcerts/cert.pem
.
- Place the certificate and key at
- Build and start the API:
npm run build
npm start
or
bun build
bun start
- Natan Chiodi - Creator
If you want to contribute, please see the CONTRIBUTING.md file.
This project is licensed under the MIT License - see the LICENSE.md file for details.