qr.ax/ - instant link sharing

Put qr.ax/ in front of a URL to produce a QR code and a short link (like in this educational GIF)

A few examples:

URLs/Text snippets within 10-300 characters are saved to the database. This gives you:

If you put in more than 300 chars, it will not be saved to the db and only the QR code will be shown.

QR codes have a technical limit of 2953 bytes, but they aren't very practical at such a large size.


/devlog

2021-01-26
Starting now, clicking a short link will take the user to a preview page with options to "Go ahead", "Cancel",
or to wait 6 seconds before redirection occurs. Is it reasonable? Tell me what you think!

2021-01-22
Pro-tip if you're on Chrome and keep getting "https://qr.ax/www.example.com/" (saved as snippet) instead of
"qr.ax/https://www.example.com/" (saved as link): Just enable "Always Show Full URLs" from the View menu.

2020-12-08
The site should now manage simultaneous requests much better. If something's iffy, I always appreciate a bug report!



Open API

Create QR code image

Query GET https://qr.ax/api/create-qr/<value>/<watermark>/<shadow>/<theme>:<scale>/<filename>
Params value (str): 5-2953 chars
watermark (%-encoded str): 0-23 chars (post-decoding)
shadow (bool): "1" or "0" (combine with transparent elements)
theme (str): "1bit", "blue", "aqua", "green", "moss", "orange", "red", "lilac", "pink",
             "custom:<dark>:<data_dark>:<light>:<data_light>:<quiet_zone>"
             (RGB hex values, "None" for transparent. See example and segno docs for more info)
scale (int): 5-30
filename (str): 4-200 chars
Examples GET https://qr.ax/api/create-qr/http://www.example.com/qr.ax%2F%20/0/green:5/qrcode.png
GET https://qr.ax/api/create-qr/http://example.com//1/custom:202020:404040:None:None:None:5/custom.png
Response 200 OK:


400 Bad Request:
{
   "status" : "fail",
   "data" : {
      "filename" : "Length not in accepted range (5-200)"
   }
}
400 Bad Request:
{
   "status" : "fail",
   "data" : {
      "scale" : "Number not in accepted range (5-30)"
   }
}
400 Bad Request:
{
   "status" : "fail",
   "data" : {
      "value" : "Length not in accepted range (5-2953)"
   }
}
400 Bad Request:
{
   "status" : "fail",
   "data" : {
      "theme" : "Invalid theme name"
   }
}
400 Bad Request:
{
   "status" : "fail",
   "data" : {
      "theme" : "Bad formatting of custom theme - Please refer to documentation"
   }
}
500 Internal Server Error:
{
   "status" : "error",
   "data" : {
      "type" : "Internal Server Error"
   }
}

Create Short URL

Query GET https://qr.ax/api/create-url/<value>
Params value (str): 9-300 chars
Example GET https://qr.ax/api/create-url/https://www.example.com/
Response 201 Created:
{
   "status" : "success",
   "data" : {
      "id" : "2mk3i",
      "delete-code" : "f6aTb2tWrZ7U",
      "hyperlink" : {
         "redirect-url" : "https://qr.ax/2mk3i",
         "retrieve-url" : "https://qr.ax/api/fetch-url/2mk3i",
         "delete-url" : "https://qr.ax/api/delete-url/2mk3i/f6aTb2tWrZ7U",
         "original-url" : "https://www.example.com/"
      }
   }
}
400 Bad Request:
{
   "status" : "fail",
   "data" : {
      "value" : "Length not in accepted range (9-300)"
   }
}
500 Internal Server Error:
{
   "status" : "error",
   "data" : {
      "type" : "Internal Server Error"
   }
}

Delete Short URL

Query GET https://qr.ax/api/delete-url/<id>/<code>
Params id (str): Exactly 5 chars
code (str): Exactly 12 chars
Example GET https://qr.ax/api/delete-url/a4a1b/NmeWzlfJFI4M
Response 200 OK:
{
   "status" : "success",
   "data" : {
      "id" : "Entry deleted"
   }
}
404 Not Found:
{
   "status" : "fail",
   "data" : {
      "id" : "Requested id not found, or wrong code provided"
   }
}
400 Bad Request:
{
   "status" : "fail",
   "data" : {
      "id" : "Length not 5"
   }
}
400 Bad Request:
{
   "status" : "fail",
   "data" : {
      "code" : "Length not 12"
   }
}
500 Internal Server Error:
{
   "status" : "error",
   "data" : {
      "type" : "Internal Server Error"
   }
}

Retrieve Original URL

Query GET https://qr.ax/api/fetch-url/<id>
Params id (str): Exactly 5 chars
Example GET https://qr.ax/api/fetch-url/2fb62
Response 200 OK:
{
   "status" : "success",
   "data" : {
      "id" : "2fb62",
      "hyperlink" : {
         "redirect-url" : "https://qr.ax/2fb62",
         "retrieve-url" : "https://qr.ax/api/fetch-url/2fb62",
         "original-url" : "http://www.example.com/"
      }
   }
}
404 Not Found:
{
   "status" : "fail",
   "data" : {
      "id" : "Requested id not found. Deleted?"
   }
}
400 Bad Request:
{
   "status" : "fail",
   "data" : {
      "id" : "Length not 5"
   }
}
500 Internal Server Error:
{
   "status" : "error",
   "data" : {
      "type" : "Internal Server Error"
   }
}

Terms & Conditions

§1 This service is in a beta phase and may change or stop existing at any moment, without notice. Contact me if you wish to implement it reliably.
§2 Plz don't break. There are no specific limits for now, and no API authentication. This whole thing runs on a cheap VPS though, so keep that in mind and be sensible with your queries! Should you find any security flaws or have any suggestions, please get in touch!


Licences & Acknowledgements

Python - 3.6.9 - GNU General Public License (GPL)
Pillow - 7.1.1 - Historical Permission Notice and Disclaimer (HPND)
mysqlclient - 1.4.6 - GNU General Public License (GPL)
pexpect - 4.8.0 - ISC License (ISCL)
segno - 1.0.0 - BSD License
urllib3 - 1.25.6 - MIT License
Background artist: 我是叔
"The Internet." - Original comic by Anthony Clark (modified and used with permission)

Last updated: 2021-01-26