Type in your question below and we'll check to see what answers we can find...
Loading article...
Submitting...
If you couldn't find any answers in the previous step then we need to post your question in the community and wait for someone to respond. You'll be notified when that happens.
Simply add some detail to your question and refine the title if needed, choose the relevant category, then post.
Before we can post your question we need you to quickly make an account (or sign in if you already have one).
Don't worry - it's quick and painless! Just click below, and once you're logged in we'll bring you right back here and post your question. We'll remember what you've already typed in so you won't have to do it again.
Please see below the most popular frequently asked questions.
Loading article...
Loading faqs...
Please see below the current ongoing issues which are under investigation.
Loading issue...
Loading ongoing issues...
On mobile share-links are now shortened.
For example: https://spotify.link/hRkBrwub9xb
As a developer who relied on the URL containing the trackID this makes it impossible for me to find which track is being passed on. The website redirects to the correct song but it's not using 301 or 302 redirects which means that it probably is a client side JS redirect.
Giving us an endpoint to paste the short url and retrieve the long url would be nice.
Redirect Chain
To further clearify that the short links are not a good idea is that embeds in popular chat programs like Discord won't work anymore. Even Spotify's own oEmbed endpoint does not work with this kind of URL: https://open.spotify.com/oembed?url=https://spotify.link/hRkBrwub9xb
"error": {
"code": 404,
"message": "Invalid URI: error in parsing"
}
I just ran into this issue myself, you don't actually need a dedicated endpoint for it because it's just a redirect. Just send a HEAD request to the URL and follow the redirects. Here's how you can unfurl it in Python.
import requests
r = requests.head("<spotify.link url>", allow_redirects=True)
print(r.url)
And similarly in cURL.
curl -vILsw %{url_effective} https://spotify.link/hRkBrwub9xb
Even though it gives the response code for forbidden it returns the full URL. This is, albeit not ideal, the solution.
Thanks!
This is still impossible in some popular programming languages, Dart for example. Without the 3xx redirect code Dart cannot properly expand the URL all the way. A Spotify endpoint that gives you the full URL would be very helpful.
The "allow_redirects" param is not helpful as I'm redirected to this page: https://www.spotify.com/us/download/pc?_branch_match_id=1240295733527340369&utm_source=copy-link&utm... which is not the playlist linked by the Spotify link: https://spotify.link/ltOhkWzXKDb
This is because Spotify does the redirect through js - specifically
window.top.location.replace(FINAL_DESTINATION)
Ok; so how can I handle that correctly using CURL in PHP to have the correct destination URL?
EDIT: good by parsing the HTML. Still need a proper API endpoint for that.
You can use the cURL command or python snippet to get the final destination. Here is a Replit using the python snippet: https://replit.com/@HenryHill4/spotify-short-link-redirect-example?v=1
This is still broken in 2024
Set your user agent to curl! Example in Dart:
Hi Inzanity,
You can try this method: URL Expander
You can also try open-source solutions, search for "url expander" on GitHub to find suitable libraries or code corresponding to your programming language, and integrate them into your software or app.
Hey there you, Yeah, you! 😁 Welcome - we're glad you joined the Spotify Community! While you here, let's have a fun game and get…