Overview

The SmartQRCodes Analytics API gives you programmatic access to scan and click analytics for your QR codes and Smart Links. All endpoints are read-only and scoped exclusively to resources owned by the API key holder.

Base URL

https://api.smart-qrcodes.com

Version

v1

Format

JSON

Available on Premium & Enterprise plans

Generate API keys from Dashboard → Settings → API Keys. Each key belongs to your account and can only access your own QR codes and Smart Links.

Authentication

All API requests must include your API key in the x-api-key request header. Never share your key publicly or commit it to source control.

HTTP Request header
x-api-key: sqr_live_xxxxxxxxxxxxxxxxxxxxxxxx

Generating an API Key

  1. Go to Dashboard → Settings → API Keys.
  2. Click Create New Key, give it a name (e.g. "Analytics Integration").
  3. Copy the key immediately — it will only be shown once.
  4. Store it securely in your environment variables (e.g. SQR_API_KEY).

Example — cURL

cURL
curl -X GET "https://api.smart-qrcodes.com/api/v1/qrcodes/abc123/analytics" \
  -H "x-api-key: sqr_live_xxxxxxxxxxxxxxxxxxxxxxxx"

Example — JavaScript (fetch)

JavaScript
const response = await fetch(
  'https://api.smart-qrcodes.com/api/v1/qrcodes/abc123/analytics',
  {
    headers: {
      'x-api-key': process.env.SQR_API_KEY,
    },
  }
);

const { status, data } = await response.json();

Example — Python

Python
import requests, os

resp = requests.get(
    "https://api.smart-qrcodes.com/api/v1/qrcodes/abc123/analytics",
    headers={"x-api-key": os.environ["SQR_API_KEY"]},
)
data = resp.json()

QR Code Analytics

GET/api/v1/qrcodes/:id/analytics

Returns scan analytics for a single QR code identified by its short ID. The response includes total scan counts, period breakdowns (24 h / 7 d / 30 d), device and browser splits, geographic locations, and all-time aggregates.

Path Parameters

:idrequired
stringThe QR code short ID (qr_short_id). Find it in the QR code detail page or from the /qr-codes dashboard.

Request

cURL
curl -X GET "https://api.smart-qrcodes.com/api/v1/qrcodes/xK9mP2/analytics" \
  -H "x-api-key: sqr_live_xxxxxxxxxxxxxxxxxxxxxxxx"

Response — 200 OK

JSON
{
  "status": true,
  "data": {
    "totalScans": 1482,

    "last24Hours": {
      "totalScans": 34,
      "devices": {
        "Mobile":  28,
        "Desktop":  5,
        "Tablet":   1
      },
      "browsers": {
        "Chrome":  20,
        "Safari":  10,
        "Firefox":  4
      },
      "locations": {
        "India":          18,
        "United States":   9,
        "United Kingdom":  7
      }
    },

    "lastWeek": {
      "totalScans":  210,
      "dailyAverage": 30,
      "devices": {
        "Mobile":  170,
        "Desktop":  32,
        "Tablet":    8
      },
      "topLocations": {
        "India":          95,
        "United States":  55,
        "United Kingdom": 28,
        "Germany":        18,
        "Canada":         14
      }
    },

    "lastMonth": {
      "totalScans":  860,
      "dailyAverage": 28.67,
      "devices": {
        "Mobile":  680,
        "Desktop": 148,
        "Tablet":   32
      },
      "topLocations": {
        "India":          380,
        "United States":  210,
        "United Kingdom": 130,
        "Germany":         80,
        "Canada":          60
      }
    },

    "allTime": {
      "totalScans":      1482,
      "averageDailyScans": 24.7,
      "peakDay": "2025-06-15",
      "devices": {
        "Mobile":  1200,
        "Desktop":  230,
        "Tablet":    52
      },
      "browsers": {
        "Chrome":  890,
        "Safari":  420,
        "Firefox":  98,
        "Edge":     74
      },
      "os": {
        "Android": 750,
        "iOS":     450,
        "Windows": 198,
        "macOS":    84
      }
    }
  }
}

Response Fields

totalScans
numberCumulative total scans since QR code was created.
last24Hours
objectScan activity in the last 24 hours.
last24Hours.totalScans
numberNumber of scans in the last 24 hours.
last24Hours.devices
objectScan count keyed by device type (Mobile / Desktop / Tablet).
last24Hours.browsers
objectScan count keyed by browser name.
last24Hours.locations
objectScan count keyed by country name.
lastWeek
objectScan activity in the last 7 days.
lastWeek.dailyAverage
numberAverage scans per day over the last 7 days.
lastWeek.topLocations
objectTop 5 countries by scan count.
lastMonth
objectScan activity in the last 30 days.
allTime.peakDay
stringISO date (YYYY-MM-DD) of the highest-scan day.
allTime.os
objectAll-time scan count keyed by operating system.

Errors

All errors return a JSON body with status: false and a human-readable msg field.

Error response shape
{
  "status": false,
  "msg": "Human-readable error message"
}
StatusMeaningCommon Cause
200OKRequest succeeded.
401UnauthorizedMissing, invalid, or revoked x-api-key header.
403ForbiddenYour API key does not own this resource, or your plan does not include API access.
404Not FoundNo QR code or Smart Link matches the provided ID.
429Too Many RequestsYou have exceeded the rate limit. See Rate Limits.
500Internal Server ErrorUnexpected server error. Contact support if this persists.

Rate Limits

API requests are rate-limited per API key to protect platform stability. Exceeding the limit returns a 429 Too Many Requests response.

Premium

100 requests / 15 min per key

Enterprise

500 requests / 15 min per key

Handling 429 responses

When you receive a 429, wait before retrying. Use exponential back-off (e.g. wait 1s, then 2s, then 4s). If you need higher limits, consider upgrading to Enterprise or contact support@smart-qrcodes.com.

Retry Example — JavaScript

JavaScript
async function fetchWithRetry(url, options, retries = 3) {
  for (let i = 0; i < retries; i++) {
    const res = await fetch(url, options);
    if (res.status !== 429) return res;
    const delay = Math.pow(2, i) * 1000;  // 1s, 2s, 4s
    await new Promise((r) => setTimeout(r, delay));
  }
  throw new Error('Rate limit exceeded after retries');
}
© 2026 Navneet Enterprise — SmartQRCodes