API Documentation
Generate QR codes with a single URL. No SDK, no library, no signup required.
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.
<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
/v1/make-qr— Generate a QR code imageReturns a QR code image in the requested format. All styling options are passed as query parameters. No authentication required for public use.
Query Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
data | string | Yes | — | URL or any text content to encode. Must be URL-encoded. |
size | number | No | 300 | Output image size in pixels (100–2000). Applied to both dimensions. |
format | string | No | png | Output format: png, webp, or svg. |
template | string | No | — | Template slug for a pre-configured styled QR (e.g. facebook, youtube). |
dotsColor | string | No | #000000 | Dot color in hex. URL-encode the # as %23. |
dotsType | string | No | rounded | Dot style: rounded, dots, square, extra-rounded. |
cornerSquareColor | string | No | #000000 | Color of the three finder (corner) squares. |
backgroundColor | string | No | #ffffff | Background color in hex. |
watermark | boolean | No | false | Overlay a "Powered by Online-QR" watermark (free tier). |
view | string | No | auto | raw forces the image bytes, page forces the browser preview. Omit to auto-detect. |
Example URL
https://api.online-qr.com/v1/make-qr?data=https%3A%2F%2Fexample.com&size=400&dotsType=rounded&dotsColor=%23ff6b35&backgroundColor=%23ffffffOpening 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.
/v1/json-to-qr— Generate QR with full JSON configFor 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
{
"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.
/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
{
"destinationUrl": "https://example.com/campaign",
"customShortCode": "summer24",
"password": null,
"expiresAt": null
}Response — 201 Created
{
"id": "clx1abc2def3",
"shortCode": "summer24",
"destinationUrl": "https://example.com/campaign",
"scanCount": 0,
"createdAt": "2026-02-28T10:00:00Z",
"expiresAt": null,
"isActive": true
}/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).
/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.
/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
Authorization: Bearer YOUR_API_KEYGet 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 -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.
| Tier | Requests / Hour | Notes |
|---|---|---|
| Free (unauthenticated) | 100 / hour | Per IP address. No account required. |
| Pro | 1,000 / hour | Per authenticated account. 14-day trial included. |
| Enterprise | 10,000 / hour | Contact 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.
| Code | Meaning | Common Cause |
|---|---|---|
| 400 | Bad Request | Missing required parameter (data), invalid value, or out-of-range size. |
| 401 | Unauthorized | Missing or invalid Authorization header on a protected endpoint. |
| 404 | Not Found | The requested redirect ID or template slug does not exist. |
| 429 | Too Many Requests | Rate limit exceeded. Check the Retry-After response header for reset time. |
| 500 | Internal Server Error | Unexpected server error. Retry with exponential backoff. |
Error Response Shape
{
"status": 400,
"message": "Invalid parameter: 'size' must be between 100 and 2000"
}