QRCode API
The QRCode API generates custom QR codes for any content. It supports custom colors, size, and several image formats.
/v1/qrcode GET
https://api.api-ninjas.com/v1/qrcode
Returns a QRCode image binary specified by input parameters.
Parameters
- datarequired- Data to encode in the QR code. 
- formatrequired- Image format to return. Must be one of the following: - png,- jpg,- jpeg,- eps,- svg.
- sizeoptional- Size of the QR code image to generate. The output will be a square image with (size x size) dimensions. 
- fg_coloroptional- Foreground color of the QR code. Must be a 6-digit hex color (e.g. - 00ff00for green). Default is- 000000(black).
- bg_coloroptional- Background color of the QR code. Must be a 6-digit hex color (e.g. - 00ff00for green). Default is- ffffff(white).
Headers
- X-Api-Keyrequired- API Key associated with your account. 
- Acceptmay be required- Depending 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 your- formatparameter:- png:- image/png
- jpg:- image/jpg
- jpeg:- image/jpeg
- eps:- application/postscript
- svg:- image/svg+xml
 
Sample Request Live Demo!
https://api.api-ninjas.com/v1/qrcode?format=png&data=https://api-ninjas.comHeaders
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.