QR Creative Aspirant API
v1Generate QR codes programmatically with a simple REST API. Send a POST request, get back a QR image.
Quickstart
curl -X POST https://qr.creativeaspirant.com/api/v1/generate \
-H "Content-Type: application/json" \
-d '{"data":"https://example.com","size":1024}' \
-o qr-code.pngEndpoint
POST
/api/v1/generateSend a JSON body with your QR content and options. Returns the QR code image directly.
Request Body (JSON)
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| data | string | Yes | — | The content to encode in the QR code (URL, text, WiFi config, etc.) |
| size | number | No | 512 | Output image size in pixels (64–4096) |
| margin | number | No | 4 | Quiet zone size in modules |
| errorCorrectionLevel | string | No | M | Error correction: L (7%), M (15%), Q (25%), H (30%) |
| foreground | string | No | #000000 | QR code foreground hex color |
| background | string | No | #ffffff | QR code background hex color |
| format | string | No | png | Output format: png or svg |
| transparent | boolean | No | false | Transparent background (PNG only) |
Response
200 OK
Returns the QR code image with Content-Type: image/png or image/svg+xml
400 Bad Request
Returns JSON: { "error": "description" }
Code Examples
curl
curl -X POST https://qr.creativeaspirant.com/api/v1/generate \
-H "Content-Type: application/json" \
-d '{"data":"https://example.com","size":1024}' \
-o qr-code.pngjavascript
const response = await fetch('/api/v1/generate', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
data: 'https://example.com',
size: 1024,
errorCorrectionLevel: 'H',
foreground: '#2563eb',
}),
});
const blob = await response.blob();
const url = URL.createObjectURL(blob);python
import requests
response = requests.post(
'https://qr.creativeaspirant.com/api/v1/generate',
json={
'data': 'https://example.com',
'size': 1024,
'format': 'svg',
},
)
with open('qr-code.svg', 'wb') as f:
f.write(response.content)Rate Limits
Free Tier
100
requests / hour
Pro (coming soon)
10,000
requests / hour + API key