QR Code

Generate QR codes from structured input and download via pre-signed URL or inline base64 data URI.

All endpoints share common style parameters: size, fg_color, bg_color, error_correction, margin, ttl, and format.

Common Style Parameters

Name

In

Required

Description

format

body

no

Output format: png (default), svg, base64

size

body

no

Image size 100–2000 px (default 400, ignored for SVG)

fg_color

body

no

Foreground hex color (default #000000)

bg_color

body

no

Background hex color (default #FFFFFF)

error_correction

body

no

Error correction level: L, M (default), Q, H

margin

body

no

Quiet zone width in modules, 0–20 (default 4)

ttl

body

no

Pre-signed URL expiry in seconds, 60–2592000 (default 86400, ignored for base64)

Text

POST /api/v1/qr/text

Name

In

Required

Description

text

body

yes

Text to encode (max 4296 chars)

Example

curl -X POST https://api.apicrate.io/api/v1/qr/text \
  -H "X-API-Key: $KEY" \
  -H "Content-Type: application/json" \
  -d '{"text": "Hello!", "format": "base64"}'
{
  "status": "ok",
  "data": {
    "data_uri": "data:image/png;base64,iVBORw0KGgo...",
    "format": "base64",
    "preset": "text"
  }
}

URL

POST /api/v1/qr/url

Name

In

Required

Description

url

body

yes

URL to encode (max 2048 chars)

WiFi

POST /api/v1/qr/wifi

Name

In

Required

Description

ssid

body

yes

Network name (max 32 chars)

password

body

no

Network password (max 63 chars)

encryption

body

no

WPA (default), WEP, nopass

hidden

body

no

Whether network is hidden (default false)

Example

curl -X POST https://api.apicrate.io/api/v1/qr/wifi \
  -H "X-API-Key: $KEY" \
  -H "Content-Type: application/json" \
  -d '{"ssid": "GuestNet", "password": "welcome", "format": "png"}'
{
  "status": "ok",
  "data": {
    "url": "https://s3.example.com/qr/abc.png?X-Amz-...",
    "format": "png",
    "expires": 1744819200,
    "preset": "wifi"
  }
}

vCard

POST /api/v1/qr/vcard

Name

In

Required

Description

name

body

yes

Contact full name

phone

body

no

Phone number

email

body

no

Email address

org

body

no

Organization name

address

body

no

Mailing address

url

body

no

Website URL

Email

POST /api/v1/qr/email

Name

In

Required

Description

to

body

yes

Recipient email address

subject

body

no

Pre-filled subject line

body

body

no

Pre-filled email body

SMS

POST /api/v1/qr/sms

Name

In

Required

Description

phone

body

yes

Phone number

message

body

no

Pre-filled SMS message (max 160 chars)

Geo

POST /api/v1/qr/geo

Name

In

Required

Description

latitude

body

yes

Latitude (-90 to 90)

longitude

body

yes

Longitude (-180 to 180)