Scan Code Pro

Scan Code Pro API Documentation

Endpoints for image generation and OpenAPI schema

Scan Code Pro API v1

Simple HTTP image endpoint for QR codes, barcodes, and 2D codes.

Base URL: https://api.scancodepro.com

Endpoint: GET /api/v1/code

Returns an image (PNG default, SVG for type=qr). Use directly in <img src> or download with curl.

Parameters

  • type (required): qr|code128|ean13|upca|datamatrix|pdf417|aztec
  • data (required): Encoded content (text/URL or numeric per standard)
  • format (optional): png|svg (SVG currently for type=qr)
  • size (optional): 64–2048; QR width, also informs barcode scale (default 256)
  • margin (optional): Quiet zone modules for QR (default 4)
  • fg (optional): Foreground hex, e.g., 000000
  • bg (optional): Background hex, e.g., FFFFFF
  • ec (optional): QR error correction L|M|Q|H (default M)
  • label (optional): Human-readable label for 1D codes
  • labelPos (optional): top|bottom (best effort)

Examples

HTML <img>

<img src="https://api.scancodepro.com/api/v1/code?type=qr&data=https%3A%2F%2Fscancodepro.com&size=256&ec=Q" alt="QR Code" />

QR SVG

https://api.scancodepro.com/api/v1/code?type=qr&data=Hello%20World&format=svg

Code 128 PNG

curl -L "https://api.scancodepro.com/api/v1/code?type=code128&data=INV-0001&size=400&label=INV-0001" -o code128.png

EAN-13 PNG

curl -L "https://api.scancodepro.com/api/v1/code?type=ean13&data=5901234123457" -o ean13.png

PDF417 (boarding pass / tickets)

curl -L "https://api.scancodepro.com/api/v1/code?type=pdf417&data=Ticket%3A12345&size=300" -o pdf417.png

Data Matrix (manufacturing/pharma)

curl -L "https://api.scancodepro.com/api/v1/code?type=datamatrix&data=LOT123-EXP2026" -o dm.png

WiFi QR (convenience endpoint)

<img src="https://api.scancodepro.com/api/v1/wifi?ssid=MyNetwork&password=supersecret123&security=WPA&size=256&ec=Q" alt="WiFi QR" />
curl -L "https://api.scancodepro.com/api/v1/wifi?ssid=Guest&security=nopass&format=svg" -o wifi.svg

Notes

  • SVG is currently supported for type=qr. Barcodes return PNG.
  • Images are returned without any watermark.
  • For strict GS1 validation or advanced options, contact support.
  • For JSON responses and WiFi helpers, see POST /api/ai/qr or GET /api/ai/qr.

Authentication & Security

The /api/v1/code endpoint accepts unauthenticated GET requests for public content. To protect private or high-volume workloads, create an API key inside the Scan Code Pro dashboard and pass it with the Authorization header when calling any authenticated endpoints (such as dynamic code management or analytics exports):

Authorization: Bearer {api_key}

Rotate keys regularly, store them in a secure secret manager, and never embed them in client-side code that ships to browsers.

Response Codes & Errors

Successful requests return a 200 OK status with an image payload. Failures use standard HTTP codes:

Status Meaning Typical Fix
400 Validation error (missing type, malformed data, unsupported size) Correct the parameter, re-run the request
401 Unauthorized (for endpoints that require API keys) Add or refresh your Bearer token
404 Unknown code ID when requesting dynamic resources Ensure you are referencing a valid dynamic QR code
429 Rate limit exceeded Back off and retry after the Retry-After header interval
500 Unexpected server error Retry with exponential backoff; contact support if persistent

When the API returns JSON (for example, when status ≥ 400), the body follows:

{
  "error": {
    "code": "validation_error",
    "message": "size must be between 64 and 2048"
  }
}

Rate Limiting

  • Free tier: 60 requests per minute per IP.
  • Business tier: 600 requests per minute aggregated by API key.
  • Enterprise tier: configured per contract.

The Retry-After header communicates when it is safe to retry. Build exponential backoff into automation scripts to stay within limits.

Best Practices

  • Pre-generate static QR codes during builds instead of creating them on every page load.
  • Cache successful responses (e.g., using a CDN or object storage) to reduce repeated calls.
  • Validate user-provided data on your server before invoking the API to avoid propagating malicious content.
  • For WiFi codes, avoid including private SSIDs or credentials in publicly accessible pages.

Related Endpoints

  • POST /api/v1/codes — create saved dynamic QR codes tied to your workspace (requires API key).
  • GET /api/v1/codes/{id} — fetch metadata, scan counts, and download links for dynamic codes.
  • GET /api/v1/analytics — retrieve aggregated scan metrics for dashboards.

Contact support@scancodepro.com for the full OpenAPI specification or enterprise onboarding support.