Help Wizard

Step 1

NEXT STEP

Resolve link.tospotify.com to ID

Solved!

Resolve link.tospotify.com to ID

Is there a way to get more information from the characters after "link.tospotify.com" via the API?  Like the Spotify ID of a track.

 

For example https://link.tospotify.com/TsNdTNARuab

 

Reply

Accepted Solutions
Marked as solution

I don't think that's directly searchable anywhere. If you follow the link and parse the HTML response the track Id can be found that way though.

 

In the <head> part of the page you're redirected to there's a tag that looks like this:

<meta property="og:url" content="https://open.spotify.com/track/0ttF21hZCPw2merE3GsHcP">

<meta property="og:url" content="https://open.spotify.com/track/0ttF21hZCPw2merE3GsHcP">

 

The last part being the track Id that can then be accessed using the API using this endpoint: 

https://api.spotify.com/v1/tracks/{id}

 

View solution in original post

1 Reply
Marked as solution

I don't think that's directly searchable anywhere. If you follow the link and parse the HTML response the track Id can be found that way though.

 

In the <head> part of the page you're redirected to there's a tag that looks like this:

<meta property="og:url" content="https://open.spotify.com/track/0ttF21hZCPw2merE3GsHcP">

<meta property="og:url" content="https://open.spotify.com/track/0ttF21hZCPw2merE3GsHcP">

 

The last part being the track Id that can then be accessed using the API using this endpoint: 

https://api.spotify.com/v1/tracks/{id}

 

Suggested posts