QRCode API
The QRCode API generates custom QR codes for any content. It supports custom colors, size, and several image formats.
From 4,752 users
Applications using this API
API Status
API Response Times
Average | P50 | P75 | P90 | P95 |
|---|---|---|---|---|
| 277ms | 315ms | 371ms | 560ms | 1201ms |
Similar APIs
Didn't find what you were looking for? Suggest an improvement
/v1/qrcode GET
https://api.api-ninjas.com/v1/qrcode
Returns a QRCode image binary specified by input parameters.
Parameters
datarequiredData to encode in the QR code.
formatrequiredImage format to return. Must be one of the following:
png,jpg,jpeg,eps,svg.sizeoptionalSize of the QR code image to generate (e.g.
200). The output will be a square image with (size x size) dimensions. The default size is250.fg_coloroptionalForeground color of the QR code. Must be a 6-digit hex color (e.g.
00ff00for green). Default is000000(black).bg_coloroptionalBackground color of the QR code. Must be a 6-digit hex color (e.g.
00ff00for green). Default isffffff(white).
Headers
X-Api-KeyrequiredAPI Key associated with your account.
Acceptmay be requiredDepending on the programming language and HTTP request library (e.g. Python's
requests), you may need to add a header indicating the content type(s) to accept in the result. Set the value according to yourformatparameter:png:image/pngjpg:image/jpgjpeg:image/jpegeps:application/postscriptsvg:image/svg+xml
Response
Returns the generated QR code image in the format specified by the format parameter (for example PNG, JPG, SVG). The response body is binary image data (or text for SVG/EPS). Returns an error if the request is unsuccessful.
Sample Request Live Demo!
Try this API endpoint with all available parameters in our API playground
https://api.api-ninjas.com/v1/qrcode?data=https%3A%2F%2Fapi-ninjas.com&format=pngHeaders
X-Api-KeyLog in or sign up to get your API KeySample Response

Code Examples
1
2
3
4
curl -X GET "https://api.api-ninjas.com/v1/qrcode?data=https://api-ninjas.com&format=png" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Accept: image/png" \
--output qrcode.pngIf your programming language is not listed in the Code Example above, you can still make API calls by using a HTTP request library written in your programming language and following the above documentation.
Frequently Asked Questions
Can I use the QR Code API for commercial purposes?
How do I get an API key and start using the QR Code API?
What happens if I exceed my quota for the month?
What happens if a request to the QR Code API fails?
What are some use cases for the QR Code API?
How do I customize the colors and size of the generated QR code?
What image formats does the QR Code API support?
What does the QR Code API response contain?