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
data*stringData 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
size?numberOutput 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.
ec_level?stringError 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""L""M""Q""H"dot_type?stringModule (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""square""rounded""dots""diamond""classy""classy-rounded""extra-rounded""vertical-line""horizontal-line""small-square""tiny-square"color?stringModule 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.
shape?stringOverall 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""square""circle"dot_size?numberModule 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?stringBackground color. Default: #fff. Set to transparent for no background. Example: ?background=%230f172a for dark background. Use %23 to encode #.
margin?numberQuiet 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).
version?numberQR 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
mode?stringEncoding 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""auto""numeric""alphanumeric""byte"mask?numberMask 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
unit?stringMeasurement 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""px""mm""in""cm"xml_declaration?booleanPrepend 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
aria_label?stringAccessible label added as aria-label on the SVG element. Example: ?aria_label=QR+code+linking+to+chartquery.com
title?stringSVG element shown as a browser tooltip and used by screen readers. Example: ?title=ChartQuery+Website
desc?stringSVG element for extended accessibility description. Example: ?desc=Scan+to+visit+https://chartquery.com
format?stringOutput 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""svg""png"fields?stringComma-separated list of response fields to return, with dot notation for nested fields (e.g. name,location.city).
is_async?booleanRun the request as a background job: the API answers 202 with a job_id to poll on GET /v1/jobs/{id}.
falsesoft_fail?booleanReturn HTTP 200 even when the request fails; the error is in the error field of the body.
falsecorners?Corner styles: top_left, top_right, bottom_left.
Successful response
response?filebinarycurl -X GET 'https://api.chartquery.com/v1/qrcode?data=string'"string"