Back home

API Reference

A REST API for creating and managing dynamic QR codes programmatically. JSON in, JSON out.

Authentication

Generate a key under Dashboard → API Keys and send it as a bearer token on every request. API access requires the Pro plan.

Authorization: Bearer sk_live_…

Base URL: https://crazyqrcode.libraryofapps.com/api/v1

Rate limits

Each account is limited to 120 requests per minute across all of its API keys. Exceeding it returns 429 with a Retry-After header (seconds until the window resets).

Endpoints

POST/api/v1/qrcodes

Create a QR code.

  • name and destinationUrl are required; everything else is optional.
  • slug is a custom vanity link (Pro only); omit it for an auto-generated one.
  • variants, geoRules and schedules are only stored if your plan includes them.
  • Returns 201 with the created code.
  • Add ?format=ansi (or send Accept: text/plain) to print a scannable QR right in your terminal instead of JSON.
curl -X POST https://crazyqrcode.libraryofapps.com/api/v1/qrcodes \
  -H "Authorization: Bearer sk_live_…" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Promo",
    "destinationUrl": "https://example.com",
    "slug": "summer-promo"
  }'
POST/api/v1/qrcodes?format=ansi

Create a QR code and print it as scannable terminal art (great for curl).

  • Returns text/plain: the QR rendered with block characters, followed by the tracking URL.
  • Scan it straight from your terminal — no dashboard needed.
curl -X POST "https://crazyqrcode.libraryofapps.com/api/v1/qrcodes?format=ansi" \
  -H "Authorization: Bearer sk_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Promo", "destinationUrl": "https://example.com" }'
GET/api/v1/qrcodes

List all your QR codes, newest first.

curl https://crazyqrcode.libraryofapps.com/api/v1/qrcodes \
  -H "Authorization: Bearer sk_live_…"
GET/api/v1/qrcodes/:id

Fetch a single code together with its last-30-day analytics.

  • Response includes a data object and an analytics summary.
curl https://crazyqrcode.libraryofapps.com/api/v1/qrcodes/6a2b2beb57dba38e562cd1ba \
  -H "Authorization: Bearer sk_live_…"
DELETE/api/v1/qrcodes/:id

Delete a code and all of its scan history.

curl -X DELETE https://crazyqrcode.libraryofapps.com/api/v1/qrcodes/6a2b2beb57dba38e562cd1ba \
  -H "Authorization: Bearer sk_live_…"

Request body (create)

FieldTypeRequiredDescription
namestringYesLabel for the code (1–120 chars).
destinationUrlstringYesWhere the QR should redirect.
slugstringCustom vanity slug (Pro). 3–40 chars, [a-z0-9-].
style"Standard" | "Rounded" | "Soft"Visual style. Defaults to Standard.
colorstringHex color, e.g. #2563eb. Defaults to #000000.
activebooleanWhether the redirect is live. Defaults to true.
variantsarrayA/B split destinations (Pro).
geoRulesarrayCountry-based redirects (Pro).
schedulesarrayTime-windowed redirects (Pro).

Errors

Errors return a JSON body of the form { "error": "…" } with an appropriate status code.

400Invalid request body (failed validation).
401Missing, malformed, invalid, or revoked API key.
402Plan limit reached (e.g. free-tier QR cap).
403API access requires the Pro plan.
404Resource not found.
409Slug already taken.
413Request body too large (max 64 KB).
429Rate limit exceeded — see the Retry-After header.
500Internal server error.

Need a key? Create one in your dashboard.