Type in your question below and we'll check to see what answers we can find...
Loading article...
Submitting...
If you couldn't find any answers in the previous step then we need to post your question in the community and wait for someone to respond. You'll be notified when that happens.
Simply add some detail to your question and refine the title if needed, choose the relevant category, then post.
Before we can post your question we need you to quickly make an account (or sign in if you already have one).
Don't worry - it's quick and painless! Just click below, and once you're logged in we'll bring you right back here and post your question. We'll remember what you've already typed in so you won't have to do it again.
Operating System
Windows 11
My Question or Issue
I'm trying to get the lyrics to the song by querying https://spclient.wg.spotify.com/color-lyrics/
But I can't, I get the answer that the wrong token, or the client. Can you give me a hint, or give me a code example, I would appreciate it.
Where did you get that URL from? I can't find anything about lyrics in the official Spotify for Developers docs.
This request is sent when you click the 'show text' button on the official Spotify website. If you look at the body of the response, it contains texts and timestamps
According to this news article, the lyrics comes from Musixmatch. Musixmatch has it's own API and documentation.
Pretty easy. First of all, you need a token. I'm not sure if the token from the official API is working, but the one from https://open.spotify.com/get_access_token should be working fine. Now we need a track id and an image for the background (image is optional). The image has to be an url from spotifys servers. As the headers we need the token and the app-platform: WebPlayer. Second one is very important, there's no warning that you would need that.
Now let's put everything together:
URL:
https://spclient.wg.spotify.com/color-lyrics/v2/track/0VjIjW4GlUZAMYd2vXMi3b/image/https%3A%2F%2Fi.scdn.co%2Fimage%2Fab67616d0000b2738863bc11d2aa12b54f5aeb36?format=json&vocalRemoval=false&market=from_token
The image has to be URL-encoded. The params are optional, but you should probably keep the format.
URL without the image:
https://spclient.wg.spotify.com/color-lyrics/v2/track/0VjIjW4GlUZAMYd2vXMi3b?format=json&vocalRemoval=false&market=from_token
Here again as a curl command:
curl -i "https://spclient.wg.spotify.com/color-lyrics/v2/track/0VjIjW4GlUZAMYd2vXMi3b/image/https%3A%2F%2Fi.scdn.co%2Fimage%2Fab67616d0000b2738863bc11d2aa12b54f5aeb36?format=json&vocalRemoval=false&market=from_token " -H "authorization: Bearer your_bearer_token" -H "app-platform: WebPlayer"
The bearer token I get by opening that URL in ny browser works. But if I try to get a token by making a curl request with the same URL, the token I get is much shorter and that token doesn't work.
Oh, that might have been my mistake. Anonymous access apparently doesn't work. When opening the URL in the browser, then it's actually a user token, if you're already logged in. For now, I cannot find another way to retrieve lyrics.
Hey there you, Yeah, you! 😁 Welcome - we're glad you joined the Spotify Community! While you here, let's have a fun game and get…