QR Code
Generate a styled QR code via GET. Output: SVG (default) or PNG. Supports dot styles, gradients, custom corners and all QR versions.
Credit cost: 3 credits per call
Query Parameters
Data to encode in the QR code. Examples:
URL: https://chartquery.com
Email: mailto:[email protected]
Phone: tel:+1234567890
SMS: SMSTO:+1234567890:Hello!
WiFi: WIFI:T:WPA;S:MyNetwork;P:secret123;;
Geo: geo:48.8566,2.3522
Plain text: Hello from ChartQuery!
vCard: BEGIN:VCARD VERSION:3.0 FN:John Doe EMAIL:[email protected] END:VCARD
Output size in pixels (width = height). Default: 200. Examples: ?size=200 (thumbnail), ?size=300 (standard), ?size=400 (large), ?size=600 (poster). For print, use the unit param with mm/cm instead.
Error correction level. Default: M. Higher levels allow more damage/obscuring before the code becomes unreadable.
- L (7%): smallest size, minimal redundancy, best for clean environments
- M (15%): balanced, good for most use cases
- Q (25%), for outdoor or rough surfaces
- H (30%): required when adding a logo or image overlay
Example: ?ec_level=H
"M"Value in
- "L"
- "M"
- "Q"
- "H"
Module (dot) shape. Default: square. Controls the visual style of each QR code module.
square: classic, maximum compatibilityrounded: softer edges, clean modern lookdots: fully circular modules, artisticdiamond: angular styleclassy: elegant angular cornersclassy-rounded: classy with rounded tipsextra-rounded: large pill-shaped modulessmall-square/tiny-square: spaced square modulesvertical-line/horizontal-line: striped effect
Example: ?dot_type=rounded
"square"Value in
- "square"
- "rounded"
- "dots"
- "diamond"
- "classy"
- "classy-rounded"
- "extra-rounded"
- "vertical-line"
- "horizontal-line"
- "small-square"
- "tiny-square"
Module color as CSS hex. Default: #000. Examples: ?color=%236366f1 (indigo), ?color=%23dc2626 (red), ?color=%23059669 (green), ?color=%230891b2 (teal). Use %23 to URL-encode #. For gradient objects, use POST instead.
Overall QR code shape. Default: square. Use circle to clip the entire QR into a circle: great for profile/avatar-style codes. Example: ?shape=circle&dot_type=dots
"square"Value in
- "square"
- "circle"
Module size ratio between 0.1 and 1. Default: 1 (full). Values below 1 add spacing between modules for a lighter look. Example: ?dot_size=0.85
Background color. Default: #fff. Set to transparent for no background. Example: ?background=%230f172a for dark background. Use %23 to encode #.
Quiet zone width in modules around the QR code. Default: 4. Minimum recommended by the QR standard: 4. Example: ?margin=2 (compact) or ?margin=6 (extra padding).
QR version from 1 to 40 (determines grid size and data capacity). Leave unset for auto-selection based on data length and ec_level. Example: ?version=5
Encoding mode. Default: auto (best mode selected for the data). Use numeric for digits-only, alphanumeric for uppercase + digits, byte for arbitrary text/UTF-8. Example: ?mode=numeric
"auto"Value in
- "auto"
- "numeric"
- "alphanumeric"
- "byte"
Mask pattern from 0 to 7. Default: auto (best mask selected to minimize visual patterns). Only set manually if you need a deterministic output. Example: ?mask=3
Measurement unit for the size param. Default: px. Use mm, in or cm with the size param for print-ready output. Example: ?size=50&unit=mm
"px"Value in
- "px"
- "mm"
- "in"
- "cm"
Prepend an XML declaration () to the SVG output. Useful when the SVG will be used as a standalone XML file. Default: false. Example: ?xml_declaration=true
Accessible label added as aria-label on the SVG element. Example: ?aria_label=QR+code+linking+to+chartquery.com
SVG element shown as a browser tooltip and used by screen readers. Example: ?title=ChartQuery+Website
SVG element for extended accessibility description. Example: ?desc=Scan+to+visit+https://chartquery.com
Output format. Default: svg. Use png to get a raster image. SVG is lossless and scalable; PNG is pixel-based and suitable for email, PDF or messaging. Example: ?format=png
"svg"Value in
- "svg"
- "png"
Response Body
application/json
application/json
curl -X GET "https://example.com/v1/qrcode?data=string"{ "error": "Bad Request"}{ "error": "Internal Error"}