Every app that needs QR codes eventually reaches for a library. You install qrcode in Node.js, qrcode in Python, chillerlan/php-qrcode in PHP — and suddenly you have a different dependency tree per language, different output formats per platform, and one more thing to maintain.
Forgelab QR Code API handles this with one HTTP call. Generate PNG, SVG, or base64. Decode any QR image. Works from any language, any stack.
Quick start
Get a free API key at forgelab.africa — no credit card required.
Generate a QR code (PNG)
curl -X POST https://www.forgelab.africa/api/qr/generate \
-H "X-API-Key: flqr_your_key" \
-H "Content-Type: application/json" \
-d '{"data": "https://yourapp.com/confirm?token=abc123", "format": "png"}' \
--output qr.png
Generate a QR code (SVG — scales to any size)
curl -X POST https://www.forgelab.africa/api/qr/generate \
-H "X-API-Key: flqr_your_key" \
-H "Content-Type: application/json" \
-d '{"data": "WIFI:T:WPA;S:MyNetwork;P:MyPassword;;", "format": "svg"}'
Get base64 output (embed directly in JSON responses)
curl -X POST https://www.forgelab.africa/api/qr/generate \
-H "X-API-Key: flqr_your_key" \
-H "Content-Type: application/json" \
-d '{"data": "https://yourapp.com", "format": "base64"}'
# Returns: {"qr": "data:image/png;base64,..."}
Decode a QR code from an image
curl -X POST https://www.forgelab.africa/api/qr/decode \
-H "X-API-Key: flqr_your_key" \
-F "image=@scanned_qr.png"
# Returns: {"data": "https://yourapp.com/confirm?token=abc123"}
Node.js examples
Generate and save a QR code
const fs = require('fs');
async function generateQR(data, outputPath) {
const res = await fetch('https://www.forgelab.africa/api/qr/generate', {
method: 'POST',
headers: {
'X-API-Key': process.env.FORGELAB_QR_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({ data, format: 'png' }),
});
if (!res.ok) throw new Error(`QR generation failed: ${res.status}`);
const buffer = Buffer.from(await res.arrayBuffer());
fs.writeFileSync(outputPath, buffer);
}
await generateQR('https://myapp.com/invoice/INV-2024-001', 'invoice-qr.png');
Get base64 to embed in a JSON API response
async function getQRBase64(data) {
const res = await fetch('https://www.forgelab.africa/api/qr/generate', {
method: 'POST',
headers: {
'X-API-Key': process.env.FORGELAB_QR_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({ data, format: 'base64' }),
});
const json = await res.json();
return json.qr; // "data:image/png;base64,..."
}
// Include in your own API response
app.get('/api/invoice/:id', async (req, res) => {
const invoice = await getInvoice(req.params.id);
const qrCode = await getQRBase64(`https://myapp.com/invoice/${invoice.id}`);
res.json({ ...invoice, qrCode });
});
Python example
import requests
import os
def generate_qr(data: str, fmt: str = "png") -> bytes:
response = requests.post(
"https://www.forgelab.africa/api/qr/generate",
headers={
"X-API-Key": os.environ["FORGELAB_QR_KEY"],
"Content-Type": "application/json",
},
json={"data": data, "format": fmt},
)
response.raise_for_status()
return response.content
with open("qr.png", "wb") as f:
f.write(generate_qr("https://yourapp.com/reset?token=xyz"))
Real use cases
E-commerce — Generate a QR code per order so customers can scan and track shipment status without logging in.
Events — Issue digital tickets with unique QR codes. Decode on arrival to verify authenticity.
Restaurant menus — One QR per table linking to the menu URL. Regenerate anytime the menu changes.
Wi-Fi onboarding — Encode SSID and password in QR format (WIFI:T:WPA;S:...;P:...;;) so guests scan instead of type.
Invoice tracking — Embed a QR in generated PDF invoices (pairs naturally with the Forgelab Invoice API) so recipients can scan to view or pay online.
Pricing
| Tier | Price | Calls/month |
|---|---|---|
| Free | $0 | 5 calls |
| Starter | $5/month | 100 calls |
| Pro | $15/month | 1,000 calls |
| Business | $30/month | 10,000 calls |
No credit card required for the free tier. API key issued instantly.
Why use an API instead of a library?
Libraries work fine for simple cases. The API is the better call when:
- You ship in multiple languages and want one integration instead of per-language dependencies
- You run in serverless or edge environments where native binaries are painful
- You want QR generation to scale independently from your main service
- You need both generate and decode in one consistent interface
Get started
Free API key: forgelab.africa
Docs: forgelab.africa/docs
Questions welcome in the comments.
Top comments (0)