I made something in the process of making something else. I didn’t finish the something else, but figured I’d share the thing…
I got an itch to revive StretchLink, my little menu bar app that expanded shortened links as you copied them, so you had a full URL when you pasted. It was great for seeing where a link would take you before following it. Given the state of the internet, that seemed useful.
I have the code to resolve links internally, but I like the flexibility of an API. The original StretchLink relied on an API that has since died, so I decided to just write my own. It’s not complicated.
So here’s stretchlink.cc. A simple little API that takes a shortened URL and outputs the long version. It can remove tracking info if you like, as well as reduce Amazon product links down to the bare minimum the URL needs to function. It can output plain text (just the resolved URL), Markdown (with optional title), or JSON (including original url, expanded url, and optional title).
I added caching and concurrency, for what it’s worth. If this gets used, it would scale well. I doubt it will, but I like to cover my bases. I’ve written a couple of Shortcuts that leverage it for double checking URLs you’ve been sent before clicking them. I’ll share those separately. If you make anything useful with the API, please do share in the comments (which are connected to the Forum).