Download the PHP package akashrchandran/spotify-lyrics-api without Composer

On this page you can find all versions of the php package akashrchandran/spotify-lyrics-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package spotify-lyrics-api

![spotify-lyrics-api](https://github.com/akashrchandran/spotify-lyrics-api/assets/78685510/12000a6d-ee53-41c4-9c69-98bc2559c5ed)

A Rest API for fetching lyrics from Spotify which is powered by Musixmatch. Commandline version is available [akashrchandran/syrics](https://github.com/akashrchandran/syrics).

[!WARNING] This project is probably against Spotify TOS. Use at your own risks.

[!NOTE] Changed this project into a template repository, deploy your own version. If you need help, don't hesitate to open an issue.

Install using Composer

Fetching Lyrics

For now it only supports track id or link.

Using GET Requests

You have to use query paramters to send data

Available Parameters:

Parameter Default value Type Description
trackid None String The trackid from spotify.
url None String The url of the track from spotify.
format "id3" String The format of lyrics required. It has 2 options either id3 or lrc.

You must specify either trackid or url, otherwise it will retuen error.

Examples

Using trackid

Using url

response:

Changing format to lrc

response:

Responses

Different Responses given out by the API, are listed here.

If any error occurs the value of the error key will be set to true else false

Most of the lyrics are time synced or have timetags and some aren't time synced or have timetags. To differentiate between synced and unsynced we have key syncType.

Musixmatch supports Line synced and Word synced type of timed lyrics. Line Synced is the timetag is given till which the line is sang and the word synced lyrics time specifed when the word comes up in the song. For now Spotify only supports line synced. Maybe they would support word synced in the future :/.

LINE Synced

NOT Synced or Unsynced

Note the timeTags is set to 00:00.00.

Error Messages

When trackid and url both are not given (400 Bad Request)

error response:

When no lyrics found on spotify for given track (404 Not Found)

error response:

Using as package

Install using composer require akashrchandran/spotify-lyrics-api.

Include the package's autoloader file in your PHP code and call class Spotify().

image

Deployment

Want to host your own version of this API, But first you need SP_DC cookie from spotify

__Finding SP_DC__

You will find the detailed guide here.

Heroku

Deploy

Vercel

Deploy with Vercel

Run locally

use git to clone the repo to your local machine or you can download the latest zip file and extract it.

You need to have PHP installed on you machine to run this program.

Enter into the folder via terminal

__Set SP_DC token as environment variable temprorily__

Start the server

now open your browser and type localhost:8080 and you should see the program running.

Credits

Me -> For everything.


All versions of spotify-lyrics-api with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package akashrchandran/spotify-lyrics-api contains the following files

Loading the files please wait ....