Generate QR code with Google QR encoder API Instantly

Hi People, You might have tried to generate a QR code before. Do you know that you can generate QR codes instantly with Google QR encoder API ?

google qr encoder api

This API was initially developed for Google Charts but for instance you can use it to return a 2D QR code image by passing a URL.

Take a look at below:

QR code with simple link

SYNTAX URL:
http://chart.apis.google.com/chart?cht=qr&chs=200×200&chl=www.voidtricks.com

This URL will return an image of a 2D QR code. You can use this URL for src attribute of img tag.

Note the variables sent with URL.

cht=qr – Type of image

chs(width x height) – Dimension of the image in Pixels

chl – link to open when QR code is scanned

Sample QR code image

QR code to send email

SYNTAX URL:
http://chart.apis.google.com/chart?cht=qr&chs=200×200&chl=connect@voidtricks.com

In this url we have put an email id for chl variable. This will trigger a mail to function when the QR is scanned.

sample QR code image

QR code to Dial a phone number

SYNTAX URL:
http://chart.apis.google.com/chart?cht=qr&chs=200×200&chl=tel:7418888668

Note the chl variable. We have put tel:7418888668. This will add this phone number to the dial screen.

Sample QR code image

QR code to send a message to a number

SYNTAX URL:
http://chart.apis.google.com/chart?cht=qr&chs=200×200&chl=sms:7418888668

Since we put sms:7418888668, this will open a new message to the given number.

Sameple QR code image

QR code for MECARD

SYNTAX URL:
http://chart.apis.google.com/chart?cht=qr&chs=200×200&chl=MECARD:N:Roshan,Anand;TEL:7418888668;EMAIL:connect@voidtricks.com;URL:www.voidtricks.com;;

MECARD will add a contact with the given info to your device.

Sample QR code image

QR code with simple text

SYNTAX URL:
http://chart.apis.google.com/chart?cht=qr&chs=200×200&chl=void%20Tricks

This is with a simple text. Most of the devices will open a browser for search the given text.

Sample QR code image

That’s it people.

Learn more about Google QR encoder API here https://developers.google.com/chart/‎

Keep scrolled with us for more updates and don’t forget to share this post.

www.voidtricks.com


Anand Roshan

Author: Anand Roshan

An entrepreneur, programmer and a passionate artist who loves to work independently. Get social: Twitter | Google + | Artist Page

One comment on “Generate QR code with Google QR encoder API Instantly”

Leave a Reply

Your email address will not be published. Required fields are marked *