Skip to content

AmreshSinha/Spotify-Cards-API

Repository files navigation

An unofficial open-source Spotify PromoCards API built to serve Song Cards. For more information on using this API, see Docs

Table of contents

Usage

By Song Track Name*

*Results can differ as there can be another song with the Same Name

https://spotify-cards.fossian.com/api?name={song name}&color={color hex without #}

Example

https://spotify-cards.fossian.com/api?name=Silver%20Lining&color=A0C3D2

By Song Track ID {Recommended}

https://spotify-cards.fossian.com/api?id={song id}&color={color hex without #}

Example

https://spotify-cards.fossian.com/api?id=05iALOptaNoV3EmXnxz1IJ&color=A0C3D2

Orientation

Landscape{Default} or Square

Example

https://spotify-cards.fossian.com/api?id={song id}&color={color hex without #}&orientation={landscape/square}

How to get Spotify Song Track ID?

  • Go to your song
  • Right Click >> Share (Keep Ctrl Pressed) >> Copy Spotify URI
  • The ID after spotify: is the Spotify Song Track ID

Support

To log any issue or help with any issue, check out Issues Section.

Release Versions

  • 1.0.0: Supports only Song Tracks. It can take input from the user as name or id only currently.

Host Your Own

See HOSTING for instructions on how to host your own service

Run Locally

  1. Clone the Repository
git clone https://github.com/AmreshSinha/Spotify-Cards-API.git
  1. Get into the project folder and install node modules
npm i
  1. Go to Spotify Developer Dashboard and Create a New Application with no scopes Make a .env and add
  • Client_ID var with your Spotify Dev Application Details
  • Client_Secret var with your Spotify Dev Application Details
  1. Start and Run the Project
npm start

The server will start on port 3000

Contributing

Help Needed

  • Text Wrap: If the Song Name is too long, the text size should decrease and wrap into 2 lines. Spacing between "SONG" and Song Name, and Song Name and Artist name should change accordingly. (Partial Support, Optimization needed)
  • Theme Color Extraction from the image instead of Black as the Default Color. Done Thanks to @delivey
  • Adding Portrait Orientation. Done Thanks to @delivey

All the Issues are in ISSUES section.

Also, before making a PR checkout Code of Conduct

License

Spotify Cards API is available under the MIT license. Spotify Cards API also includes external libraries that are available under a variety of licenses. See LICENSE for the full license text.