Skip to content

Quick Start

Generate your first QR code in under 5 minutes.

Step 1: Get Your API Key

  1. Go to qrcodeapi.io
  2. Choose a plan (Free tier includes 1,000 QR codes/month)
  3. Create an account
  4. Copy your API key from the dashboard

Step 2: Generate a QR Code

Using cURL

bash
curl "https://www.qrcodeapi.io/api/generate?data=https://example.com" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -o qr.png

Using JavaScript

javascript
const response = await fetch(
  'https://www.qrcodeapi.io/api/generate?data=https://example.com',
  {
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY'
    }
  }
);

const blob = await response.blob();
const url = URL.createObjectURL(blob);
document.getElementById('qr').src = url;

Using Python

python
import requests

response = requests.get(
    'https://www.qrcodeapi.io/api/generate',
    params={'data': 'https://example.com'},
    headers={'Authorization': 'Bearer YOUR_API_KEY'}
)

with open('qr.png', 'wb') as f:
    f.write(response.content)

Using Node.js

javascript
const fs = require('fs');
const https = require('https');

const url = 'https://www.qrcodeapi.io/api/generate?data=https://example.com';
const options = {
  headers: { 'Authorization': 'Bearer YOUR_API_KEY' }
};

https.get(url, options, (res) => {
  const file = fs.createWriteStream('qr.png');
  res.pipe(file);
});

Step 3: Customize Your QR Code

Add parameters to customize your QR code:

bash
curl "https://www.qrcodeapi.io/api/generate" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -G \
  --data-urlencode "data=https://example.com" \
  --data "size=500" \
  --data "color=4F46E5" \
  --data "background=F3F4F6" \
  --data "format=svg" \
  -o qr.svg

Available Parameters

ParameterDescriptionDefault
dataContent to encode (required)-
sizeImage size in pixels (50-2000)300
formatOutput format (png or svg)png
colorQR code color (hex)000000
backgroundBackground color (hex)ffffff
errorCorrectionError correction level (L/M/Q/H)M
marginQuiet zone margin (0-10)4

Step 4: Create a Dynamic QR Code (Optional)

Dynamic QR codes let you change the destination URL without reprinting:

bash
# Create a dynamic link
curl -X POST "https://www.qrcodeapi.io/api/links" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "My Campaign",
    "targetUrl": "https://example.com/landing"
  }'

# Response includes shortCode
# {"id": "...", "shortCode": "abc123", "targetUrl": "..."}

# Generate QR code for the short link
curl "https://www.qrcodeapi.io/api/generate" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -G \
  --data-urlencode "data=https://www.qrcodeapi.io/r/abc123" \
  -o dynamic-qr.png

Next Steps

Need Help?