QR Code API: how to integrate generation into your web app
Guide with curl examples to create, manage and download dynamic QR codes via REST API
The codigo-qr.es REST API lets you generate, update and analyze QR codes directly from your application, without going through the dashboard. You can automate QR creation for invoices, digital menus or event tickets, and change the destination of a dynamic QR in production without touching the printed code. The public endpoint works without sign-up. The full API, with CRUD and statistics, requires a Pro plan.
What endpoints does the QR code API have?
The REST API has eight endpoints: public generation without auth, and seven Pro ones to create, list, update, delete, download and analyze QR codes.
The codigo-qr.es API has two tiers.
Public endpoint (no account needed):
`POST /api/v1/qr/render` generates a static QR and returns the image in base64. Limit: 50 requests per day per IP.
Pro endpoints (require API key):
| Method | Path | Purpose | |--------|------|---------| | `GET` | `/api/v1/qr` | List all your QR codes | | `POST` | `/api/v1/qr` | Create a static or dynamic QR | | `GET` | `/api/v1/qr/{id}` | Get QR details | | `PATCH` | `/api/v1/qr/{id}` | Update destination or name | | `DELETE` | `/api/v1/qr/{id}` | Delete a QR | | `GET` | `/api/v1/qr/{id}/image` | Download PNG or SVG image | | `GET` | `/api/v1/qr/{id}/stats` | Scan statistics |
All Pro responses follow `{ "data": {...}, "error": null }`. On error, `data` is null and `error` contains `code` and `message`.
How do I get a QR API key?
The API key is generated in /panel/account with one click. It is only available with an active Pro plan and can be revoked from the same panel.
Step 1. Create an account at codigo-qr.es.
Step 2. Activate the Pro plan. The full API is Pro-exclusive at €5.99/month.
Step 3. Go to /panel/account and click Generate API key. The token is shown only once. Save it in a password manager or environment variable.
Add this header to every request:
```bash curl https://codigo-qr.es/api/v1/qr \ -H "Authorization: Bearer cqr_your_token_here" ```
If the key is invalid or the plan has expired, the API returns `401 UNAUTHORIZED` or `403 PLAN_REQUIRED`. You can revoke the key at any time from the dashboard; it stops working immediately.
How do I generate a QR code via API without sign-up?
The /api/v1/qr/render endpoint generates QR PNG or SVG without an account or API key, limited to 50 requests per day per IP.
The public endpoint is the fastest way to test the API or generate simple QR codes from a script without managing authentication:
```bash curl -X POST https://codigo-qr.es/api/v1/qr/render \ -H "Content-Type: application/json" \ -d '{"value":"https://yourdomain.com","format":"png","size":512}' ```
Parameters:
- `value` (required): the QR content. Can be a URL, text, email, WiFi data...
• `format`: `"png"` (default) or `"svg"`
• `size`: `256`, `512` (default) or `1024`
The response returns the image in base64 inside a JSON envelope:
```json { "data": { "image": "iVBORw0KGgo...", "format": "png", "size": 512 }, "error": null } ```
If you exceed 50 requests per day from the same IP, you get `429 RATE_LIMITED` with the `Retry-After` header indicating when the counter resets.
How do I create and update dynamic QR codes via API?
POST /api/v1/qr creates the dynamic QR and returns its ID. PATCH /api/v1/qr/{id} changes the destination without regenerating or reprinting the code.
A dynamic QR encodes a fixed short URL (`/r/{slug}`) but its final destination can be changed whenever you want. The printed code never changes.
Create a dynamic QR:
```bash curl -X POST https://codigo-qr.es/api/v1/qr \ -H "Authorization: Bearer cqr_your_token" \ -H "Content-Type: application/json" \ -d '{ "label": "May restaurant menu", "type": "url", "value": "https://yourrestaurant.com/menu-may", "is_dynamic": true, "tracking_mode": "redirect" }' ```
Change the destination without reprinting:
```bash curl -X PATCH https://codigo-qr.es/api/v1/qr/{id} \ -H "Authorization: Bearer cqr_your_token" \ -H "Content-Type: application/json" \ -d '{"destination": "https://yourrestaurant.com/menu-june"}' ```
Download the QR image:
```bash curl -o my-qr.png \ "https://codigo-qr.es/api/v1/qr/{id}/image?format=png&size=1024" \ -H "Authorization: Bearer cqr_your_token" ```
View scan statistics:
```bash curl "https://codigo-qr.es/api/v1/qr/{id}/stats?period=30d" \ -H "Authorization: Bearer cqr_your_token" ```
What is the QR API used for in a business?
The QR API is useful when you need to generate or update more than ten codes a month: invoices, digital menus or ticketing systems.
The API is the right tool when volume or automation make it impractical to generate QR codes manually from the dashboard.
E-commerce: QR codes on delivery notes and invoices
The ERP generates the delivery note PDF. With a call to `POST /api/v1/qr`, it gets a QR pointing to the order tracking URL. If the URL changes, `PATCH /api/v1/qr/{id}` updates the destination without regenerating or reprinting anything.
Restaurants: table menu from the POS
The POS creates a QR per table when the shift opens. It points to the day's menu, which the chef updates in the CMS. The QR on the table never changes; the destination does. No more laminating new menus every week.
Events: personalized tickets in bulk
A ticketing system generates a unique QR per ticket with `POST /api/v1/qr` and embeds it in the PDF. At the door, the scanner verifies the QR by reading `GET /api/v1/qr/{id}` to confirm it is valid.
Logistics: packages with tracking
Each package gets a QR pointing to its tracking page. The customer scans from the envelope and sees the delivery status in real time. Scans are logged in `GET /api/v1/qr/{id}/stats`.
How many requests does the QR API allow?
The public endpoint accepts 50 requests per day per IP. Pro endpoints allow 60 requests per minute per user with an API key.
The API applies rate limits to ensure availability for all users.
Public tier (`/api/v1/qr/render`):
• Limit: 50 requests per day per IP
• Window: 24 hours
• No registration required
Pro tier (endpoints with API key):
• Limit: 60 requests per minute per user
• No daily total limit
When you exceed the limit, the API returns `429 Too Many Requests` with these headers:
``` X-RateLimit-Limit: 60 X-RateLimit-Remaining: 0 X-RateLimit-Reset: 1747612800 Retry-After: 43 ```
See the full API documentation for all parameters and error responses.
§CODIGO-QR.ES / PRO
Start integrating the QR API today
Create your account, activate the Pro plan and generate your first API key in under 2 minutes.
Preguntas frecuentes
- Is the QR code API free?
- The public endpoint (/api/v1/qr/render) is free, with a limit of 50 requests per day per IP. The full API, with API key, CRUD, image and statistics, requires a Pro plan at €5.99/month.
- Are QR codes generated via API scannable by any reader?
- Yes. The codes follow the ISO/IEC 18004 standard. They work with a phone camera and any QR reading app, regardless of operating system.
- Can I change the destination of a dynamic QR via API without reprinting?
- Exactly. PATCH /api/v1/qr/{id} updates the destination URL at any time. The printed QR code stays the same; only the destination changes.
- Is the API token secure?
- Only the SHA-256 hash of the token is stored, never the token itself. It is shown only once when generated. You can revoke the key from /panel/account at any time; it stops working immediately.
Jose Flores
Fundador de codigo-qr.es · codigo-qr.es
Jose Flores es fundador de codigo-qr.es, herramienta de generación de QR dinámicos y códigos de barras creada en Barcelona en 2026. Especializado en soluciones digitales para pequeños negocios, desarrolla herramientas que permiten a restaurantes, comercios y profesionales digitalizar su comunicación sin infraestructura técnica propia.
Más artículos