QR Code Playground

Test the QRMint API live before adding it to your Python project. No API key needed.

Gradient Foreground

PNG, JPG, or WebP. Logo is embedded in the center of the QR code. Use High error correction for best results.

🐍

Your QR code will appear here

Enter a URL and click "Generate"

How to Generate QR Codes in Python

Three practical examples — from a one-liner to batch generation for production workflows.

QRMint exposes a free REST API at https://qrmint.dev/api/v1/generate. From Python, all you need is the requests library — no additional QR code packages, no local image processing dependencies. The API accepts query parameters, returns a binary PNG or SVG, and supports every styling option available in the playground above.

Example 1 — Basic QR Code

The minimal integration: generate a URL QR code and save it as a PNG file.

Python
import requests

response = requests.get("https://qrmint.dev/api/v1/generate",
    params={"type": "url", "data": "https://example.com", "size": 512})

with open("qrcode.png", "wb") as f:
    f.write(response.content)

Example 2 — Styled QR Code with Custom Colors and Logo

Add brand colors, a gradient foreground, and embed a logo image from disk.

Python
import requests

params = {
    "type": "url",
    "data": "https://example.com",
    "size": 1024,
    "fg_color": "#ff00aa",
    "bg_color": "#0a0a0f",
    "dot_style": "rounded",
    "eye_style": "rounded",
    "error_correction": "H",
    "format": "png",
}

files = {"logo": open("logo.png", "rb")}
response = requests.post(
    "https://qrmint.dev/api/v1/generate", params=params, files=files)

with open("branded_qrcode.png", "wb") as f:
    f.write(response.content)

Example 3 — Batch Generation

Generate QR codes for a list of URLs and save them with descriptive filenames.

Python
import requests, re

BASE_URL = "https://qrmint.dev/api/v1/generate"

urls = [
    "https://example.com/product-a",
    "https://example.com/product-b",
    "https://example.com/product-c",
]

for url in urls:
    resp = requests.get(BASE_URL,
        params={"type": "url", "data": url, "size": 512, "dot_style": "dots"})
    slug = re.sub(r"[^a-z0-9]+", "-", url.split("/")[-1])
    with open(f"qr_{slug}.png", "wb") as f:
        f.write(resp.content)
    print(f"Saved qr_{slug}.png")

For the full list of query parameters — including gradient colors, frame templates, SVG output, and error correction levels — see the API documentation.

QRMint API vs qrcode Library

How the REST API approach compares to the popular qrcode Python package.

Feature QRMint API qrcode Library
Custom colors ✓ Full RGB support ✓ Basic
Logo embedding ✓ Built-in ✗ Manual (Pillow)
Gradient foreground ✓ Linear & radial ✗ Not supported
SVG output ✓ Native ✓ With svgwrite
No installation needed ✓ REST API only ✗ pip install required
Batch generation ✓ Loop over endpoints ✓ Loop locally

How to Use the Python API

Three steps from zero to a generated QR code in your Python project.

1. Install requests

The only dependency is the requests library. Run pip install requests in your project environment. If you are using a serverless function or a Docker container, requests is likely already present. No QR-specific packages needed.

2. Call the API

Send a GET or POST request to https://qrmint.dev/api/v1/generate with your QR type and data as query parameters. Add optional style parameters for colors, dot style, eye shape, size, and format. No authentication header is required — the API is public and free.

3. Save the Image

The API returns binary image data directly in the response body. Write response.content to a file with open(..., "wb") to save as PNG or SVG. You can also pass the bytes directly to Pillow, Flask's send_file, or any other image processing pipeline without touching disk.

Why Use QRMint in Python

The fastest path from Python code to a production-ready QR code image.

📦

Zero Dependencies

No qrcode, Pillow, cairosvg, or other rendering libraries to install and maintain. Just requests — or any HTTP client of your choice. Perfect for serverless functions, minimal Docker images, and constrained environments.

🎨

Full Styling API

Pass color codes, gradient parameters, dot styles, eye shapes, frame templates, and logo files as parameters. Every option in the playground is available via the API, giving you complete design control from Python without any client-side rendering.

🔄

Batch Generation

Loop over a list of URLs, contacts, or WiFi credentials and generate a unique styled QR code for each item in seconds. Ideal for e-commerce product pages, event ticketing systems, restaurant menus, and marketing campaign assets.

🖼

Multiple Output Formats

Request PNG for standard raster output or SVG for infinitely scalable vector output. PNG supports sizes up to 2048×2048 px. SVG is ideal for PDF generation pipelines, laser cutting templates, or any workflow where vector graphics are required.

Python QR Code API FAQ

Do I need to install any Python library to use QRMint?

The only library you need is requests, which is available via pip install requests and is already present in most Python environments. You do not need qrcode, Pillow, or any other image or QR code package. QRMint handles all rendering server-side and returns the finished image as binary data in the HTTP response.

Can I generate styled QR codes with Python?

Yes. The QRMint API supports full styling through query parameters: fg_color, bg_color, dot_style (square, rounded, dots, classy-rounded), eye_style, gradient colors and types, and frame templates. You can also upload a logo image using a multipart POST request. See Example 2 above or the API documentation for the complete parameter list.

How do I generate QR codes in bulk with Python?

Loop over your list of items and call the API for each one, as shown in Example 3 above. The API has no rate limit for reasonable usage. For very large batches (thousands of codes), consider adding a short delay between requests with time.sleep(0.1) or using concurrent.futures.ThreadPoolExecutor to parallelize requests while respecting fair-use limits.

Is the QRMint API free for commercial use?

Yes. QRMint is free forever with no API key, no usage tiers, and no commercial restrictions. You can generate QR codes for your SaaS product, e-commerce store, marketing campaigns, or any other commercial project at no cost. The service is provided by SoftVoyagers as a free developer tool.

Can I use QRMint with Flask or Django?

Yes. Both frameworks work perfectly. In Flask, you can call the QRMint API inside a route and stream the image response directly to the client using flask.send_file(io.BytesIO(response.content), mimetype="image/png"). In Django, use HttpResponse(response.content, content_type="image/png"). No temporary files needed — the binary data can be passed in memory directly from the API response to the HTTP response.

Need QR codes for other content types? QRMint also generates WiFi, vCard, Email, SMS, Location, Event, and Payment QR codes — all free, no signup, with the same full styling API.

Start Generating QR Codes with Python

Free forever. No signup. No API key. One HTTP request is all it takes.

Try the API Now →
Part of the SoftVoyagers Ecosystem