QR Code Generator
Generate QR code images on-the-fly without authentication. This is a public endpoint that accepts parameters via query string (GET) or request body (POST).
Generate QR Code
Generate a QR code image in PNG or SVG format.
GET https://v1.freeqr.io/api/qr.{format}
POST https://v1.freeqr.io/api/qr.{format}
Requires Authentication: No
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
format | string | Yes | Output format: png or svg |
Query Parameters (GET) or Request Body (POST)
| Parameter | Type | Required | Description |
|---|---|---|---|
text | string | No | Data to encode in QR code (max 2048 characters). Defaults to application name if not provided. |
size | integer | No | QR code size. Can be an ImageSize enum value (100, 320, 640, 960, 1280, 1920) or any integer. Default: 640 (MEDIUM). |
margin | integer | No | Margin size in pixels (0-90). Default: 0. |
error_correction | integer | No | Error correction level: 1 (LOW), 2 (MEDIUM), 3 (QUARTILE), 4 (HIGH). Default: 2 (MEDIUM). |
default_block_style | string | No | Default block style name (max 100 characters) |
inner_corner_block_style | string | No | Inner corner block style name (max 100 characters) |
outer_corner_block_style | string | No | Outer corner block style name (max 100 characters) |
background_color | string | No | Background color. See Color Formats for format details. Default: 255,255,255,1 (white). |
foreground_color | string | No | Foreground color. See Color Formats for format details. Default: 0,0,0,1 (black). |
outer_corner_color | string | No | Outer corner color. See Color Formats for format details. |
inner_corner_color | string | No | Inner corner color. See Color Formats for format details. |
logo | string | No | Logo file path or identifier (max 255 characters). Must be a valid image file. |
logo_file_id | string (ULID) | No | Logo file ID (ULID). Must be a valid image file. |
logo_size | integer | No | Logo size percentage (0-30). Only used when logo or logo_file_id is provided. |
frame | string | No | Frame type name (max 100 characters) |
frame_options | object | No | Frame-specific options. Only used when frame is provided. |
download | boolean | No | Force download (adds Content-Disposition header). Use as query parameter: ?download=1 |
ImageSize Values
| Value | Name | Description |
|---|---|---|
100 | TINY | 100 pixels |
320 | SMALL | 320 pixels |
640 | MEDIUM | 640 pixels (default) |
960 | LARGE | 960 pixels |
1280 | XL | 1280 pixels |
1920 | XXL | 1920 pixels |
Error Correction Levels
| Value | Name | Description |
|---|---|---|
1 | LOW | ~7% error correction |
2 | MEDIUM | ~15% error correction (default) |
3 | QUARTILE | ~25% error correction |
4 | HIGH | ~30% error correction |
Examples
Simple QR Code (GET)
curl "https://v1.freeqr.io/api/qr.png?text=Hello%20World&size=640"
QR Code with Custom Colors (POST)
curl -X POST "https://v1.freeqr.io/api/qr.png" \
-H "Content-Type: application/json" \
-d '{
"text": "https://example.com",
"size": 640,
"margin": 4,
"error_correction": 2,
"background_color": "255,255,255,1",
"foreground_color": "0,0,0,1"
}'
QR Code with Gradient (POST)
curl -X POST "https://v1.freeqr.io/api/qr.svg" \
-H "Content-Type: application/json" \
-d '{
"text": "https://example.com",
"size": 960,
"background_color": "linear:0;0;100;100/255,255,255;0/128,128,128;100",
"foreground_color": "radial:50;50;50;50;50/255,0,0;0/0,0,255;100"
}'
QR Code with Logo (POST)
curl -X POST "https://v1.freeqr.io/api/qr.png" \
-H "Content-Type: application/json" \
-d '{
"text": "https://example.com",
"logo_file_id": "01arz3ndektsv4rrffq69g5fav",
"logo_size": 20
}'
Download QR Code
curl "https://v1.freeqr.io/api/qr.png?text=Hello&download=1" -o qrcode.png
Response
Returns the QR code image in the requested format with appropriate Content-Type header:
- PNG:
image/png - SVG:
image/svg+xml
If the download query parameter is present, the response includes a Content-Disposition: attachment header to force download.
Notes
- Public Endpoint: No authentication required
- Default Values: If
textis not provided, it defaults to the application name - Color Formats: All color fields support simple colors, linear gradients, and radial gradients. See Color Formats for details
- Logo: Either
logo(file path/identifier) orlogo_file_id(ULID) can be used, but not both - Frame Options: Frame-specific options vary by frame type. Consult frame documentation for available options
- Block Styles: Available block styles depend on configuration. Common styles include:
square,rounded,dots, etc.