Back to APIs list

Spotify API examples & templates

Use these vals as a playground to view and fork Spotify API examples and templates on Val Town. Run any example below or find templates that can be used as a pre-built solution.
spotifyTracks
nulo
spotifyTracks
Remix of: stevekrouse/spotifyTracks
spotifyRefreshToken
neverstew
spotifyRefreshToken
Remix of: stevekrouse/spotifyRefreshToken
spotifyClearPlaylist
neverstew
spotifyClearPlaylist
Remix of: neverstew/spotifyGetPlaylist
spotifyAPI
neverstew
spotifyAPI
Remix of: stevekrouse/spotifyAPI
spotifyGetPlaylist
neverstew
spotifyGetPlaylist
Remix of: stevekrouse/spotifyCreatePlaylist
NowPlayingGrabber
tomokari
NowPlayingGrabber
Remix of: spren/NowPlayingGrabber
HTTP
NowPlaying
steini
NowPlaying
Remix of: spren/NowPlayingGrabber
HTTP
NowPlayingGrabber
spren
NowPlayingGrabber
An interactive, runnable TypeScript val by spren
HTTP
NowPlaying
tinywifi
NowPlaying
Remix of: spren/NowPlayingGrabber
HTTP
ListeningToLastFM
charmaine
ListeningToLastFM
What I'm Listening To, via Last.fm / Spotify This val returns the latest track you've listened to via Last.fm . Last.fm's "scrobbler" keeps track of any song you're listening to on different platforms, you can connect it to Spotify, Tidal, SoundCloud etc. Quick start Fork this val and change the following: username = your Last.fm username Add your Last.fm API key to your environment variables , name it LASTFM_API_KEY You can get your Last.fm API key through this form , it seems like it gets auto-approved. This will return the most recent track you have been listening to, along with the artist and artwork. Connecting with Framer You can easily plug this into your Framer website through Framer Fetch . You can get the API url of your val by clicking Copy > Copy HTTP Endpoint on the right side bar. For example, my HTTP endpoint is: https://charmaine-listeningtolastfm.web.val.run Example inside Framer, with Fetch:
HTTP
spotifyCreatePlaylist
neverstew
spotifyCreatePlaylist
Remix of: stevekrouse/spotifyCreatePlaylist
getSpotifyAccessToken
neverstew
getSpotifyAccessToken
getSpotifyAccess Token Request an access token for use with the Spotify Web API. Requires environment variables from your Spotify Developers account. SPOTIFY_CLIENT_ID SPOTIFY_CLIENT_SECRET Uses Blob storage to cache the spotify_accessToken based on when the expires_in value in the Spotify Access Token response. Example import { getSpotifyAccessToken } from "https://esm.town/v/dthyresson/getSpotifyAccessToken"; const accessToken = await getSpotifyAccessToken(); console.debug(accessToken)
valTownInspoList
rodrigotello
valTownInspoList
Val Town inspiration & use cases list List [as object] used in Val Town's use cases and inspiration. Check it out at in /examples/use-cases and /docs/tutorial/4
valTownInspoList
charmaine
valTownInspoList
Remix of: rodrigotello/valTownInspoList
newFavoriteSongBot
alexwein
newFavoriteSongBot
Remix of: jonasmerlin/bluesky_bot_template
Cron
randoDisc
ashryanio
randoDisc
@jsxImportSource https://esm.sh/react@18.2.0
HTTP