Root URL: https://chart.googleapis.com/chart?
QR code requests support the following URL query parameters after the ? in the root URL:
Parameter | Required or Optional | Description |
---|---|---|
cht=qr | Required | Specifies a QR code. |
chs=<width>x<height> | Required | Image size. |
chl=<data> | Required | The data to encode. Data can be digits (0-9), alphanumeric characters, binary bytes of data, or Kanji. You cannot mix data types within a QR code. The data must be UTF-8 URL-encoded. Note that URLs have a 2K maximum length, so if you want to encode more than 2K bytes (minus the other URL characters), you will have to send your data using POST. |
choe=<output_encoding> | Optional | How to encode the data in the QR code. Here are the available values:
|
chld=<error_correction_level>|<margin> | Optional |
|
Example:
cht=qr
chl=Hello+world
choe=UTF-8
QR Code Details [Optional Reading]
Here is a little more about how QR codes work; you don't necessarily need to know this to be able to generate a QR code.
QR codes are squares, with an equal number of rows and columns. There are a fixed set of QR code sizes: from 21 to 177 rows/columns, increasing in steps of four. Each configuration is called a version. The more rows/columns, the more data the code can store. Here is a summary of the versions:
- Version 1 has 21 rows and 21 columns, and can encode up to 25 alphanumeric characters
- Version 2 has 25 rows and 25 columns, and can encode up to 47 alphanumeric characters
- Version 3 has 29 rows and 29 columns, and can encode up to 77 alphanumeric characters
- ...
- Version 40 has 177 rows and 177 columns, and can encode up to 4,296 alphanumeric characters
Don't confuse the number of rows and columns with size of the QR code image. The pixel size of the code is determined usingchs
as usual.
The API will determine which version to use, based on the amount of data you provide.
The appropriate QR code version will be returned depending on the number of characters you provide. For example, if you provide 55 alphanumeric characters, you will get a Version 3 QR code, although this can change if you specify an error correction (EC) level explicitly using the chld
parameter.
Before generating your QR code, consider what kind of device is used to read your code: the best QR code readers are able to read Version 40 codes; mobile devices might only be able to read up to Version 4.
The following table summarizes the characteristics of a few different versions:
Version | Rows x Columns | EC level | Maximum characters by EC level and character type | |||
---|---|---|---|---|---|---|
Digits: 0 to 9 | Alphanumeric: 0 to 9, A to Z, space, $ % * + - . / : | Binary | Kanji | |||
1 | 21x21 | L | 41 | 25 | 17 | 10 |
M | 34 | 20 | 14 | 8 | ||
Q | 27 | 16 | 11 | 7 | ||
H | 17 | 10 | 7 | 4 | ||
2 | 25x25 | L | 77 | 47 | 32 | 20 |
M | 63 | 38 | 26 | 16 | ||
Q | 48 | 29 | 20 | 12 | ||
H | 34 | 20 | 14 | 8 | ||
3 | 29x29 | L | 127 | 77 | 53 | 32 |
M | 101 | 61 | 42 | 26 | ||
Q | 77 | 47 | 32 | 20 | ||
H | 58 | 35 | 24 | 15 | ||
4 | 33x33 | L | 187 | 114 | 78 | 48 |
M | 149 | 90 | 62 | 38 | ||
Q | 111 | 67 | 46 | 28 | ||
H | 82 | 50 | 34 | 21 | ||
10 | 57x57 | L | 652 | 395 | 271 | 167 |
M | 513 | 311 | 213 | 131 | ||
Q | 364 | 221 | 151 | 93 | ||
H | 288 | 174 | 119 | 74 | ||
40 | 177x177 | L | 7,089 | 4,296 | 2,953 | 1,817 |
M | 5,596 | 3,391 | 2,331 | 1,435 | ||
Q | 3,993 | 2,420 | 1,663 | 1,024 | ||
H | 3,057 | 1,852 | 1,273 | 784 |
'Interesting > TIPTECH' 카테고리의 다른 글
Usage of traffic analysis tools for websites (0) | 2012.04.11 |
---|---|
Usage of content management systems for websites (0) | 2012.04.11 |
L2J millionth HIT (0) | 2012.04.05 |
아이패드 3세대 3G+WiFi 전파인증 완료 (2) | 2012.04.05 |
안녕하세요 서태지 입니다. (0) | 2012.03.26 |