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:

  • A QR code containing your raw data
  • A short link (qr.ax/xxxxx) redirecting to your URL (after a preview) or displaying your text-snippet and a QR.
  • A delete-link, which you may save for later use if you wish

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.



Dev log

2021-06-16
Added preview image to the redirection page.

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

(extremely RESTless, yet not SOAPy)

§1 This service is still in development 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!

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/custom/1/custom:202020:404040:None:None:None:5/pic.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"
   }
}

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"
   }
}

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"
   }
}

Query GET https://qr.ax/api/fetch-url/<id>
Params id (str): Exactly 5 chars
Example GET https://qr.ax/api/fetch-url/73c32
Response 200 OK:
{
   "status" : "success",
   "data" : {
      "id" : "73c32",
      "hyperlink" : {
         "redirect-url" : "https://qr.ax/73c32",
         "retrieve-url" : "https://qr.ax/api/fetch-url/73c32",
         "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"
   }
}


# Make a QR code image and save it:

import urllib.request
img = urllib.request.urlopen(
    "https://qr.ax/api/create-qr/" +
    "http://example.com" + 
    "/text/1/custom:202020:404040:None:None:None:5/custom.png"
)
with open('custom.png', 'wb') as f:
    f.write(img.read())
                 

# Make a short url:

import urllib.request
import json
long_url = "https://en.wikipedia.org/wiki/Leaning_Tower_of_Pisa"
answer = urllib.request.urlopen("https://qr.ax/api/create-url/" + long_url)
json_object = json.loads(answer.read())
short_url = json_object["data"]["hyperlink"]["redirect-url"]
print(short_url)
                







Last updated: 2022-03-14