 | This is the instruction of the QR-Server.com API command create-qr-code, which we also use for our own QR Code Generator goQR.me. With this command you can create QR Code graphics and use it within your own applications. 1.1 Terms of Service, Usage directives [back to top]See http://qrserver.com/de/api/#terms (German), http://qrserver.com/en-us/api/#terms (English translation) Additional notes: There is no request limit, but we reserve the right to reject API requests. This applies especially to requests we consider abusive or inappropriate (i.e. if it seems to be a DoS attack). We therefore record the origin of all requests (referrer and IP address), but not the contents of the QR Codes. To make our work easier, please let us know, if your service will regularly cause more than 10 000 requests a day or if your service is blocked wrongly. 2.0 Quick start guide [back to top]Send a GET request of following form to our system to get a QR Code PNG-image:
http://api.qrserver.com/v1/create-qr-code/?data=[URL-encoded-text]&size=[pixels]x[pixels] Test it directly within your browser by requesting the following URL: As you can see, it's easy to embed a QR Code in your (X)HTML documents by using the <img> tag. For example, the <img> tag
<img src="http://api.qrserver.com/v1/create-qr-code/?data=HelloWorld&size=100x100" alt="" title="" /> produces the following QR Code image:
 To avoid problems with special characters, it is advisable to submitted the charset your data is encoded with via the charset-source parameter. We support a wide range of parameters to configure your QR Code. Simply add extra parameters by adding &[parameter-name]=[parameter-value] to your request. 3.1 data parameter (mandatory) [back to top]The text to store within the QR Code (URL encoded, PHP programmers may use urlencode()). - Minimal charcount:
