edoble QR API
A simple, database-free REST endpoint for generating QR codes on demand. Use it to integrate QR generation into your own apps and services.
Endpoint
GET /api/qrcode
POST /api/qrcodeParameters
| Field | Type | Default | Description |
|---|---|---|---|
| text | string | required | Content to encode (URL, text, etc.) |
| format | string | png | png | svg | base64 |
| size | number | 512 | Image width in px (64–2048) |
| margin | number | 2 | Quiet zone size (0–10) |
| ecc | string | M | Error correction: L | M | Q | H |
| dark | hex color | #202089 | Foreground color |
| light | hex color | #FFFFFF | Background color |
GET example
curl "https://your-domain.vercel.app/api/qrcode?text=https://edoble.com&size=512&dark=%23202089" \
-o qrcode.pngPOST example
curl -X POST https://your-domain.vercel.app/api/qrcode \
-H "Content-Type: application/json" \
-d '{
"text": "https://edoble.com",
"format": "base64",
"size": 512,
"dark": "#202089",
"light": "#FFFFFF"
}'Response
format=png or format=svg return the image directly (image/png or image/svg+xml). format=base64 returns JSON:
{ "dataUrl": "data:image/png;base64,..." }Notes
- No API key required, no database — every request is generated on the fly.
- CORS is enabled for all origins so you can call it from the browser.
- Rate limiting / auth can be added later without changing the response shape.