API Documentation

Complete reference for the QRCraft API

Getting Started

QRCraft API allows you to generate QR codes programmatically. To get started:

  1. Create an account and upgrade to Pro or Business plan
  2. Generate an API key from your dashboard
  3. Include the API key in your requests as a Bearer token or X-API-Key header

Base URL: https://qrcraft.org/api/v1

Authentication

All API requests require authentication. You can authenticate using either method:

Option 1: Bearer Token (recommended)

Authorization: Bearer qr_live_xxxxxxxxxxxx

Option 2: X-API-Key Header

X-API-Key: qr_live_xxxxxxxxxxxx

Generate QR Code (POST)

POST/api/v1/qr

Generate a static QR code with full customization options.

Request Body

ParameterTypeRequiredDescription
typestringYesurl, text, wifi, vcard, email, sms, phone
datastring/objectYesContent to encode (format depends on type)
formatstringNopng, svg, base64, dataurl (default: png)
options.sizenumberNo100-2000 (default: 300)
options.marginnumberNo0-10 (default: 4)
options.foregroundColorstringNoHex color (default: #000000)
options.backgroundColorstringNoHex color (default: #ffffff)
options.errorCorrectionLevelstringNoL, M, Q, H (default: M)

Example Request

curl -X POST https://qrcraft.org/api/v1/qr \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "url",
    "data": "https://example.com",
    "format": "png",
    "options": {
      "size": 300,
      "foregroundColor": "#000000",
      "backgroundColor": "#ffffff"
    }
  }'

Data Formats by Type

type: "url" or "text"

"data": "https://example.com"

type: "wifi"

"data": { "ssid": "NetworkName", "password": "secret", "encryption": "WPA" }

type: "email"

"data": { "email": "test@example.com", "subject": "Hello", "body": "..." }

type: "sms"

"data": { "phone": "+1234567890", "message": "Hello!" }

Generate QR Code (GET)

GET/api/v1/qr

Simple QR code generation via URL parameters. Great for embedding in img tags.

Query Parameters

ParameterDescription
dataContent to encode (required)
size100-2000 (default: 300)
formatpng, svg (default: png)
fgForeground hex without # (default: 000000)
bgBackground hex without # (default: ffffff)
eclError correction: L, M, Q, H (default: M)

Example

<img src="https://qrcraft.org/api/v1/qr?data=https://example.com&size=200&fg=0066cc" />

Dynamic QR Codes

Dynamic QR codes redirect through our servers, allowing you to change the destination URL and track scans.

POST/api/v1/dynamic

Create a new dynamic QR code

{ "targetUrl": "https://example.com/page" }
GET/api/v1/dynamic

List all your dynamic QR codes with scan counts

PUT/api/v1/dynamic/:id

Update destination URL

{ "targetUrl": "https://new-url.com" }
GET/api/v1/dynamic/:id/stats

Get scan analytics

{
  "totalScans": 1234,
  "scansByDay": [...],
  "scansByCountry": [...],
  "scansByDevice": [...]
}

Response Formats

format: "png"

Returns binary PNG image with Content-Type: image/png

format: "svg"

Returns SVG markup with Content-Type: image/svg+xml

format: "base64"

Returns JSON with base64-encoded PNG

{ "success": true, "format": "base64", "data": "iVBORw0KGgo..." }

format: "dataurl"

Returns JSON with data URL (ready for img src)

{ "success": true, "format": "dataurl", "data": "data:image/png;base64,..." }

Rate Limits

Rate limit information is included in response headers:

X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 1704067200

Free

No API

Access

Pro - $9/mo

1,000

calls/month

Business - $29/mo

10,000

calls/month

Error Handling

Errors are returned as JSON with a descriptive message:

{
  "success": false,
  "error": "Rate limit exceeded",
  "retryAfter": 3600,
  "documentation": "https://qrcraft.io/docs/api"
}
StatusDescription
400Bad Request - Invalid parameters
401Unauthorized - Invalid or missing API key
403Forbidden - API usage limit exceeded
429Too Many Requests - Rate limit exceeded
500Internal Server Error

Ready to Get Started?

Create your API key and start generating QR codes programmatically.

Go to Dashboard