Skip to content

Paxsenix0/Spotify-Lyrics-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spotify Lyrics API

Unofficial API to fetch Spotify Lyrics data.

Warning

This project uses undocumented endpoints and may violate Spotify's Terms of Service. Use at your own risk.


Features

  • Retrieve Lyrics data by track ID or URI
  • Parses responses from the internal Spotify API by 2 format into lrc or srt.
  • Works with public or private tracks (as long as you're authenticated)

Example Request

GET /api/lyrics

https://localhost:3000/api/lyrics?url=https://open.spotify.com/track/4Q0qVhFQa7j6jRKzo3HDmP&format=lrc

Response:

{
  "syncType": "LINE_SYNCED",
  "lines": [
    {
      "timeTag": "00:00.48",
      "words": "You're glowing, you colour and fracture the light"
    },
    {
      "timeTag": "00:06.51",
      "words": "You can't help but shine"
    },
    ....
  ]
}

Setup

1. Clone the Repo

git clone https://github.com/Paxsenix0/Spotify-Lyrics-API.git
cd Spotify-Lyrics-API

2. Install Dependencies

npm install

3. Set Required Environment Variable

You must supply your sp_dc cookie from a logged-in Spotify session.

Create a .env file in the root:

SP_DC=your_sp_dc_cookie_here

This cookie is used to generate an access token to authenticate requests.


Deployment

You can deploy instantly with Vercel:

Deploy with Vercel


Notes

I'm developing this project entirely on my phone, without a PC or laptop. Also, I'm still learning — so feel free to send pull requests or suggestions if something looks off!


Reference

Shoutout to this helpful repo that inspired parts of this: https://github.com/akashrchandran/spotify-lyrics-api


License

This project is licensed under the MIT license. see LICENSE for details.


Contact

Telegram: @paxsenix0

Email: alex24dzn@proton.me

My Rest-API website: https://api.paxsenix.biz.id