Skip to main content

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

ParameterTypeRequiredDescription
formatstringYesOutput format: png or svg

Query Parameters (GET) or Request Body (POST)

ParameterTypeRequiredDescription
textstringNoData to encode in QR code (max 2048 characters). Defaults to application name if not provided.
sizeintegerNoQR code size. Can be an ImageSize enum value (100, 320, 640, 960, 1280, 1920) or any integer. Default: 640 (MEDIUM).
marginintegerNoMargin size in pixels (0-90). Default: 0.
error_correctionintegerNoError correction level: 1 (LOW), 2 (MEDIUM), 3 (QUARTILE), 4 (HIGH). Default: 2 (MEDIUM).
default_block_stylestringNoDefault block style name (max 100 characters)
inner_corner_block_stylestringNoInner corner block style name (max 100 characters)
outer_corner_block_stylestringNoOuter corner block style name (max 100 characters)
background_colorstringNoBackground color. See Color Formats for format details. Default: 255,255,255,1 (white).
foreground_colorstringNoForeground color. See Color Formats for format details. Default: 0,0,0,1 (black).
outer_corner_colorstringNoOuter corner color. See Color Formats for format details.
inner_corner_colorstringNoInner corner color. See Color Formats for format details.
logostringNoLogo file path or identifier (max 255 characters). Must be a valid image file.
logo_file_idstring (ULID)NoLogo file ID (ULID). Must be a valid image file.
logo_sizeintegerNoLogo size percentage (0-30). Only used when logo or logo_file_id is provided.
framestringNoFrame type name (max 100 characters)
frame_optionsobjectNoFrame-specific options. Only used when frame is provided.
downloadbooleanNoForce download (adds Content-Disposition header). Use as query parameter: ?download=1

ImageSize Values

ValueNameDescription
100TINY100 pixels
320SMALL320 pixels
640MEDIUM640 pixels (default)
960LARGE960 pixels
1280XL1280 pixels
1920XXL1920 pixels

Error Correction Levels

ValueNameDescription
1LOW~7% error correction
2MEDIUM~15% error correction (default)
3QUARTILE~25% error correction
4HIGH~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 text is 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) or logo_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.