STAGING

QRay API

Generate QR codes from your own apps with a simple REST API: all 8 data types, PNG and SVG, colors, gradients, logos and frames — everything the web generator can do.

Get an API key https://stg.qray.io/api/v1

Try it now — no signup

Paste this in your terminal. You get a real QR code back in one request:

curl -X POST https://stg.qray.io/api/v1/demo \
  -H "Content-Type: application/json" \
  -d '{"qr":{"type":"url","fields":{"url":"https://qray.io"},"style":{"dot_style":"rounded","gradient":{"colors":["#2563EB","#A3E635"],"angle":45}}}}' \
  -o qr.png && open qr.png

Opens qr.png (macOS; on Linux use xdg-open qr.png). No key needed — the demo allows 10 requests/hour per IP.

Authentication

Every request must include your API key in the X-Api-Key header. Create and manage keys in your dashboard.

curl https://stg.qray.io/api/v1/usage \
  -H "X-Api-Key: qray_live_YOUR_KEY"

The full key is shown only once, at creation. Store it in a secret manager — we keep only a SHA-256 digest.

Quickstart

Generate a styled QR code for a URL:

curl -X POST https://stg.qray.io/api/v1/generate \
  -H "X-Api-Key: qray_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "qr": {
      "type": "url",
      "fields": { "url": "https://example.com" },
      "format": "png",
      "size": 512,
      "style": {
        "fg_color": "#111113",
        "dot_style": "rounded",
        "gradient": { "colors": ["#2563EB", "#A3E635"], "angle": 45 }
      }
    }
  }'

The response contains the image as base64 plus permanent URLs:

{
  "hash": "1c9a7f2b40d861e3",
  "format": "png",
  "size": 512,
  "image": "iVBORw0KGgoAAA…",          // base64
  "image_url": "https://stg.qray.io/qr/1c9a7f2b40d861e3.png",
  "share_url": "https://stg.qray.io/qr/1c9a7f2b40d861e3",
  "url": "/qr/1c9a7f2b40d861e3"
}

Endpoints

EndpointDescription
POST /api/v1/demoGenerate a QR image with no key (keyless demo, 10/hour per IP)
POST /api/v1/generateGenerate a QR code; returns a base64 image and permanent URLs
GET /api/v1/qr_codesList your QR codes (50 per page, ?page=N)
GET /api/v1/qr_codes/:hashMetadata for one QR code
GET /api/v1/qr_codes/:hash/imageBinary image (PNG/SVG); the URL never expires
DELETE /api/v1/qr_codes/:hashDelete a QR code
GET /api/v1/usageCurrent plan, daily limit and usage
GET /api/v1/api_keysList your API keys
POST /api/v1/api_keysCreate an additional key ({"name": "…"})
DELETE /api/v1/api_keys/:idRevoke a key (the key authenticating the request cannot revoke itself)

Prefer a machine-readable spec? Explore it interactively or import our OpenAPI file into Postman, Insomnia or a client generator: Interactive API explorer · openapi.yaml

QR types and fields

Pass the data type in qr.type and its fields in qr.fields:

typefields
urlurl
texttext
wifissid, password, encryption (WPA | WEP | nopass), hidden (true | false)
vcardfirst_name, last_name, phone, email, org, title, url
emailaddress, subject, body
phonenumber
smsnumber, message
geolatitude, longitude

For example, a WiFi QR your guests can scan to connect:

curl -X POST https://stg.qray.io/api/v1/demo \
  -H "Content-Type: application/json" \
  -d '{"qr":{"type":"wifi","fields":{"ssid":"MyCafe","password":"latte123","encryption":"WPA"}}}' \
  -o wifi.png && open wifi.png

Options and styling

ParameterDescription
formatpng (default) | svg
size256 | 512 (default) | 1024 | 2048
style.fg_color, style.bg_colorhex, e.g. #111113
style.dot_stylesquare (default) | circle | rounded
style.eye_stylesquare (default) | rounded
style.gradient{ "colors": ["#hex", "#hex", …], "angle": 0–360 } — two or more colors; overrides fg_color
style.frame{ "type": "scan-me" | "custom-text", "text": "…", "color": "#hex" } — PNG only; ignored for SVG
style.logo_dataPNG/JPG as raw base64 (no data: prefix), max ~500 KB. Error correction is raised automatically.

Images are cached for 24 hours and transparently regenerated afterwards — image_url is permanent and safe to hotlink.

Plans and rate limits

Each key has a daily quota that resets at midnight UTC:

PlanRequests
free100 requests / day
pro10 000 requests / day
enterprise100 000 requests / day

Every response carries the current window state:

X-RateLimit-Limit: 100
X-RateLimit-Remaining: 87

Need pro or enterprise? Write to support@qray.io and we will upgrade your key.

Errors

HTTPerrorDescription
400missing_parameterMalformed request (e.g. missing qr parameter)
401unauthorizedMissing, invalid or revoked API key
404not_foundQR code not found (or owned by another account)
422unknown_typeUnknown qr.type
429rate_limitedDaily limit exceeded — retry after midnight UTC or upgrade the plan
503service_unavailableQR generation service temporarily unavailable — retry with backoff