API Reference

API Documentation

Generate QR codes with a single URL. No SDK, no library, no signup required.

Base URL:https://online-qr.com/v1/

Quick Start

The simplest way to use the API — embed the endpoint URL directly in an <img> tag. No API key, no authentication, no setup required.

HTML
<img src="https://api.online-qr.com/v1/make-qr?data=https://example.com" alt="QR Code" />

The endpoint returns a raw PNG image. Use it in any <img> tag, Markdown document, or email template — no additional code needed.

Endpoints

GET/v1/make-qr— Generate a QR code image

Returns a QR code image in the requested format. All styling options are passed as query parameters. No authentication required for public use.

Query Parameters

ParameterTypeRequiredDefaultDescription
datastringYesURL or any text content to encode. Must be URL-encoded.
sizenumberNo300Output image size in pixels (100–2000). Applied to both dimensions.
formatstringNopngOutput format: png, webp, or svg.
templatestringNoTemplate slug for a pre-configured styled QR (e.g. facebook, youtube).
dotsColorstringNo#000000Dot color in hex. URL-encode the # as %23.
dotsTypestringNoroundedDot style: rounded, dots, square, extra-rounded.
cornerSquareColorstringNo#000000Color of the three finder (corner) squares.
backgroundColorstringNo#ffffffBackground color in hex.
watermarkbooleanNofalseOverlay a "Powered by Online-QR" watermark (free tier).
viewstringNoautoraw forces the image bytes, page forces the browser preview. Omit to auto-detect.

Example URL

URL
https://api.online-qr.com/v1/make-qr?data=https%3A%2F%2Fexample.com&size=400&dotsType=rounded&dotsColor=%23ff6b35&backgroundColor=%23ffffff

Opening the URL in a browser shows a small preview page with a download button instead of the bare image. Every programmatic caller — <img> tags, fetch, curl and SDKs — still receives the raw image bytes, unchanged. Append &view=raw to force the image in a browser tab.

POST/v1/json-to-qr— Generate QR with full JSON config

For advanced styling, send a JSON body with the full QR configuration. Accepts nested configuration objects for fine-grained control over dots, corners, and background.

Request Body

JSON
{
  "data": "https://example.com",
  "size": 500,
  "format": "png",
  "dotsOptions": {
    "color": "#1a1a2e",
    "type": "rounded"
  },
  "cornersSquareOptions": {
    "color": "#6c63ff",
    "type": "extra-rounded"
  },
  "backgroundOptions": {
    "color": "#ffffff"
  }
}

Response

Returns binary image data directly.

Content-Typeimage/png
Status200 OK
Authentication Required for all Redirect Endpoints
POST/v1/redirects/— Create dynamic QR redirect

Creates a managed short link (online-qr.com/r/:shortCode) that redirects to your destination URL. Enables scan tracking and lets you change the destination without reprinting the QR code.

Required Headers

Authorization Bearer <token>
Content-Type application/json

Request Body

JSON
{
  "destinationUrl": "https://example.com/campaign",
  "customShortCode": "summer24",
  "password": null,
  "expiresAt": null
}

Response — 201 Created

JSON
{
  "id": "clx1abc2def3",
  "shortCode": "summer24",
  "destinationUrl": "https://example.com/campaign",
  "scanCount": 0,
  "createdAt": "2026-02-28T10:00:00Z",
  "expiresAt": null,
  "isActive": true
}
GET/v1/redirects/— List all redirects

Returns a paginated list of all dynamic QR redirects for the authenticated user. Supports ?page= and ?limit= query parameters (defaults: page 1, limit 20).

GET/v1/redirects/:id/analytics— Get scan analytics

Returns aggregated scan analytics: total scans, unique visitors, device type breakdown, country distribution, browser, OS, and time-series data. Supports ?from= and ?to= ISO 8601 date range filters.

GET/v1/redirects/:id/analytics/export— Export scan data as CSV

Exports raw scan events as a downloadable CSV file. Each row contains: timestamp, ip_address, user_agent, referrer, country, city, device_type, os, browser .

Authentication

No Auth — Static QR Generation

GET /v1/make-qr and POST /v1/json-to-qr require no credentials. Subject to the free-tier rate limit of 100 requests/hour per IP.

Bearer Token — Dynamic QR & Analytics

All /v1/redirects/ endpoints require authentication. Pass your API key or session token in the Authorization header.

Sending the token

HTTP Header
Authorization: Bearer YOUR_API_KEY

Get an API key

Sign in and navigate to Settings › API Keys to create a long-lived API key for server-side integrations. New accounts receive a 14-day Pro trial automatically — no credit card required.

Code Examples

curl
curl -o qr.png \
  "https://api.online-qr.com/v1/make-qr?data=https%3A%2F%2Fexample.com"

Rate Limits

Limits apply per IP address (unauthenticated) or per account (authenticated) on a rolling one-hour window. Exceeding the limit returns 429 Too Many Requests with a Retry-After header indicating when the window resets.

TierRequests / HourNotes
Free (unauthenticated)100 / hourPer IP address. No account required.
Pro1,000 / hourPer authenticated account. 14-day trial included.
Enterprise10,000 / hourContact us for custom limits and SLA agreements.

Need higher limits for a production integration? Create a Pro account (free 14-day trial) or contact us for Enterprise pricing and custom SLA.

Error Codes

All errors return a JSON body with a message field describing the problem. Image generation endpoints return the HTTP status only (no body) when the request is fundamentally malformed.

CodeMeaningCommon Cause
400Bad RequestMissing required parameter (data), invalid value, or out-of-range size.
401UnauthorizedMissing or invalid Authorization header on a protected endpoint.
404Not FoundThe requested redirect ID or template slug does not exist.
429Too Many RequestsRate limit exceeded. Check the Retry-After response header for reset time.
500Internal Server ErrorUnexpected server error. Retry with exponential backoff.

Error Response Shape

JSON
{
  "status": 400,
  "message": "Invalid parameter: 'size' must be between 100 and 2000"
}