Home / APIs / QR Code Generator

QR Code Generator API

Generate QR codes as PNG, SVG, or data URI — custom size, colors, margin, and error correction.

Get it on RapidAPI ↗

Turn any text or URL into a QR code over a single, fast API call — returned as a PNG image, a scalable SVG, or a base64 data URI you can drop straight into an tag. Stateless, no SDK, no signup.

Customize the size, quiet-zone margin, error-correction level (L/M/Q/H), and foreground/background colors. Perfect for tickets, menus, business cards, 2FA setup, inventory labels, and link sharing.

Endpoints

MethodPathDescription
GET/qr/generate?data=&format=PNG, SVG, or data-URI QR code
POST/qr/generateSame, with a JSON body (for long data)

Quick start

cURL (via RapidAPI)
curl --url 'https://qr-code-generator216.p.rapidapi.com/generate?data=https://abundanceapis.com&format=datauri' \
  --header 'X-RapidAPI-Key: YOUR_KEY' \
  --header 'X-RapidAPI-Host: qr-code-generator216.p.rapidapi.com'
JavaScript (fetch)
const res = await fetch('https://qr-code-generator216.p.rapidapi.com/generate?data=https://abundanceapis.com&format=datauri', {
  headers: {
    'X-RapidAPI-Key': 'YOUR_KEY',
    'X-RapidAPI-Host': 'qr-code-generator216.p.rapidapi.com'
  }
});
const data = await res.json();
Example response
{
  "format": "png",
  "dataUri": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..."
}

Pricing

Subscribe on RapidAPI. Start free; upgrade as you scale.

Basic
Free
1,000 requests / mo
Pro
$5 / mo
100,000 requests / mo
Ultra
$20 / mo
1,000,000 requests / mo
Mega
$50 / mo
2,000,000 requests / mo

Frequently asked questions

What output formats are supported?

format=png returns a PNG image, format=svg returns a scalable SVG, and format=datauri returns JSON with a base64 data URI ready for an src.

Can I customize colors and size?

Yes — set size (64–2000px), margin (0–20), ecc (L/M/Q/H), and dark/light hex colors.

Is there a limit on the data length?

Up to 2,000 characters per QR code, which covers URLs, vCards, Wi-Fi configs, and most payloads.

Ready to build with QR Code Generator?

Grab your key on RapidAPI and start on the free tier.

Get it on RapidAPI ↗