qr-code-api

{ QR Code API }JSON

With the API you are able to generate QR Codes and retrieve scanning statistics about each of your QR Codes. When attaching an address to a QR Code you have created a geo tagged QR Code. As a registered user you can use the API to add additional geo information like Longitude und Latitude to the QR Code.

As soon someone scans your QR Code, that you attached to your given location, it will be shown on the
QR Map

Every request returns a JSON response.

To use the API, register here or sign in.

Create a QR Code

The following call generates a dynamic QR Code with the given URL:

https://api.qrd.by/short?key=<YOUR_API_KEY_GOES_HERE>&url=https://jungidee.at/projekte

Note:If you want to shorten an URL that contains a &, please use the hexadecimal value %26 instead. If a # is part of your request replace the char with %23.

The API will respond with an object notated in JSON with the QR code and the shortened tracking URL:

{ 
    "result":{
      "id":"7W",
      "shorturl":"https://qrd.by/7W",
      "qr":"https://qrd.by/i/7W",
      "url":"https://jungidee.at/contact",
      "creationdate":"2011-10-10 09:40:14",
      "image","",
      "location":{
         "address":"",
         "lng":"",
         "lat":"",
         "note":""
      }
   }
}

Attach a Geo Location to a QR Code

You can attach geo information to a QR Code. This may be your company address or any location where you want to stick your QR Code. The parameter address is a human readable address string. The parameter lat (Latitude) and lng (Longitude) are used for further machine processing, e.g. to show the location on a map. The note parameter is used to add a detailed description about the location (e.g. 2nd floor, left door). You may add an image with the parameter image, that contains the path to the image.

https://api.qrd.by/short?key=<YOUR_API_KEY_GOES_HERE>&url=https://jungidee.at/contact&
address=Deublerstreet 37&lng=16.3909&lat=48.2675&note=2nd floor, left door

The API will respond with an object notated in JSON like above, but with the added geo information.

{ 
    "result":{
      "id":"7W",
      "shorturl":"https://qrd.by/7W",
      "qr":"https://qrd.by/i/7W",
      "url":"https://jungidee.at/contact",
      "creationdate":"2011-10-10 09:33:03",
      "image","",
      "location":{
         "address":"Deublerstreet 37",
         "lng":"16.3909",
         "lat":"48.2675",
         "note":"2nd floor, left door"
      }
   }
}

List all Geo Tagged QR Codes

The following call is an example on how to retrieve a list of all your Geo Tagged QR Codes:

https://api.qrd.by/geotags?key=<YOUR_API_KEY_GOES_HERE>

The response includes a list of all your Geo Tagged QR Codes with the number of scans and unique visitors for each code. You will also find the original URL and location data (if attached):

{
    "result": {
        "geotags": [
            {
                "id":"3P",
                "shorturl": "https://qrd.by/3P",
                "qr": "https://qrd.by/i/3P",
                "url": "https://jungidee.at",
                "scans": "12",
                "uniquevisitors": "10",
                "creationdate": "2011-10-08 22:19:48",
                "image": "/u/3P.jpg",
                "location": {
                    "address": "Deublergasse 37, 1210 Wien, Österreich",
                    "lng": "16.3909",
                    "lat": "48.2675",
                    "note": "Haustüre rechts"
                }
            },
            {
                "id":"4L",
                "shorturl": "https://qrd.by/4L",
                "qr": "https://qrd.by/i/4L",
                "url": "https://qrd.by/l/kayiko",
                "scans": "17",
                "uniquevisitors": "10",
                "creationdate": "2011-10-12 13:08:38",
                "image": "/u/4L.jpg",
                "location": {
                    "address": "Windmühlgasse 16, 1060 Wien, Österreich",
                    "lng": "16.3566",
                    "lat": "48.1992",
                    "note": "An der Türe"
                }
            },
            {
                "id":"7k",
                "shorturl": "https://qrd.by/7k",
                "qr": "https://qrd.by/i/7k",
                "url": "http://www.map-studio.com",
                "scans": "0",
                "uniquevisitors": "0",
                "creationdate": "2011-10-27 21:26:23",
                "image": "",
                "location": {
                    "address": "Schönburgstraße 27, 1040 Wien, Österreich",
                    "lng": "16.3703",
                    "lat": "48.1864",
                    "note": "Rooftop"
                }
            },
            {
                "id":"7q",
                "shorturl": "https://qrd.by/7q",
                "qr": "https://qrd.by/i/7q",
                "url": "http://www.derstaud.at",
                "scans": "9",
                "uniquevisitors": "2",
                "creationdate": "2011-10-28 16:05:59",
                "image": "",
                "location": {
                    "address": "Eisstoßgasse 8, 1220 Wien, Österreich",
                    "lng": "16.4397",
                    "lat": "48.2178",
                    "note": "Garage"
                }
            }
        ]
    }
}

Tag Map Widget

Use the TagMap Widget to show your geo tagged QR Codes on a map. You will see where and when your QR Codes are scanned.

TagMap Widget Details...

Show all QR Codes

The following API call generates a list of all created QR Codes:

https://api.qrd.by/qrcodes?key=<YOUR_API_KEY_GOES_HERE>

The result contains a list of all QR Codes including the number of scans and unique visitors for each QR Code, as well as the original URL and geo data.

