DDiwigo API

Free QR Code Generator API

QR code for a URL or any text, as SVG (default) or PNG. Ready to use in an <img> tag.

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

ParameterDescription
keyYour API key (required)
qrText or URL to encode (max 2,000 characters)
sizeWidth in pixels, 64–2048 (default 300)
formatsvg or png (default svg)
eccError correction L, M, Q or H (default M)
marginQuiet zone in modules, 0–10 (default 4)
color / bgHex colours (default 000000 / ffffff)

Code examples

cURL
curl "https://landing.diwigo.com/api/?key=YOUR_API_KEY&qr=https://landing.diwigo.com&size=300" -o result.svg
HTML
<img src="https://landing.diwigo.com/api/?key=YOUR_API_KEY&qr=https://landing.diwigo.com&size=300" alt="QR code">
JavaScript
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
<?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);
Python
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.