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.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.
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:POST /api/qr/generate— Accepts a JSON body with aurlfield (and an optionalcolorobject), validates the input, and returns animage/svg+xmlresponse containing the QR code.GET /api/health-check.json— Returns a simple JSON payload confirming the service is running.
ALLOWED_ORIGINS environment variable and respond to OPTIONS preflight requests.
Deploy or run locally
Clone the repository and run
pnpm install && pnpm dev, or deploy your own instance to Cloudflare Workers with pnpm publish.Send a POST request
Call
POST /api/qr/generate with a JSON body containing the URL you want to encode.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.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.