Skip to main content
GET
/
auth
/
stats
/
Get Account Statistics
curl --request GET \
  --url https://management.scanova.io/auth/stats/ \
  --header 'Authorization: <api-key>'
{
  "total_qr_count": 150,
  "static_qr_count": 25,
  "dynamic_qr_count": 125,
  "total_scan_count": 5420,
  "total_designer_qr_count": 45,
  "custom_domain_count": 12,
  "lead_list_count": 8,
  "shared_user_count": 5
}

Description

This endpoint provides aggregated statistics for your Scanova account.
It’s ideal for dashboard overviews, usage monitoring, or account-level analytics integrations.
You can retrieve all metrics at once or request specific fields (like only total scans or dynamic QR count) to optimize performance.

Available Field Values

FieldDescription
total_qr_countTotal number of QR codes in the account
static_qr_countCount of static QR codes
dynamic_qr_countCount of dynamic QR codes
total_scan_countTotal number of scans across all QR codes
total_designer_qr_countNumber of QR codes using custom design templates
custom_domain_countNumber of QR codes using custom domains
lead_list_countTotal number of lead lists created
shared_user_countNumber of shared users (collaborators) in the account

Examples

Get All Account Statistics

curl -X GET "https://management.scanova.io/auth/stats/" \
  -H "Authorization: YOUR_API_KEY"

Get Filtered Statistics

curl -X GET "https://management.scanova.io/auth/stats/?fields=total_qr_count,total_scan_count,lead_list_count" \
  -H "Authorization: YOUR_API_KEY"

Get QR Code Counts Only

curl -X GET "https://management.scanova.io/auth/stats/?fields=total_qr_count,static_qr_count,dynamic_qr_count" \
  -H "Authorization: YOUR_API_KEY"

Get Usage Metrics

curl -X GET "https://management.scanova.io/auth/stats/?fields=total_scan_count,total_designer_qr_count,custom_domain_count" \
  -H "Authorization: YOUR_API_KEY"

Response Structure

Success Response (200 OK)

{
  "total_qr_count": 150,
  "static_qr_count": 25,
  "dynamic_qr_count": 125,
  "total_scan_count": 5420,
  "total_designer_qr_count": 45,
  "custom_domain_count": 12,
  "lead_list_count": 8,
  "shared_user_count": 5
}

Filtered Response Example

When using fields=total_qr_count,total_scan_count,lead_list_count:
{
  "total_qr_count": 150,
  "total_scan_count": 5420,
  "lead_list_count": 8
}

Schema

FieldTypeExampleDescription
total_qr_countinteger150Total QR codes in the account
static_qr_countinteger25Count of static QR codes
dynamic_qr_countinteger125Count of dynamic QR codes
total_scan_countinteger5420Total scans recorded
total_designer_qr_countinteger45Number of custom-designed QR codes
custom_domain_countinteger12QR codes with custom domains
lead_list_countinteger8Total lead lists created
shared_user_countinteger5Shared users associated with the account

Integration Examples

JavaScript - Get Account Statistics

async function getAccountStats(fields = null) {
  try {
    let url = "https://management.scanova.io/auth/stats/";
    if (fields) {
      url += `?fields=${fields.join(',')}`;
    }
    
    const response = await fetch(url, {
      method: 'GET',
      headers: {
        'Authorization': 'YOUR_API_KEY',
        'Content-Type': 'application/json'
      }
    });
    
    if (response.ok) {
      const stats = await response.json();
      return stats;
    } else {
      throw new Error('Failed to fetch account statistics');
    }
  } catch (error) {
    console.error('Error fetching account statistics:', error);
    return null;
  }
}

// Usage - Get all statistics
const allStats = await getAccountStats();
console.log('All statistics:', allStats);

// Usage - Get filtered statistics
const qrStats = await getAccountStats(['total_qr_count', 'static_qr_count', 'dynamic_qr_count']);
console.log('QR Code statistics:', qrStats);

// Usage - Get usage metrics
const usageStats = await getAccountStats(['total_scan_count', 'total_designer_qr_count', 'custom_domain_count']);
console.log('Usage statistics:', usageStats);

Python - Get Account Statistics

import requests

def get_account_stats(fields=None):
    url = "https://management.scanova.io/auth/stats/"
    headers = {"Authorization": "YOUR_API_KEY"}
    
    params = {}
    if fields:
        params['fields'] = ','.join(fields)
    
    try:
        response = requests.get(url, headers=headers, params=params)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
        print(f"Error fetching account statistics: {e}")
        return None

