GET
https://jmpy.me/api/v1
/
qranalytics
/
export
Export Analytics
curl --request GET \
  --url https://jmpy.me/api/v1/qranalytics/export \
  --header 'Authorization: Bearer <token>'
{
  "data": [
    {
      "scanned_at": "<string>",
      "qr_name": "<string>",
      "content_type": "<string>",
      "device_type": "<string>",
      "browser_name": "<string>",
      "os_name": "<string>",
      "country": "<string>",
      "city": "<string>",
      "is_unique": true
    }
  ]
}
Export your QR analytics data in CSV or JSON format for external analysis, reporting, or backup purposes.

Query Parameters

days
integer
default:30
Number of days to include in the export (1-365).
format
string
default:"csv"
Export format:
  • csv - Comma-separated values file (suitable for Excel, Google Sheets)
  • json - JSON array of scan records

Response

CSV Format

When format=csv, the response is a downloadable CSV file with the following columns:
ColumnDescription
Scanned AtISO 8601 timestamp of the scan
QR NameName of the QR code
Content TypeType of QR content (url, vcard, etc.)
DeviceDevice type (Mobile, Desktop, Tablet)
BrowserBrowser name
OSOperating system
CountryCountry of origin
CityCity of origin
UniqueWhether this was a unique visit (Yes/No)

JSON Format

When format=json, the response contains an array of scan records.
data
array
Array of scan records.

Request Examples

# Export as CSV (downloads file)
curl -X GET "https://jmpy.me/api/v1/qranalytics/export?days=30&format=csv" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -o qr-analytics.csv

# Export as JSON
curl -X GET "https://jmpy.me/api/v1/qranalytics/export?days=30&format=json" \
  -H "Authorization: Bearer YOUR_API_KEY"

# Export last 90 days as CSV
curl -X GET "https://jmpy.me/api/v1/qranalytics/export?days=90&format=csv" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -o qr-analytics-90d.csv

Response Examples

Scanned At,QR Name,Content Type,Device,Browser,OS,Country,City,Unique
2025-01-07T15:30:00Z,Product Launch,url,Mobile,Safari,iOS,United States,New York,Yes
2025-01-07T15:28:00Z,Store Display,url,Mobile,Chrome,Android,Germany,Berlin,No
2025-01-07T15:25:00Z,Business Card,vcard,Desktop,Chrome,Windows,United Kingdom,London,Yes
2025-01-07T15:20:00Z,Product Launch,url,Tablet,Safari,iOS,Canada,Toronto,Yes

Use Cases

Export data and create formatted Excel reports.
import requests
import pandas as pd
from io import StringIO

def create_excel_report():
    # Fetch CSV data
    response = requests.get(
        'https://jmpy.me/api/v1/qranalytics/export',
        headers={'Authorization': 'Bearer YOUR_API_KEY'},
        params={'days': 30, 'format': 'csv'}
    )
    
    df = pd.read_csv(StringIO(response.text))
    
    # Create Excel with multiple sheets
    with pd.ExcelWriter('qr-report.xlsx', engine='openpyxl') as writer:
        # Raw data
        df.to_excel(writer, sheet_name='Raw Data', index=False)
        
        # Summary by QR code
        summary = df.groupby('QR Name').agg({
            'Scanned At': 'count',
            'Unique': lambda x: (x == 'Yes').sum()
        }).rename(columns={
            'Scanned At': 'Total Scans',
            'Unique': 'Unique Scans'
        })
        summary.to_excel(writer, sheet_name='By QR Code')
        
        # Summary by country
        by_country = df.groupby('Country').size().reset_index(name='Scans')
        by_country.to_excel(writer, sheet_name='By Country', index=False)
    
    print("Created qr-report.xlsx")
Set up automated daily backups of analytics data.
const fetch = require('node-fetch');
const fs = require('fs');
const path = require('path');

async function backupAnalytics() {
  const date = new Date().toISOString().split('T')[0];
  const filename = `qr-analytics-backup-${date}.json`;
  
  const response = await fetch(
    'https://jmpy.me/api/v1/qranalytics/export?days=1&format=json',
    { headers: { 'Authorization': 'Bearer YOUR_API_KEY' } }
  );
  
  const data = await response.json();
  
  // Save to backup directory
  const backupDir = './backups';
  if (!fs.existsSync(backupDir)) {
    fs.mkdirSync(backupDir, { recursive: true });
  }
  
  fs.writeFileSync(
    path.join(backupDir, filename),
    JSON.stringify(data.data, null, 2)
  );
  
  console.log(`Backed up ${data.data.length} records to ${filename}`);
}

// Run daily with cron or scheduler
backupAnalytics();
Export data and automatically upload to Google Sheets.
import { google } from 'googleapis';

async function exportToGoogleSheets(spreadsheetId: string) {
  // Get CSV data
  const response = await fetch(
    'https://jmpy.me/api/v1/qranalytics/export?days=30&format=json',
    { headers: { 'Authorization': 'Bearer YOUR_API_KEY' } }
  );
  const { data } = await response.json();
  
  // Prepare data for Sheets
  const headers = [
    'Scanned At', 'QR Name', 'Content Type', 'Device',
    'Browser', 'OS', 'Country', 'City', 'Unique'
  ];
  
  const rows = data.map(record => [
    record.scanned_at,
    record.qr_name,
    record.content_type,
    record.device_type,
    record.browser_name,
    record.os_name,
    record.country,
    record.city,
    record.is_unique ? 'Yes' : 'No'
  ]);
  
  // Upload to Google Sheets
  const sheets = google.sheets({ version: 'v4' });
  
  await sheets.spreadsheets.values.update({
    spreadsheetId,
    range: 'QR Analytics!A1',
    valueInputOption: 'RAW',
    requestBody: {
      values: [headers, ...rows]
    }
  });
  
  console.log(`Uploaded ${rows.length} rows to Google Sheets`);
}