{
        "result": {
            "qrcodes": [
                {
                    "id":"3P",
                    "shorturl": "https://qrd.by/3P",
                    "qr": "https://qrd.by/i/3P",
                    "title":"title of target website",
                    "description":"description of target website",
                    "type": "URL",
                    "url": "https://qrd.by/test",
                    "scans": "12",
                    "uniquevisitors": "10",
                    "creationdate": "2011-10-08 22:19:48",
                    "image": "/u/3P.jpg",
                    "location": {
                        "address": "my street 37, 38721 Berlin, Germany",
                        "lng": "16.3909",
                        "lat": "48.2675"
                    }
                },
                {
                    "id":"4L",
                    "shorturl": "https://qrd.by/4L",
                    "qr": "https://qrd.by/i/4L",
                    "title":"title of target website",
                    "description":"description of target website",
                    "type": "URL",
                    "url": "https://qrd.by/test",
                    "scans": "17",
                    "uniquevisitors": "10",
                    "creationdate": "2011-10-12 13:08:38",
                    "image": "/u/4L.jpg",
                    "location": {
                        "address": "Downtown 1, 1010 Vienna, Austria",
                        "lng": "16.3566",
                        "lat": "48.1992"
                    }
                }
            ]
        }
    }

Scan Statistics for a QR Code

The following example call retrieves the scanning statistics for a single QR Code. The input parameter are the ID of the QR Code and the API Key.

https://api.qrd.by/stat?key=<YOUR_API_KEY_GOES_HERE>&id=7W

The response includes basic statistical data like the original URL, shortened URL, link to the QR Code, address and geo coordinates, followed by: when was the QR Code first scanned, how much time elapsed between the first and the last scan, how often the QR Code is requested by day, the age in days, the number of unique visitors and the total number of requests.
For every request, detailed information about the request date, the country, the region, which browser & version, which OS and which model or brand (if the QR Code was scanned with a mobile device) is saved. If the user sends his location after scanning the QR Code, his position is encoded as lng & lat.

{
   "result":{
      "id":"7W",
      "shorturl":"https://qrd.by/7W",
      "qr":"https://qrd.by/i/7W",
      "url":"https://jungidee.at",
      "creationdate":"2011-10-08 22:19:48",
      "image","",
      "location":{
         "address":"Deublerstreet 37, 1210 Vienna, Austria",
         "lng":"16.3909",
         "lat":"48.2675",
         "note":"2nd Floor right door"
      },
      "firstrequestdate":"2011-10-09 10:32:35",
      "lastrequestdate":"2011-10-09 20:45:36",
      "daysbetweenfirstandlastrequest":"1",
      "dayssincecreated":"3",
      "uniqevisitors":"4",
      "callsperday":"9",
      "requestcount":"9",
      "requests":[         
         {
            "requestdate":"2011-10-09 10:59:41",
            "region":"New York",
            "countrycode":"us",
            "country":"United States",
            "lng":"",
            "lat":"",
            "browser":"BlackBerry",
            "browserversion":"5",
            "os":"RIM OS",
            "model":"BlackBerry 9700",
            "brand":"RIM"
         },
         {
            "requestdate":"2011-10-09 10:59:40",
            "region":"Sunnyvale",
            "countrycode":"us",
            "country":"United States",
            "lng":"",
            "lat":"",
            "browser":"MSIE",
            "browserversion":"7",
            "os":"Windows",
            "model":"",
            "brand":""
         },
         {
            "requestdate":"2011-10-09 10:57:03",
            "region":"Lower Austria",
            "countrycode":"at",
            "country":"Austria",
            "lng":"16.4184",
            "lat":"48.185",            
            "browser":"Safari",
            "browserversion":"",
            "os":"iPhone OS",
            "model":"iPhone",
            "brand":"Apple"
         },
         {
            "requestdate":"2011-10-09 10:32:35",
            "region":"Lower Austria",
            "countrycode":"at",
            "country":"Austria",
            "lng":"",
            "lat":"",
            "browser":"Firefox",
            "browserversion":"6",
            "os":"Windows",
            "model":"",
            "brand":""
         }
      ]
   }
}

API Call with Javascript

Create a QR Code

Use the API directly with javascript (jQuery.getJSON). Include the following code snippet into your Webseite to generate a QR Code:

<script src="http://code.jquery.com/jquery.min.js"></script>
<script type="text/javascript">
    
var url = "https://jungidee.at/home";

var apiKey = "<YOUR_API_KEY_GOES_HERE>";
var apiUrl = "https://api.qrd.by/";

/**
 * Sample API Call to create a QR Code.
 * Please pay attention to the &callback=? parameter an the end of the request.
 * The parameter is used after the API call by jQuery.getJSON to request the 
 * callback function below.
 */
var apiShortUrl = apiUrl + "short?key=" + apiKey + "&url=" + url + "&callback=?";

/*
 * The callback function is called from the API after the QR Code has been created.
 * The name of the function has to be equal to the name of the API method.
 * The resulting JSON object may be accessed through: data.result.         
 * (e.g. data.result.shorturl, data.result.creationdate, etc.)
 */
function short(data) {    
    $('#result').html("The QR Code was created and the URL '" +
                       url + 
                      "' was shortened to " + data.result.shorturl +
                      "<img src='"+ data.result.qr +"'/>");
}

$(function() {
    $('#shortenUrl').click(function() {
        // API Call
        $.getJSON(apiShortUrl);
    });
});
</script>
<div>
    Click <a href="#" id="shortenUrl">here</a> 
    to generate a QR Code for the URL https://jungidee.at/home.
</div>
<div id="result"></div>
        
Top