def display_account_overview():
    """Display a comprehensive account overview"""
    stats = get_account_stats()
    if stats:
        print("=== Account Overview ===")
        print(f"Total QR Codes: {stats.get('total_qr_count', 0)}")
        print(f"  - Static: {stats.get('static_qr_count', 0)}")
        print(f"  - Dynamic: {stats.get('dynamic_qr_count', 0)}")
        print(f"Total Scans: {stats.get('total_scan_count', 0)}")
        print(f"Designer QR Codes: {stats.get('total_designer_qr_count', 0)}")
        print(f"Custom Domains: {stats.get('custom_domain_count', 0)}")
        print(f"Lead Lists: {stats.get('lead_list_count', 0)}")
        print(f"Shared Users: {stats.get('shared_user_count', 0)}")
        
        # Calculate usage percentages
        total_qr = stats.get('total_qr_count', 0)
        if total_qr > 0:
            designer_pct = (stats.get('total_designer_qr_count', 0) / total_qr) * 100
            custom_domain_pct = (stats.get('custom_domain_count', 0) / total_qr) * 100
            print(f"\n=== Usage Analysis ===")
            print(f"Designer QR Codes: {designer_pct:.1f}% of total")
            print(f"Custom Domains: {custom_domain_pct:.1f}% of total")
    
    return stats

def get_qr_code_breakdown():
    """Get detailed QR code statistics"""
    return get_account_stats(['total_qr_count', 'static_qr_count', 'dynamic_qr_count'])

def get_usage_metrics():
    """Get usage and performance metrics"""
    return get_account_stats(['total_scan_count', 'total_designer_qr_count', 'custom_domain_count'])

# Usage
display_account_overview()
qr_breakdown = get_qr_code_breakdown()
usage_metrics = get_usage_metrics()

PHP - Get Account Statistics

<?php
function getAccountStats($fields = null) {
    $url = "https://management.scanova.io/auth/stats/";
    $headers = [
        "Authorization: YOUR_API_KEY",
        "Content-Type: application/json"
    ];
    
    $params = [];
    if ($fields) {
        $params['fields'] = implode(',', $fields);
    }
    
    $queryString = http_build_query($params);
    if ($queryString) {
        $url .= '?' . $queryString;
    }
    
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    
    $response = curl_exec($ch);
    $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    curl_close($ch);
    
    if ($httpCode === 200) {
        return json_decode($response, true);
    } else {
        echo "Error fetching account statistics: " . $response;
        return null;
    }
}

function displayAccountOverview() {
    $stats = getAccountStats();
    if ($stats) {
        echo "=== Account Overview ===\n";
        echo "Total QR Codes: " . ($stats['total_qr_count'] ?? 0) . "\n";
        echo "  - Static: " . ($stats['static_qr_count'] ?? 0) . "\n";
        echo "  - Dynamic: " . ($stats['dynamic_qr_count'] ?? 0) . "\n";
        echo "Total Scans: " . ($stats['total_scan_count'] ?? 0) . "\n";
        echo "Designer QR Codes: " . ($stats['total_designer_qr_count'] ?? 0) . "\n";
        echo "Custom Domains: " . ($stats['custom_domain_count'] ?? 0) . "\n";
        echo "Lead Lists: " . ($stats['lead_list_count'] ?? 0) . "\n";
        echo "Shared Users: " . ($stats['shared_user_count'] ?? 0) . "\n";
        
        // Calculate usage percentages
        $totalQr = $stats['total_qr_count'] ?? 0;
        if ($totalQr > 0) {
            $designerPct = (($stats['total_designer_qr_count'] ?? 0) / $totalQr) * 100;
            $customDomainPct = (($stats['custom_domain_count'] ?? 0) / $totalQr) * 100;
            echo "\n=== Usage Analysis ===\n";
            echo "Designer QR Codes: " . number_format($designerPct, 1) . "% of total\n";
            echo "Custom Domains: " . number_format($customDomainPct, 1) . "% of total\n";
        }
    }
    
    return $stats;
}

function getQrCodeBreakdown() {
    return getAccountStats(['total_qr_count', 'static_qr_count', 'dynamic_qr_count']);
}

function getUsageMetrics() {
    return getAccountStats(['total_scan_count', 'total_designer_qr_count', 'custom_domain_count']);
}

// Usage
displayAccountOverview();
$qrBreakdown = getQrCodeBreakdown();
$usageMetrics = getUsageMetrics();
?

Use Cases

  • 📊 Admin dashboards: Display live account metrics like total scans and QR creation trends.
  • 🧮 Usage-based billing: Validate active and dynamic QR usage for plan-based limits.
  • 🧠 Insights & analytics: Track QR code adoption and engagement performance across users.
  • ⚙️ Automation scripts: Integrate account metrics into internal monitoring tools or CRMs.

Authorizations

Authorization
string
header
required

API key authentication. Enter your API key directly in the Authorization header.

Query Parameters

fields
enum<string>

Comma-separated list of fields to include in the response. If not specified, all fields are returned.

Available options:
total_qr_count,
static_qr_count,
dynamic_qr_count,
total_scan_count,
total_designer_qr_count,
custom_domain_count,
lead_list_count,
shared_user_count

Response

Account statistics retrieved successfully

total_qr_count
integer

Total number of QR codes in the account

Example:

150

static_qr_count
integer

Number of static QR codes

Example:

25

dynamic_qr_count
integer

Number of dynamic QR codes

Example:

125

total_scan_count
integer

Total number of scans across all QR codes

Example:

5420

total_designer_qr_count
integer

Number of QR codes with custom designs

Example:

45

custom_domain_count
integer

Number of QR codes using custom domains

Example:

12

lead_list_count
integer

Number of lead lists in the account

Example:

8

shared_user_count
integer

Number of shared users in the account

Example:

5