1 - Maximal charcount:
Depends on the ecc parameter (the more data redundancy is used, the less characters fit in your QR Code) and from other factors, which are too complicated to describe here in a short way. Nevertheless up to 900 characters should work in general. - Best practice:
The shorter the better. Since many older cell phones have problems with QR Codes >Version 4 (that means a matrix with 33×33 modules), you should use as little data as possible. We suggest using URL shorteners like j.mp for very long URLs. However, industrial scanners should have no problems regarding complex QR Codes.
3.2 size parameter (optional) [back to top]Specifies the size of the QR Code image you want to generate (in px for raster graphic formats (png/gif/jpeg); as logical unit for vector graphics (svg/eps)). - Format:
[integer]x[integer] - Minimal value:
10x10 - Maximal value:
1000x1000 (if format=png|gif|jpeg|jpg), 1000000x1000000 (if format=svg|eps) - Valid examples:
50x50 750x750 - Invalid examples:
50x60 (unequal edge length) 90000x90000 (greater than maximal scale) 9x9 (smaller than minimal scale) - Default (will be used if no or invalid value is set):
200x200
3.3 charset-source parameter (optional) [back to top]Specifies the charset the text submitted via data parameter is encoded in. Note: you don't have to care about converting your data if charset-source and charset-target got different values, the API does all the needed work automatically. - Possible values:
ISO-8859-1 UTF-8 - Invalid examples:
utf-8 (everything lowercase instead of uppercase) iso-8859-1 (everything lowercase instead of uppercase) - Default (will be used if no or invalid value is set):
UTF-8
3.4 charset-target parameter (optional) [back to top]Specifies the charset to encode the text submitted via data parameter with, before storing it within the QR Code. Note: you don't have to care about converting your data if charset-source and charset-target got different values, the API does all the needed work automatically. - Possible values:
ISO-8859-1 UTF-8 - Invalid examples:
utf-8 (everything lowercase instead of uppercase) iso-8859-1 (everything lowercase instead of uppercase) - Default (will be used if no or invalid value is set):
UTF-8 - Best practice:
Unfortunately, the QR Code specification does not provide a place to store the used charset within a QR Code. This means that QR Code readers have to take a guess, or always assume a certain charset. Some older software even just ignores non ASCII characters, but we usually had no problems with ISO-8859-1 regarding legacy readers. In common (=if support for very old devices is not needed or you want to store special characters), you should use UTF-8 here. If you want to be on the safe side in every case, you should use only the following characters (=ASCII): !"#$%&'()*+,-./0123456789:;<=>? @ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_ `abcdefghijklmnopqrstuvwxyz{|}~
3.5 ecc parameter (optional) [back to top]Saves the error correction code (ECC), which determines the degree of data redundancy. The more data redundancy exists, the more data can be restored if a QR Code is damaged (i.e. scratches on a QR Code sticker or something like that). - Possible values:
L (low, ~7% destroyed data may be corrected) M (middle, ~15% destroyed data may be corrected) Q (quality, ~25% destroyed data may be corrected) H (high, ~30% destroyed data may be corrected) - Default (will be used if no or invalid value is set):
L - Best practice:
L. A higher ECC results in more data to save and thus leads to a QR Code with more data pixels and a larger data matrix. Because many cell phone readers have problems with QR Codes >Version 4 (that means a matrix of 33×33 modules), the lowest ECC is the best choice for common purpose – legacy QR Code readers are a more common problem than destroyed QR Codes.
3.6 color parameter (optional) [back to top]Color of the data modules as RGB value. - Format:
Decimal ([0-255]-[0-255]-[0-255]) or hex value in short format ([a-fA-F] three chars, e.g. fff for white) or long format ([a-fA-F] six chars, e.g. ff0000 for red). - Valid examples:
255-0-0 (red), f00 (red), FF0000 (red), 0-255-0 (green), 0f0 (green), 00ff00 (green), 0-0-255 (blue), 00f (blue), 0000ff (blue), 556B2F (DarkOliveGreen) - Invalid examples:
300-100-0 (RGB decimal value >255), GG00AA (”G” is no valid char), ffaab (hex value neither in short nor long format (3 respectively 6 letters)), 255-0 (decimal B value is missing, only R and G value given) - Default (will be used if no or invalid value is set):
0-0-0 (=black) - Best practice:
0-0-0 (black). Otherwise a much darker color than the color of the background to get a good contrast. A helpful color may be found by looking for the so called web colors.
3.7 bgcolor parameter (optional) [back to top]Color of the background as RGB value. - Format:
Decimal ([0-255]-[0-255]-[0-255]) or hex value in short format ([a-fA-F] three chars, e.g. fff for white) or long format ([a-fA-F] six chars, e.g. ff0000 for red). - Valid examples:
255-0-0 (red), f00 (red), FF0000 (red), 0-255-0 (green), 0f0 (green), 00ff00 (green), 0-0-255 (blue), 00f (blue), 0000ff (blue), 556B2F (DarkOliveGreen) - Invalid examples:
300-100-0 (RGB decimal value >255), GG00AA (”G” is no valid char), ffaab (hex value neither in short nor long format (3 respectively 6 letters)), 255-0 (decimal B value is missing, only R and G value given) - Default (will be used if no or invalid value is set):
0-0-0 (=black) - Best practice:
255-255-255 (white). Otherwise a much brighter color than the color of the data modules to get a good contrast. A helpful color may be found by looking for the so called web colors.
3.8 margin parameter (optional) [back to top]Thickness of a margin in pixels. The margin will always have the same color as the background (you can configure this via bgcolor). It will not be added to the width of the image set by size, therefore it has to be smaller than at least one third of the size value. The margin will be drawn in addition to an eventually set qzone value. The margin parameter will be ignored if svg or eps is used as QR Code format (=if the QR Code output is a vector graphic). - Format:
[integer] - Minimal value:
0 (=no pixel based margin) - Maximal value:
50 - Valid examples:1
19 - Invalid examples:
-1 (less than minimal value) 1200 (more than maximal value) a (not a number) - Default (will be used if no or invalid value is set):
1
3.9 qzone parameter (optional) [back to top]Thickness of a margin (=”quiet zone”, an area without disturbing elements to help readers locating the QR Code), in modules as measuring unit. This means a value of 1 leads to a drawn margin around the QR Code which is as thick as a data pixel/module of the QR Code. The quiet zone will always have the same color as the background (you can configure this via bgcolor). The quiet zone will be drawn in addition to an eventually set margin value. - Format:
[integer] - Minimal value:
0 (=no ”quiet zone”) - Maximal value:
100 - Valid examples:
1 19 - Invalid examples:
-1 (less than minimal value) 1200 (more than maximal value) a (not a number) - Default (will be used if no or invalid value is set):
0 (=no ”quiet zone”) - Best practice:
An at least 4 module wide quiet zone is required for optimal scanning results.
3.10 format parameter [back to top]It is possible to create the QR Code picture using different file formats, available are PNG, GIF, JPEG and the vector graphic formats SVG and EPS (=you can create QR Code vector graphics / QR Code EPS / QR Code SVG). - Possible values:
png gif jpeg jpg svg eps - Invalid examples:
GIF (everything uppercase instead of lowercase) Png (first char is uppercase instead of lowercase) - Default (will be used if no or invalid value is set):
png - Best practice:
png or gif. JPEG was developed for natural pictures, its results are worse than GIF/PNG for line drawings and comparable contents. Use SVG or EPS for professional print usage.
|  |