QR Code Generator API

Generate QR codes as PNG or SVG with one GET request: URLs, text, WiFi logins, vCards, e-mail, SMS, phone and geo links. Custom colours, size and ECC.

GETPOSThttps://apibox.io.vn/v1/qr
Images & Codes▶ Try it online

The QR Code API turns any text or URL into a QR code image. Call GET /v1/qr?text=... and you get a PNG back (or an SVG with format=svg), ready to use directly in an <img> tag, an e-mail or a print template. With format=json you get the encoded data, the QR version, the module count, the SVG markup and a base64 PNG in one JSON response.

Besides plain text, the type parameter builds the standard payloads that phone cameras understand: wifi (ssid, password, encryption, hidden), vcard (first_name, last_name, org, title, phone, email, website, address), email (to, subject, body), sms (phone, message), tel (phone) and geo (lat, lng). You no longer have to remember the WIFI:T:WPA;S:...;; syntax or escape special characters yourself.

You control the size (64–2000 px, default 300), the quiet-zone margin (0–20 modules, default 4), the foreground and background colours (hex such as 1e90ff or a basic colour name) and the error-correction level ecc (L, M, Q, H; default M). PNG output uses whole pixels per module, so the image can be a few pixels smaller than the requested size to stay perfectly sharp. The encoded data is limited to about 2,900 characters.

Parameters

NameInTypeRequiredDefault
textbody|querystringyesText or URL to encode (aliases: data, url). Required when type is text (default). Max ~2,900 characters.
typebody|querystringnotextPayload type: text, wifi, vcard, email, sms, tel or geo.
formatbody|querystringnopngpng (image), svg (image) or json (data, version, modules, ecc, svg, png_base64).
sizebody|querynumberno300Image width/height in pixels, 64–2000.
marginbody|querynumberno4Quiet zone around the code, in modules (0–20).
colorbody|querystringno000000Foreground colour: hex (1e90ff, #333) or black, white, red, green, blue, gray.
backgroundbody|querystringnoffffffBackground colour (same formats as color).
eccbody|querystringnoMError correction level: L, M, Q or H.
ssidbody|querystringnotype=wifi: network name. Also password, encryption (WPA, WEP, nopass; default WPA) and hidden (true/false).
first_namebody|querystringnotype=vcard: contact fields first_name, last_name, org, title, phone, email, website, address.
tobody|querystringnotype=email: recipient, with optional subject and body.
phonebody|querystringnotype=tel or sms: phone number (sms also takes message); also used by vcard.
latbody|querynumbernotype=geo: latitude, with lng for the longitude.

Example

curl "https://apibox.io.vn/v1/qr?text=https://apibox.io.vn&size=300&color=1e3a8a" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -o output

Response

binary image/png (QR code, 297×297 px)

Use cases

  • Print QR codes on invoices, tickets and product labels
  • Let café or hotel guests join the WiFi by scanning a code
  • Add a vCard QR code to business cards and e-mail signatures
  • Generate payment or tracking links on the fly in a web app

FAQ

Can I use the QR code URL directly in an <img> tag?

Yes. A GET request returns the image itself (image/png or image/svg+xml) with a one-day cache header. Keep in mind that the request must carry your API key, so for public pages it is better to generate the image on your server and store it.

How do I create a WiFi QR code?

Call /v1/qr?type=wifi&ssid=MyCafe&password=secret123. Optional: encryption=WPA|WEP|nopass (default WPA) and hidden=true for a hidden network. The API escapes special characters in the SSID and password for you.

Which error correction level should I choose?

M (15% recovery) is the default and fine for most cases. Use Q or H (25–30%) if the code will be printed small, may get dirty, or if you want to place a logo over its centre; L gives the smallest code for long URLs.

Related APIs

Start with 1,000 free requests every month. Get free API key →