← Til baka

Generate QR Codes via API: Free, Fast, No Library Required

· 5 mín lestrartími · Almennt

QR Codes in 2026: Still Everywhere

Restaurant menus, payment links, event tickets, WiFi sharing, app downloads — QR codes are infrastructure now. If you're building any kind of web or mobile app, you'll eventually need to generate them programmatically.

The Old Way: Install a Library

The traditional approach means installing a QR code library for your language:

# Python
pip install qrcode pillow

# Node.js
npm install qrcode

# Go
go get github.com/skip2/go-qrcode

Then you write code to generate, style, and save the QR code. It works, but now you're managing another dependency, handling image processing on your server, and dealing with edge cases like encoding special characters.

The API Way: One GET Request

With the Pandan QR API, generating a QR code is a single HTTP request:

GET https://qr.pandan.is/v1/qr?data=https://example.com

That returns a PNG image. Done. No libraries, no dependencies, no image processing.

Output Formats

PNG (default)

https://qr.pandan.is/v1/qr?data=Hello+World&format=png&size=400

SVG (scalable, smaller file)

https://qr.pandan.is/v1/qr?data=Hello+World&format=svg

Base64 (embed directly in HTML/email)

GET https://qr.pandan.is/v1/qr/base64?data=Hello+World

// Returns: { "base64": "data:image/png;base64,iVBOR..." }

Customization

GET https://qr.pandan.is/v1/qr
  ?data=https://mysite.com
  &size=500           // pixels (default: 300)
  &margin=2           // quiet zone modules (default: 4)
  &dark=2563eb        // foreground color hex (default: 000000)
  &light=ffffff       // background color hex (default: ffffff)
  &format=png         // png or svg

Real-World Examples

Dynamic HTML QR Code

<!-- Embed directly in your HTML -->
<img src="https://qr.pandan.is/v1/qr?data=https://myapp.com/download&size=200" 
     alt="Download our app" />

Node.js: Generate and Email

const response = await fetch(
  'https://qr.pandan.is/v1/qr/base64?data=https://ticket.example.com/abc123'
);
const { base64 } = await response.json();
// Embed base64 in email template
const emailHtml = `<img src="${base64}" alt="Your ticket QR code" />`;

Python: Save QR Code File

import requests

response = requests.get(
    'https://qr.pandan.is/v1/qr',
    params={'data': 'https://example.com', 'size': 400, 'format': 'png'}
)
with open('qr.png', 'wb') as f:
    f.write(response.content)

WiFi QR Code

# Standard WiFi QR format
curl "https://qr.pandan.is/v1/qr?data=WIFI:S:MyNetwork;T:WPA;P:MyPassword;;" -o wifi-qr.png

Pricing

The API is free for up to 200 QR codes per month — enough for most side projects and small apps. No signup, no API key needed for the free tier.

TierPriceQR Codes/mo
Free$0200
Pro$5/mo5,000
Business$19/moUnlimited

Why Use an API Instead of a Library?

Try it now: qr.pandan.is