API Documentation
Complete Parameter Reference
1. Command create-qr-code
1.1 General Information
The create-qr-code command allows you to create QR codes via our API. You can also integrate it into your own web application.
Endpoint: /api/v1/create-qr-code/ - GET method
1.2 Quick Start Guide
Send a GET request in the following format to get a PNG QR code:
/api/v1/create-qr-code/?data=[texte-encodé-URL]&size=[pixels]
Embed a QR code in your HTML documents with the <img> tag:
<img src="/api/v1/create-qr-code/?data=HelloWorld!&size=10"/>
The API accepts text encoded in UTF-8.
1.3 Parameters
Add parameters with &[name]=[value].
data
- required
- Description
- The text to embed in the QR code (URL encoded).
- Min. characters
- 1
- Max. characters
- ~900 (depends on ECC level)
- Best practice
- Shorter is better. Use a URL shortener for long URLs.
size
- optional
- Format
- [integer]
- Min.
- 1
- Max.
- 50
- Default
- 10
- Valid examples
- 12, 42
- Invalid examples
- 20x20 (invalid format), 0 (too small), 64 (too large)
ecc
- optional
- Values
- L (low ~7%), M (medium ~15%), Q (quality ~25%), H (high ~30%)
- Default
- L
- Best practice
- L for general use - old readers cause more problems than damaged QR codes.
color
- optional
- Format
- Hexadecimal 6 characters [a-fA-F0-9]
- Valid examples
- FF0000 (red), 0000ff (blue), 556B2F (olive green)
- Invalid examples
- GG00AA (invalid character), 4ff0a (missing char)
- Default
- 000000 (black)
- Best practice
- Darkest possible color compared to background.
bgcolor
- optional
- Format
- Hexadecimal 6 characters [a-fA-F0-9]
- Valid examples
- FF0000 (red), 0000ff (blue), 556B2F (olive green)
- Invalid examples
- GG00AA (invalid character), 4ff0a (missing char)
- Default
- ffffff (white)
- Best practice
- Lightest possible color compared to pixels.
margin
- optional
- Format
- [integer]
- Min.
- 0
- Max.
- 20
- Default
- 1
- Valid examples
- 1, 12
- Invalid examples
- -1 (negative), 1487 (too large), a (not a number)
logo
- optional
- Format
- [url] of a PNG or JPG image
- Note
- Using ECC M, Q or H recommended as the image covers part of the QR code.
- Invalid examples
- image.png (not a URL), favicon.ico (unsupported format)
style
- optional
- Values
- square, rounded, circle, gapped, vertical, horizontal
- Default
- square
- Description
- Shape of QR code modules (pixels).
- Note
- PNG only - ignored in SVG.
format
- optional
- Values
- png, svg
- Default
- png
- Description
- QR code output format.
- SVG Note
- In SVG mode, size, style and logo parameters are ignored.
watermark
- optional
- Format
- [text]
- Max. characters
- 100
- Description
- Text to display below the QR code.
- Note
- PNG only - ignored in SVG.
- Best practice
- Add your URL or domain name to identify the QR code origin.
2. Command create-totp-qr-code
The create-totp-qr-code command generates a QR code in otpauth://totp/ format for two-factor authentication (2FA).
Endpoint: /api/v1/create-totp-qr-code/ - GET method
QR code parameters (size, ecc, color, bgcolor, margin, logo, style, watermark) are identical to those of create-qr-code.
2.1 TOTP Parameters
issuer
- required
- Description
- Service / issuer name (e.g.: MyService, GitHub).
account
- required
- Description
- Account identifier (e.g.: user@example.com).
secret
- required
- Format
- Secret key encoded in base32 (e.g.: JBSWY3DPEHPK3PXP).
algorithm
- optional
- Values
- SHA1, SHA256, SHA512
- Default
- SHA1
digits
- optional
- Values
- 6, 8
- Default
- 6
period
- optional
- Format
- [integer] in seconds
- Default
- 30