The API

Simple. Fast. Easy

Introduction

Shorty has a very simple and easy to use api to help you easily automate shortening links. This service is intended to be used to create short-lived shareable links. The default expiry for a link if none provided during creation is 60 days. After 60 days, the url might get assigned as the shortened link for another url, so please set the expiry value incase you might need more time or use another service that offers permanent links.

Usage

Send a GET request to the following url to get the shortened version of the provided url. Replace YOUR_URL_HERE with a valid url. You might need to url encode it depending on what you use to send the request.

http://shorty.britto.tech/api/v1/create?url=YOUR_URL_HERE

Here's the format of the api response with added line breaks for easy visualisation:

{
  "shortUrl": "http://shorty.britto.tech/ABCDE",
  "originalUrl": "YOUR_URL_HERE",
  "expiresAt": 1725055989
}

Here the expiresAt integer is when the generated short url will cease to function represented in unix time milliseconds UTC. originalUrl is the url you provided and shortUrl is the shortened url that you can use to redirect to the original url.

If you don't care about any of that and just want the shortened url that you can use for a little while, add the minimal=y query parameter to the url link this:

http://shorty.britto.tech/api/v1/create?url=YOUR_URL_HERE&minimal=y

This will return a plain text response with just the shortened url terminated by a newline.

You can also pass in expiry as an optional parameter to modify how long the link should remain active. The value should be in minutes between 10 and 525600 (1 year). Here's an example:

http://shorty.britto.tech/api/v1/create?url=YOUR_URL_HERE&expiry=60

You can combine the minimal and expiry parameters if needed, although I would recommend always using the json response for better logging and tracking.

There is also the resolve endpoint which takes in an id and returns the original url in plain text that the id represents. Here's the format:

http://shorty.britto.tech/api/v1/resolve?id=ABCDE

Here the id is the shortened url identifier without the full url. So the id of http://shorty.britto.tech/ABCDE would be ABCDE.

Availability

The api is available at https://shorty.britto.tech/ and is open for public use. There are some rate limits and I might tweak them as needed, but it should not be a problem for normal use.

Please be considerate and don't abuse the service. If you need a more reliable and permanent solution, consider hosting your own instance of Shorty. The source code and instructions on building/hosting is available on the GitHub Repo.

Please also be advised that I cannot guarantee any uptime or reliability of the service. I will try my best to keep it running, but I can't make any promises. This is just a hobby project for me and I don't have the resources to promise anything.