New: meet Cleo, the AI that lives inside your QR codes.Meet Cleo, the AI inside your QR codesDiscover Cleo →

Analytics

The QRCodeKIT API provides a powerful analytics query system to help you understand how your QR codes are performing. You can query analytics data with flexible metrics, dimensions, and filters.

Analytics features are only available for Enterprise plans. Contact our sales team to upgrade your plan and access detailed analytics.

Overview

The analytics system allows you to:

  • Query visit data - Get total and unique visits for your QR codes
  • Filter by QR codes - Analyze specific QR codes or groups
  • Group by dimensions - Break down data by time, geography, devices, etc.
  • Set date ranges - Analyze data for specific time periods

Analytics Query Endpoint

All analytics queries use the /api/analytics/query endpoint:

bash
curl 'https://api.v2.qrcodekit.com/api/analytics/query' \
  -H 'X-Api-Key: YOUR_API_KEY' \
  -H 'X-Account-Id: /api/user-accounts/YOUR_ACCOUNT_ID' \
  -H 'Content-Type: application/json' \
  -d '{
    "date_range": {
      "start": "2025-07-23 00:00:00",
      "end": "2025-08-22 23:59:59",
      "interval": "1d"
    },
    "metrics": ["visits:total", "visits:unique"],
    "dimensions": [],
    "filters": [
      ["in", "context.path.keyword", ["bZoxuf"]]
    ]
  }'

Request Parameters

Date Range

ParameterTypeRequiredDescriptionExample
startstringYesStart date and time (ISO format)"2025-07-23 00:00:00"
endstringYesEnd date and time (ISO format)"2025-08-22 23:59:59"
intervalstringNoTime interval for grouping"1d", "1h", "1w"

Metrics

Available metrics for querying:

MetricDescription
visits:totalTotal number of visits
visits:uniqueNumber of unique visits

Dimensions

Available dimensions for grouping data:

DimensionDescription
user_agent_info.nameBrowser/device name
geoip.country_nameCountry name
geoip.city_nameCity name
context.path.keywordQR code path

Filters

Filter data using various conditions:

Filter TypeDescriptionExample
inExact match or multiple values["in", "context.path.keyword", ["bZoxuf"]]
inMultiple values["in", "geoip.country_name", ["US", "CA"]]

Example Queries

Basic Visit Data

Get total and unique visits for a specific QR code:

bash
curl 'https://api.v2.qrcodekit.com/api/analytics/query' \
  -H 'X-Api-Key: YOUR_API_KEY' \
  -H 'X-Account-Id: /api/user-accounts/YOUR_ACCOUNT_ID' \
  -H 'Content-Type: application/json' \
  -d '{
    "date_range": {
      "start": "2025-07-23 00:00:00",
      "end": "2025-08-22 23:59:59",
      "interval": "1d"
    },
    "metrics": ["visits:total", "visits:unique"],
    "dimensions": [],
    "filters": [
      ["is", "context.path.keyword", ["bZoxuf"]]
    ]
  }'

Response:

JSON
{
  "@context": {
    "@vocab": "https://api.v2.qrcodekit.com/api/docs.jsonld#",
    "hydra": "http://www.w3.org/ns/hydra/core#",
    "result": "QueryResult/result"
  },
  "@type": "QueryResult",
  "@id": "/api/.well-known/genid/6acb3ebc8e47d75c4a9f",
  "result": [
    {
      "metrics": {
        "visits:total": 1,
        "visits:unique": 1
      },
      "time": "2025-08-20T00:00:00.000Z"
    }
  ]
}

Device Analytics

Get visits broken down by browser/device:

bash
curl 'https://api.v2.qrcodekit.com/api/analytics/query' \
  -H 'X-Api-Key: YOUR_API_KEY' \
  -H 'X-Account-Id: /api/user-accounts/YOUR_ACCOUNT_ID' \
  -H 'Content-Type: application/json' \
  -d '{
    "date_range": {
      "start": "2025-07-23 00:00:00",
      "end": "2025-08-22 23:59:59"
    },
    "metrics": ["visits:total"],
    "dimensions": ["user_agent_info.name"],
    "filters": [
      ["is", "context.path.keyword", ["bZoxuf"]]
    ]
  }'

Response:

