Written by Arielle Vaniderstine
A basic Node app that integrates with the Spotify API. Explore different endpoints the API has to offer!
This app uses the Client Credentials Flow for authentication, which means you can only get non-user-specific data.
-
After registering your app at developer.spotify.com/dashboard, put your app's client ID and secret (which you can find in the Dashboard) into the
.env
file. -
Click on "Show Live" in Glitch and verify that your app works (you should see data in each of the coloured sections).
- Navigate between files in Glitch's left panel.
- See server logs by clicking "Status" at the top of the left panel.
- Open the browser's Developer Tools by right-clicking and selecting Inspect.
- Calls to the Spotify API live in server.js.
- Calls to your own server and the rendering of the UI occur in public/client.js.
-
Change the song that shows up. (Hint: look in server.js for the API call)
-
Display the artist name in addition to the song name. (Hint: look at the whole track object to find the artist name)
-
Make the title link to the song on Spotify. (Hint: look at the whole track object to find the song URL)
-
Get the playlists for a different category! You can find other categories here
-
Show 10 playlists instead of 5.
-
Different playlists are shown to users in different countries. Show the playlists from another country.
-
What track are these audio features for?
-
There are more audio features available. Display 2 more features.
-
Get the audio features for another track.
-
Get another artist.
-
Show the popularity value for the artist.
-
Show the number of followers the artist has.
-
Whose top tracks are these?
-
Get the top tracks of another artist.
-
Top Tracks vary by country. Which country are these top tracks for? Show the top tracks in another country.
Use a different endpoint to get totally different data! (Hint: look at this repository for examples of all the calls you can make)