Shrty is a simple to use, go based link shortner with api connection.
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Sebastian Preisner dea368d08b Rename Sgot to Shrty 7 years ago
shrty storage path integration 7 years ago
template Fix Title 7 years ago
.gitignore Testing and Link disolve Close #8 7 years ago
LICENSE Initial commit 7 years ago Rename Sgot to Shrty 7 years ago
api.go Close #9 7 years ago
config.go Rename Application 7 years ago
config_test.go Root Path setting 7 years ago
handlers.go Use http.Status Close #13 7 years ago
main.go storage path integration 7 years ago
routs.go Testing and Link disolve Close #8 7 years ago


Shrty is a lightwaight, self-hostable open-source link shortening web application with a Restful API. It allows you to host your own URL shortener to gain control over your data. Shrty is inspired by Polr, a php based url shortener.


  • No duplicated URL
  • Simple UI
  • Simple database Json file
  • Restful API
  • Simple Click Statistik
  • Key protected API
  • Nice overfewpage for shorted URLs
  • Delete URL
  • Login


Clone the Repository and build the Application by using go build .

Start Shrty by the following commant ./sgot &

Flag Usage Default
-host setup the host to listen on localhost
-port Setup the port to listen on 6889
-apikey Define the key to connect with the API "thisIsNotASecretTokenNow"
-db-file Setup the DB file to use ./shrty.db
-title Service title Shrty
-domain Domain for the redirection link The domain your service is available


To authenticate a user to Polr, you will need to provide an API key along with each request to the Polr API, as a GET or POST parameter. (e.g ?key=API_KEY_HERE)



  • url: the URL to shorten (e.g
  • custom_ending [not now supported] (optional): a custom ending for the short URL. If left empty, no custom ending will be assigned.

Short an URL


{ "action": "shorten",
  "result": "" }



  • url_ending: the link ending for the URL to look up. (e.g 5ga)

Lookup for existing URL


{ "action":"lookup",
  "result": {
        "long_url": "",
        "created_at": "2017-05-12 22:48:40.997520107 +0200 CEST",


  • Add more Statistik details like the clicks from Country and Referer.
  • Implements the correct HTTP Error Codes
  • Add config File
  • Secure the API with API Key [optional]