JSON
{
  "@context": {
    "@vocab": "https://api.v2.qrcodekit.com/api/docs.jsonld#",
    "hydra": "http://www.w3.org/ns/hydra/core#",
    "result": "QueryResult/result"
  },
  "@type": "QueryResult",
  "@id": "/api/.well-known/genid/9c8e544296c322d82d72",
  "result": [
    {
      "user_agent_info.name": [
        {
          "key": "Chrome",
          "metrics": {
            "visits:total": 1
          }
        }
      ]
    }
  ]
}

Geographic Analytics

Get visits broken down by country and city:

bash
curl 'https://api.v2.qrcodekit.com/api/analytics/query' \
  -H 'X-Api-Key: YOUR_API_KEY' \
  -H 'X-Account-Id: /api/user-accounts/YOUR_ACCOUNT_ID' \
  -H 'Content-Type: application/json' \
  -d '{
    "date_range": {
      "start": "2025-07-23 00:00:00",
      "end": "2025-08-22 23:59:59"
    },
    "metrics": ["visits:total"],
    "dimensions": ["geoip.country_name", "geoip.city_name"],
    "filters": [
      ["is", "context.path.keyword", ["bZoxuf"]]
    ]
  }'

Response:

JSON
{
  "@context": {
    "@vocab": "https://api.v2.qrcodekit.com/api/docs.jsonld#",
    "hydra": "http://www.w3.org/ns/hydra/core#",
    "result": "QueryResult/result"
  },
  "@type": "QueryResult",
  "@id": "/api/.well-known/genid/009d44def05d4f51ccf6",
  "result": [
    {
      "geoip.country_name": [
        {
          "key": "Malaysia",
          "metrics": {
            "visits:total": 1
          }
        }
      ],
      "geoip.city_name": [
        {
          "key": "Cyberjaya",
          "metrics": {
            "visits:total": 1
          }
        }
      ]
    }
  ]
}

Total Analytics

Get overall totals for a QR code (all time):

bash
curl 'https://api.v2.qrcodekit.com/api/analytics/query' \
  -H 'X-Api-Key: YOUR_API_KEY' \
  -H 'X-Account-Id: /api/user-accounts/YOUR_ACCOUNT_ID' \
  -H 'Content-Type: application/json' \
  -d '{
    "date_range": {
      "start": "2020-01-01",
      "end": "2025-08-22 23:59:59"
    },
    "metrics": ["visits:total", "visits:unique"],
    "dimensions": [],
    "filters": [
      ["is", "context.path.keyword", ["bZoxuf"]]
    ]
  }'

Response:

JSON
{
  "@context": {
    "@vocab": "https://api.v2.qrcodekit.com/api/docs.jsonld#",
    "hydra": "http://www.w3.org/ns/hydra/core#",
    "result": "QueryResult/result"
  },
  "@type": "QueryResult",
  "@id": "/api/.well-known/genid/48db865c951e9189e8ad",
  "result": [
    {
      "metrics": {
        "visits:total": 1,
        "visits:unique": 1
      }
    }
  ]
}

Query Best Practices

Performance Optimization

  1. Use specific date ranges - Avoid querying very large date ranges
  2. Limit dimensions - Don't group by too many dimensions at once
  3. Use filters - Filter data to reduce query size
  4. Cache results - Cache frequently used queries

Data Interpretation

  1. Understand time zones - All dates are in UTC
  2. Check data freshness - Analytics data may have a delay
  3. Consider sampling - Large queries may use sampling
  4. Validate filters - Ensure filter values exist in your data

Common Use Cases

  1. Daily monitoring - Query daily visit counts
  2. Geographic analysis - Understand where your QR codes are scanned
  3. Device analysis - See which devices are most common
  4. Performance tracking - Monitor QR code performance over time

Error Handling

Common Errors

ErrorDescriptionSolution
Invalid date rangeDate format is incorrectUse ISO format: "2025-07-23 00:00:00"
Invalid metricMetric doesn't existUse only supported metrics
Invalid dimensionDimension doesn't existUse only supported dimensions
Query too largeQuery returns too much dataReduce date range or add filters

Rate Limits

  • Query requests: 100 requests per minute
  • Data retention: Analytics data is retained for 2 years
  • Query timeout: 30 seconds maximum

Next Steps

Two free dynamic QR codes. Yours forever.

No credit card. No expiry. The original dynamic QR platform since 2009.

A dynamic QR code surrounded by the content it can hold