Skip to main content
POST
/
analytics
/
qr
/
export
curl --request POST \
  --url https://management.scanova.io/analytics/qr/export/ \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: multipart/form-data' \
  --form filter_by=qrid \
  --form q=Qf94b25d768294148
"<string>"

Description

This endpoint allows you to export comprehensive analytics data for one or more QR codes over a specific date range.
The export includes scan details, device and OS data, and geographic insights โ€” formatted for spreadsheet analysis.
You can choose between:
  • .pdf for easy sharing and presentation-ready reports
  • .xls**/ ** .xlsx for advanced Excel-based reportingPurpose

Query Parameters

ParameterTypeRequiredDescription
fromstring (YYYY-MM-DD)โœ… YesStart date for analytics data (inclusive).
tostring (YYYY-MM-DD)โœ… YesEnd date for analytics data (inclusive). Defaults to current date.
file_formatstringโœ… YesDesired export format โ€” must be one of: xls, xlsx, pdf.

Request Body

FieldTypeRequiredDescription
filter_bystringโœ… YesSpecify filter type โ€” either qrid or tags.
qarrayโœ… YesArray of QR Code IDs or tags for which analytics will be exported.

Examples

Export Single QR Code (Excel)

curl -X POST "https://management.scanova.io/analytics/qr/export/?from=2025-02-01&to=2025-02-25&file_format=xlsx" \
  -H "Authorization: YOUR_API_KEY" \
  -F "filter_by=qrid" \
  -F "q=Qf94b25d768294148"

Export Multiple QR Codes (PDF)

curl -X POST "https://management.scanova.io/analytics/qr/export/?from=2025-02-01&to=2025-02-25&file_format=pdf" \
  -H "Authorization: YOUR_API_KEY" \
  -F "filter_by=qrid" \
  -F "q=Qf94b25d768294148" \
  -F "q=Qf94b25d768294149" \
  -F "q=Qf94b25d768294150"

Export with Date Range

curl -X POST "https://management.scanova.io/analytics/qr/export/?from=2025-01-01&to=2025-01-31&file_format=xlsx" \
  -H "Authorization: YOUR_API_KEY" \
  -F "filter_by=qrid" \
  -F "q=Qf94b25d768294148"

Export by Tags

curl -X POST "https://management.scanova.io/analytics/qr/export/?from=2025-02-01&to=2025-02-25&file_format=xlsx" \
  -H "Authorization: YOUR_API_KEY" \
  -F "filter_by=tags" \
  -F "q=marketing" \
  -F "q=campaign"

Response

Success Response (200 OK)

The response returns a file download with the analytics data in the requested format.

Excel File (.xlsx/.xls)

  • Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet (xlsx) or application/vnd.ms-excel (xls)
  • Content: Multi-sheet Excel file with comprehensive analytics data
  • Sheets: Multiple sheets with different analytics views

PDF File (.pdf)

  • Content-Type: application/pdf
  • Content: PDF document containing formatted analytics data
  • Structure: Single file with all analytics data
The export endpoint returns a file download. Make sure your application can handle binary file responses and provide appropriate download functionality to users.
Excel files (.xlsx/.xls) provide the most comprehensive data structure with multiple sheets, while PDF files ideal for sharing, printing, and presenting analytics in a visually formatted report.
Large date ranges or many QR codes may result in large file sizes. Consider breaking down exports into smaller chunks if needed.

Integration Examples

JavaScript - Export Analytics

async function exportAnalytics(filterBy, qrCodes, fromDate, toDate, format = 'xlsx') {
  try {
    const formData = new FormData();
    
    // Add filter_by
    formData.append('filter_by', filterBy);
    
    // Add QR code IDs or tags
    qrCodes.forEach(qrId => {
      formData.append('q', qrId);
    });
    
    const response = await fetch(
      `https://management.scanova.io/analytics/qr/export/?from=${fromDate}&to=${toDate}&file_format=${format}`,
      {
        method: 'POST',
        headers: {
          'Authorization': 'YOUR_API_KEY'
        },
        body: formData
      }
    );
    
    if (response.ok) {
      // Get the file blob
      const blob = await response.blob();
      
      // Create download link
      const url = window.URL.createObjectURL(blob);
      const a = document.createElement('a');
      a.href = url;
      a.download = `analytics_${fromDate}_to_${toDate}.${format}`;
      document.body.appendChild(a);
      a.click();
      window.URL.revokeObjectURL(url);
      document.body.removeChild(a);
      
      console.log('Analytics exported successfully');
      return true;
    } else {
      throw new Error('Failed to export analytics');
    }
  } catch (error) {
    console.error('Error exporting analytics:', error);
    return false;
  }
}

// Usage - Export by QR IDs
const qrCodes = ['Qf94b25d768294148', 'Qf94b25d768294149'];
exportAnalytics('qrid', qrCodes, '2025-02-01', '2025-02-25', 'xlsx');

// Usage - Export by tags
const tags = ['marketing', 'campaign'];
exportAnalytics('tags', tags, '2025-02-01', '2025-02-25', 'pdf');

