Thursday, 27 February 2014

Free QR API

Free QR API .

With this API you can insert a QR in your web page.

To call this API and obtain your QR you only need to get this url:

http://devel.farebookings.com/api/qr/{param}

Example:

get QR for "This is my example data":
http://devel.farebookings.com/api/qr/This is my example data

PHP usage;

 <?php
$data = "This is my example data";
echo curl("devel.farebookings.com/api/qr/".$data);

function curl($url) {
            $ch = curl_init();
            $timeout = 0;
            curl_setopt ($ch, CURLOPT_URL, $url);
            curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
            curl_setopt ($ch, CURLOPT_USERAGENT , "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1)");
            curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
            $data = curl_exec($ch);
            curl_close($ch);
            return $data;
}

?>



Raul Torrico.
Web developer.
Farebookings.com

3 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. Hi,
    This is a nice api. But this is able to generate QR code only for a single word not the complete sentence.
    In the example provided by you, it is created only for 'This'. I tested for many other examples,same with every case.
    Can you make this to generate QR code for complete sentence.
    Thanks in advance

    ReplyDelete
  3. Hi, you need url encoding the param if you want to test in browser

    ReplyDelete