Musicfetch

Get the Spotify song link from a YouTube link

How to use Musicfetch to find the Spotify link for any song using a YouTube track URL

Want to quickly get the Spotify link for a song you found on YouTube? Musicfetch makes it easy to convert any supported YouTube track link to its Spotify equivalent.

How to use Musicfetch API to get a Spotify link from YouTube

Use the /url endpoint with a YouTube track URL and set services=spotify in the query. You can use any supported YouTube track link. See the track lookup API docs for more details.

From a YouTube track URL

curl 'https://api.musicfetch.io/api/url?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D2Vv-BfVoq4g&services=spotify' \
-H 'x-musicfetch-token: YOUR_TOKEN'

Example response

The Musicfetch response contains merged links/metadata from YouTubeand Spotify.

{
"result": {
"type": "track",
"name": "Perfect",
"services": {
"spotify": {
"link": "https://open.spotify.com/track/0tgVpDi06FyKpA1z0VMD4v",
},
"youtube": {
"link": "https://www.youtube.com/watch?v=2Vv-BfVoq4g",
}
}
}
}