What is it?
The Diwigo QR code API turns any URL or text into a QR code image (SVG or PNG) with one GET request, ready to use in an <img> tag.
It answers with SVG or PNG image and is included in the free plan: 10,000 requests per API key and per month.
Example request
GET https://landing.diwigo.com/api/?key=YOUR_API_KEY&qr=https://landing.diwigo.com&size=300
Parameters
| Parameter | Description |
|---|---|
key | Your API key (required) |
qr | Text or URL to encode (max 2,000 characters) |
size | Width in pixels, 64–2048 (default 300) |
format | svg or png (default svg) |
ecc | Error correction L, M, Q or H (default M) |
margin | Quiet zone in modules, 0–10 (default 4) |
color / bg | Hex colours (default 000000 / ffffff) |
Code examples
curl "https://landing.diwigo.com/api/?key=YOUR_API_KEY&qr=https://landing.diwigo.com&size=300" -o result.svg
<img src="https://landing.diwigo.com/api/?key=YOUR_API_KEY&qr=https://landing.diwigo.com&size=300" alt="QR code">
const img = new Image();
img.src = "https://landing.diwigo.com/api/?key=YOUR_API_KEY&qr=https://landing.diwigo.com&size=300";
img.alt = "QR code";
document.body.append(img);
<?php
$response = file_get_contents("https://landing.diwigo.com/api/?key=YOUR_API_KEY&qr=https://landing.diwigo.com&size=300");
file_put_contents("result", $response);
import requests
response = requests.get("https://landing.diwigo.com/api/?key=YOUR_API_KEY&qr=https://landing.diwigo.com&size=300")
open("result", "wb").write(response.content)
Use cases
- Print a QR code linking to a product page or a menu
- Add a "scan to open on your phone" code to any page
- Generate tickets, vouchers or Wi-Fi codes on the fly
QR code: questions and answers
What does the QR code API do?
The Diwigo QR code API turns any URL or text into a QR code image (SVG or PNG) with one GET request, ready to use in an <img> tag.
How do I call the QR code API?
Send a GET request to https://landing.diwigo.com/api/?key=YOUR_API_KEY&qr=https://landing.diwigo.com&size=300 with your own API key instead of YOUR_API_KEY. It answers with SVG or PNG image.
Is the QR code API free?
Yes, it is included in the free plan: 10,000 requests per API key and per calendar month, shared by all Diwigo endpoints. Higher limits are available on request.