Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/dadu0699/qr-code/llms.txt

Use this file to discover all available pages before exploring further.

QR Code Generator is a lightweight service that converts any HTTP or HTTPS URL into an SVG QR code through a simple REST API. It runs on Cloudflare Workers using Astro’s server-side rendering adapter, giving you globally distributed, low-latency QR code generation with no cold starts.

Introduction

Learn what QR Code Generator does, how it works, and when to use it.

Quickstart

Make your first API call and get an SVG QR code in under five minutes.

API Reference

Full documentation for every endpoint, parameter, and response schema.

Deploy to Cloudflare

Step-by-step guide to deploying your own instance with Wrangler.

How it works

The service exposes two API endpoints built as Astro Server Endpoints running on the Cloudflare Workers runtime:
  1. POST /api/qr/generate — Accepts a JSON body with a url field (and an optional color object), validates the input, and returns an image/svg+xml response containing the QR code.
  2. GET /api/health-check.json — Returns a simple JSON payload confirming the service is running.
Both endpoints support CORS via a configurable ALLOWED_ORIGINS environment variable and respond to OPTIONS preflight requests.
1

Deploy or run locally

Clone the repository and run pnpm install && pnpm dev, or deploy your own instance to Cloudflare Workers with pnpm publish.
2

Send a POST request

Call POST /api/qr/generate with a JSON body containing the URL you want to encode.
3

Receive an SVG

The response is an image/svg+xml document you can embed directly in a web page, save as a file, or display in an <img> tag.
4

Customize colors

Pass an optional color object with dark and light hex values to brand the QR code to your design.

Key features

SVG output

QR codes are returned as scalable SVG — sharp at any resolution, easy to inline or save.

Custom colors

Override foreground and background colors with any valid hex value (3, 4, 6, or 8 digits).

CORS support

Configure an allowlist of trusted origins to enable cross-origin API calls from your frontend.

Cloudflare Workers

Runs on the Cloudflare edge network — globally distributed with no server to manage.

Build docs developers (and LLMs) love