DEV Community

Olly
Olly

Posted on

Generate QR codes, Wi-Fi QR codes and barcodes from a URL (no library needed)

Sometimes you just need a QR code in an email, a PDF ticket or a no-code tool, and you don't want to bundle a library. With QRKit it's one GET request, and you get back a PNG or SVG.

A QR code in one GET

import requests
H = {"X-RapidAPI-Key": KEY, "X-RapidAPI-Host": "qrkit-qr-code-barcode-generator.p.rapidapi.com"}
png = requests.get("https://qrkit-qr-code-barcode-generator.p.rapidapi.com/qr",
                   params={"data": "https://example.com", "size": 300, "format": "png"}, headers=H).content
open("qr.png", "wb").write(png)
Enter fullscreen mode Exit fullscreen mode

Options: format (png/svg), size, color, bg, margin, ecc (error correction), and transparent.

Wi-Fi login QR for cafés and Airbnbs

/qr/wifi?ssid=CafeGuest&password=coffee123&security=WPA
Enter fullscreen mode Exit fullscreen mode

Guests scan it and they're on the network. No typing.

Contact card QR (vCard)

/qr/vcard?name=Jane Doe&phone=+447700900123&email=jane@example.com&org=Acme
Enter fullscreen mode Exit fullscreen mode

Barcodes

/barcode?type=ean13&data=400638133393 also supports Code128, UPC-A, ISBN, ISSN, ITF and PZN, with an optional human-readable label.

Free tier: 500 calls/month. QRKit on RapidAPI

Top comments (0)