QR Code Generator
Generate QR codes with custom colors, sizes, and optional logo overlay.
GET
/v1/qrGenerates a QR code image for any text or URL. Customize the foreground and background colors, size, error correction level, and optionally overlay a logo image in the center.
Authentication
Requires x-api-key header.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| data | string | Yes | - | The text or URL to encode in the QR code. |
| size | integer | No | 300 | Output image size in pixels (50-2000). |
| format | string | No | png | Output format: png or svg. |
| fg_color | string | No | 000000 | Foreground (module) color as a hex string. |
| bg_color | string | No | ffffff | Background color as a hex string. |
| error_correction | string | No | M | Error correction level: L, M, Q, or H. |
| logo_url | string | No | - | URL of a logo image to overlay in the center (requires error_correction H). |
Example Request
-blue-400 font-semibold">curl -X GET -emerald--amber-400">400">"https://api.aicores.io/v1/qr?data=https://aicores.io&size=-amber-400">400&fg_color=3b82f6&bg_color=0f172a" \
-H -emerald--amber-400">400">"x-api-key: sk_live_your_key_here" \
--output qrcode.pngResponse
Returns the QR code as binary image data (image/png or image/svg+xml).
Error Codes
| Status | Error | Description |
|---|---|---|
| 400 | missing_data | The data parameter is required. |
| 400 | invalid_size | Size must be between 50 and 2000. |
| 400 | invalid_color | Color must be a valid 6-character hex string. |
| 401 | unauthorized | Missing or invalid API key. |
| 429 | rate_limit_exceeded | Too many requests. |