Retrieve metadata from Spotify content using the Spotify Web API.
To run this demo you will need:
- Node.js LTS environment
- Spotify Developer Account
Create a new app in your Spotify Developer Dashboard. This will give you a client ID.
Add a redirect URI to the app settings. This should be the URL of the server you will be running the app on, followed by /callback
. For example, if you are running the app on localhost:5173
, the redirect URI should be http://localhost:5173/callback
.
Clone this repository, ensure that you add VITE_CLIENT_ID
and VITE_REDIRECT_URI
to your .env
file.
Then run the following commands:
npm install
npm run dev
Before running the project, please make sure to add your desired songs to the chart.json
file at the root directory. This file is a JSON file that contains a list of songs that will be used to retrieve the metadata from Spotify.
{
"tracklist": [
{
"name": "Never Gonna Give You Up",
// Other track data here
}
]
}
Each object in the tracklist
array should have a property (e.g. name
) that contains the search query for the song.