• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
dthyresson

dthyresson

getSpotifyTrackUrl

Public
Like
getSpotifyTrackUrl
Home
Code
2
README.md
main.tsx
Connections
Environment variables
Branches
1
Pull requests
Remixes
History
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
Code
/
Search
README.md

getSpotifyTrackUrl

Get a Spotify Track Url using the Spotify Web API given an artist and a song title.

Track info is cached by the query and also the spotify track id, so your popular queries won't have to fetch from Spotify over and over.

Examples

import { getSpotifyTrackUrl } from "https://esm.town/v/dthyresson/getSpotifyTrackUrl"; const reni = await getSpotifyTrackUrl("Stone Roses", "Fools Gold"); const ian = await getSpotifyTrackUrl("Joy Division", "Love Will Tear Us Apart"); const kim = await getSpotifyTrackUrl("Pixies", "Velouria"); console.log(reni) console.log(ian) console.log(kim)

Info

Uses getSpotifyAccessToken which requires you to set environment variables from your Spotify Developers account.

SPOTIFY_CLIENT_ID SPOTIFY_CLIENT_SECRET

Your access token is cached by getSpotifyAccessToken to avoid fetching over and over.

Migrated from folder: Spotify/getSpotifyTrackUrl

Code
README.mdmain.tsx
FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
© 2026 Val Town, Inc.