An open API service indexing awesome lists of open source software.

https://github.com/bluh7/spotify-music-lyrics-scraper-api

Nodejs API that will scrape music lyrics from Spotify with puppeteer for free
https://github.com/bluh7/spotify-music-lyrics-scraper-api

api lyrics puppeteer spotify webscraping

Last synced: about 2 months ago
JSON representation

Nodejs API that will scrape music lyrics from Spotify with puppeteer for free

Awesome Lists containing this project

README

        

# Spotify Music Lyrics Scraper API

Nodejs API that will use puppeteer to scrape music lyrics from Spotify for free

PS: In a recent change made by Spotify, lyrics are now only available with a premium subscription

## Requirements

Google Chrome,

Client id and client secret from spotify application that you can get here: https://developer.spotify.com/dashboard,

Spotify cookies from any account in json format that you can get using this extension: https://chrome.google.com/webstore/detail/nmckokihipjgplolmcmjakknndddifde

## Endpoints

#### `GET /lyrics`
This endpoint will return lyrics from the track that you want in an array

#### Params

`trackid`: The track id that you can get from spotify website or from searching through `GET /search`

#### Usage example

```
GET /lyrics?trackid=2RBcYkonAofm0rYycVrCGt
```

#### `GET /search`
This endpoint will use the official Spotify API to make a search.

#### Params

`query`: Your search query.

`type`: The type of item you want to search across. Allowed values: "album", "artist", "playlist", "track", "show", "episode" and "audiobook".

`limit`: The maximum number of results to return in a range from 0 to 50.

`market`: (optional) An ISO 3166-1 alpha-2 country code. If a country code is specified, only content that is available in that market will be returned.

#### Usage example

```
GET /search?query=Midnight Healing&type=track&limit=2&market=US
```

#### `GET /track`
This endpoint will use the official Spotify API to get information from a specific song

#### Params

`id`: The track id that you can get from spotify website or from searching through `GET /search`

`market`: (optional) An ISO 3166-1 alpha-2 country code. If a country code is specified, only content that is available in that market will be returned.

#### Usage example

```
GET /track?id=2RBcYkonAofm0rYycVrCGt
```

#### `POST /token`
This endpoint will get a new token from the official Spotify API

#### Request body

`"secret": "Your environment secret"`

#### Usage example

```
POST /token

{
"secret": "*********"
}
```

## Photo as example from Daft Punk Giorgio by Moroder

![Example](https://github.com/Bluh7/spotify-lyrics-scraper/assets/94490806/f593d178-aade-4bed-a5b0-54a63b304484)