Python - Export Analytics

import requests
from datetime import datetime, timedelta

def export_analytics(filter_by, qr_codes, from_date, to_date, file_format='xlsx'):
    url = "https://management.scanova.io/analytics/qr/export/"
    headers = {"Authorization": "YOUR_API_KEY"}
    
    # Prepare form data - use list of tuples for multiple values with same key
    data = [('filter_by', filter_by)]
    for qr_id in qr_codes:
        data.append(('q', qr_id))
    
    # Prepare query parameters
    params = {
        'from': from_date,
        'to': to_date,
        'file_format': file_format
    }
    
    try:
        response = requests.post(url, headers=headers, data=data, params=params)
        response.raise_for_status()
        
        # Save the file
        filename = f"analytics_{from_date}_to_{to_date}.{file_format}"
        with open(filename, 'wb') as f:
            f.write(response.content)
        
        print(f"Analytics exported successfully to {filename}")
        return filename
        
    except requests.exceptions.RequestException as e:
        print(f"Error exporting analytics: {e}")
        return None

def export_monthly_analytics(filter_by, qr_codes, year, month):
    """Export analytics for a specific month"""
    from_date = f"{year}-{month:02d}-01"
    
    # Calculate last day of month
    if month == 12:
        next_month = datetime(year + 1, 1, 1)
    else:
        next_month = datetime(year, month + 1, 1)
    
    to_date = (next_month - timedelta(days=1)).strftime('%Y-%m-%d')
    
    return export_analytics(filter_by, qr_codes, from_date, to_date, 'xlsx')

# Usage - Export by QR IDs
qr_codes = ['Qf94b25d768294148', 'Qf94b25d768294149']
export_analytics('qrid', qr_codes, '2025-02-01', '2025-02-25', 'xlsx')

# Usage - Export by tags
tags = ['marketing', 'campaign']
export_analytics('tags', tags, '2025-02-01', '2025-02-25', 'pdf')

# Export monthly data
export_monthly_analytics('qrid', qr_codes, 2025, 2)

PHP - Export Analytics

<?php
function exportAnalytics($filterBy, $qrCodes, $fromDate, $toDate, $fileFormat = 'xlsx') {
    $url = "https://management.scanova.io/analytics/qr/export/";
    $headers = [
        "Authorization: YOUR_API_KEY"
    ];
    
    // Prepare form data
    $data = [
        ['name' => 'filter_by', 'contents' => $filterBy]
    ];
    foreach ($qrCodes as $qrId) {
        $data[] = ['name' => 'q', 'contents' => $qrId];
    }
    
    // Prepare query parameters
    $params = http_build_query([
        'from' => $fromDate,
        'to' => $toDate,
        'file_format' => $fileFormat
    ]);
    
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url . '?' . $params);
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
    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) {
        $filename = "analytics_{$fromDate}_to_{$toDate}.{$fileFormat}";
        file_put_contents($filename, $response);
        echo "Analytics exported successfully to {$filename}";
        return $filename;
    } else {
        echo "Error exporting analytics: " . $response;
        return null;
    }
}

// Usage - Export by QR IDs
$qrCodes = ['Qf94b25d768294148', 'Qf94b25d768294149'];
$filename = exportAnalytics('qrid', $qrCodes, '2025-02-01', '2025-02-25', 'xlsx');

// Usage - Export by tags
$tags = ['marketing', 'campaign'];
$filename = exportAnalytics('tags', $tags, '2025-02-01', '2025-02-25', 'pdf');
?>

Notes

  • โœ… Supports bulk analytics export for multiple QR codes at once.
  • โš™๏ธ Recommended file format:
    • .xlsx for visualization/reporting
    • .pdf for presentation, sharing, or archival purposes
  • ๐Ÿ“… Data range can span multiple months, depending on account plan limits.
  • โฑ๏ธ Large exports may take a few seconds to generate โ€” consider background processing for high-volume requests.

Example Use Cases

  • ๐Ÿ“Š Generate weekly or monthly QR scan reports
  • ๐Ÿงพ Export data for BI tools such as Power BI or Tableau
  • ๐Ÿ“ˆ Analyze trends by device, OS, or location in Excel
  • ๐Ÿ” Audit campaign performance across multiple QR codes

Authorizations

Authorization
string
header
required

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

Query Parameters

from
string<date>
required

Start date for analytics data (inclusive). Format: YYYY-MM-DD

to
string<date>
required

End date for analytics data (inclusive). Format: YYYY-MM-DD. Defaults to current date.

file_format
enum<string>
required

Export file format

Available options:
xls,
xlsx,
csv

Body

multipart/form-data
filter_by
enum<string>
required

Filter by QR code ID or tags

Available options:
qrid,
tags
Example:

"qrid"

q
string[]
required

Array of QR code IDs (if filter_by is 'qrid') or tags (if filter_by is 'tags') to include in the export

Example:
["Qf94b25d768294148"]

Response

Analytics data exported successfully

The response is of type file.