Skip to main content

QR Creative Aspirant API

v1

Generate 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.png

Endpoint

POST/api/v1/generate

Send a JSON body with your QR content and options. Returns the QR code image directly.

Request Body (JSON)

ParameterTypeRequiredDefaultDescription
datastringYesThe content to encode in the QR code (URL, text, WiFi config, etc.)
sizenumberNo512Output image size in pixels (64–4096)
marginnumberNo4Quiet zone size in modules
errorCorrectionLevelstringNoMError correction: L (7%), M (15%), Q (25%), H (30%)
foregroundstringNo#000000QR code foreground hex color
backgroundstringNo#ffffffQR code background hex color
formatstringNopngOutput format: png or svg
transparentbooleanNofalseTransparent 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.png

javascript

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