GET
https://jmpy.me/api/v1
/
qranalytics
/
:qrCodeId
/
complete
Complete QR Analytics
curl --request GET \
  --url https://jmpy.me/api/v1/qranalytics/:qrCodeId/complete \
  --header 'Authorization: Bearer <token>'
{
  "qrCode": {
    "id": "<string>",
    "name": "<string>",
    "contentType": "<string>",
    "totalScans": 123,
    "lastScannedAt": "<string>",
    "createdAt": "<string>",
    "trackingEnabled": true
  },
  "timeline": [
    {
      "date": "<string>",
      "scans": 123,
      "uniqueScanners": 123
    }
  ],
  "devices": [
    {
      "type": "<string>",
      "scans": 123
    }
  ],
  "locations": [
    {
      "country": "<string>",
      "scans": 123
    }
  ],
  "recentScans": [
    {
      "scannedAt": "<string>",
      "deviceType": "<string>",
      "browser": "<string>",
      "country": "<string>",
      "city": "<string>"
    }
  ]
}
Get comprehensive analytics for a specific QR code including timeline data, device breakdown, location distribution, and recent scan activity all in a single request.
This is the only QR analytics endpoint that requires a QR Code ID path parameter. Use this endpoint when you need detailed analytics for a single QR code rather than user-level aggregates.

Path Parameters

qrCodeId
string
required
QR Code UUID. You can find this ID by:

Query Parameters

days
integer
default:30
Number of days to include in analytics (1-365).

Response

qrCode
object
QR code metadata.
timeline
array
Daily scan data for the specified period.
devices
array
Device type breakdown.
locations
array
Top countries by scans.
recentScans
array
Last 10 scan events for this QR code.

Request Examples

# Get complete analytics for a specific QR code
curl -X GET "https://jmpy.me/api/v1/qranalytics/550e8400-e29b-41d4-a716-446655440000/complete?days=30" \
  -H "Authorization: Bearer YOUR_API_KEY"

# Get analytics for last 90 days
curl -X GET "https://jmpy.me/api/v1/qranalytics/550e8400-e29b-41d4-a716-446655440000/complete?days=90" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response Examples

{
  "success": true,
  "data": {
    "qrCode": {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "Product Launch Campaign",
      "contentType": "url",
      "totalScans": 4523,
      "lastScannedAt": "2025-01-07T15:30:00Z",
      "createdAt": "2024-06-15T10:00:00Z",
      "trackingEnabled": true
    },
    "timeline": [
      { "date": "2025-01-05", "scans": 156, "uniqueScanners": 120 },
      { "date": "2025-01-06", "scans": 189, "uniqueScanners": 145 },
      { "date": "2025-01-07", "scans": 234, "uniqueScanners": 178 }
    ],
    "devices": [
      { "type": "Mobile", "scans": 345 },
      { "type": "Desktop", "scans": 189 },
      { "type": "Tablet", "scans": 45 }
    ],
    "locations": [
      { "country": "United States", "scans": 234 },
      { "country": "United Kingdom", "scans": 156 },
      { "country": "Germany", "scans": 89 }
    ],
    "recentScans": [
      {
        "scannedAt": "2025-01-07T15:30:00Z",
        "deviceType": "Mobile",
        "browser": "Safari",
        "country": "United States",
        "city": "New York"
      },
      {
        "scannedAt": "2025-01-07T15:28:00Z",
        "deviceType": "Mobile",
        "browser": "Chrome",
        "country": "Germany",
        "city": "Berlin"
      }
    ]
  }
}

Use Cases

Create a comprehensive analytics view for a single QR code.
async function getQRCodeDetails(qrCodeId) {
  const response = await fetch(
    `https://jmpy.me/api/v1/qranalytics/${qrCodeId}/complete?days=30`,
    { headers: { 'Authorization': 'Bearer YOUR_API_KEY' } }
  );
  const { data } = await response.json();
  
  return {
    info: {
      name: data.qrCode.name,
      type: data.qrCode.contentType,
      created: new Date(data.qrCode.createdAt).toLocaleDateString()
    },
    stats: {
      totalScans: data.qrCode.totalScans,
      lastScan: data.qrCode.lastScannedAt 
        ? new Date(data.qrCode.lastScannedAt).toLocaleString()
        : 'Never'
    },
    chartData: {
      labels: data.timeline.map(t => t.date),
      scans: data.timeline.map(t => t.scans)
    },
    devices: data.devices,
    locations: data.locations,
    activity: data.recentScans
  };
}
Create a printable performance report for a QR code.
import requests
from datetime import datetime

def generate_qr_report(qr_code_id):
    response = requests.get(
        f'https://jmpy.me/api/v1/qranalytics/{qr_code_id}/complete',
        headers={'Authorization': 'Bearer YOUR_API_KEY'},
        params={'days': 30}
    )
    
    data = response.json()['data']
    qr = data['qrCode']
    
    report = f"""
╔══════════════════════════════════════════════════════════════╗
║                    QR CODE PERFORMANCE REPORT                ║
╠══════════════════════════════════════════════════════════════╣
║  Name: {qr['name'][:50]:<50}
║  Type: {qr['contentType']:<50}
║  Created: {qr['createdAt'][:10]:<48}
╠══════════════════════════════════════════════════════════════╣
║  METRICS (Last 30 Days)                                       ║
║  ─────────────────────                                        ║
║  Total Scans: {qr['totalScans']:<47}
║  Daily Average: {sum(t['scans'] for t in data['timeline']) / max(len(data['timeline']), 1):.1f}
╠══════════════════════════════════════════════════════════════╣
║  TOP DEVICES                                                  ║
║  ───────────                                                  ║"""
    
    for device in data['devices'][:3]:
        report += f"\n║  • {device['type']}: {device['scans']} scans"
    
    report += """
╠══════════════════════════════════════════════════════════════╣
║  TOP COUNTRIES                                                ║
║  ─────────────                                                ║"""
    
    for loc in data['locations'][:3]:
        report += f"\n║  • {loc['country']}: {loc['scans']} scans"
    
    report += "\n╚══════════════════════════════════════════════════════════════╝"
    
    return report

print(generate_qr_report('550e8400-e29b-41d4-a716-446655440000'))
Fetch analytics for multiple QR codes and compare performance.
async function compareQRCodes(qrCodeIds: string[]) {
  const results = await Promise.all(
    qrCodeIds.map(async id => {
      const response = await fetch(
        `https://jmpy.me/api/v1/qranalytics/${id}/complete?days=30`,
        { headers: { 'Authorization': 'Bearer YOUR_API_KEY' } }
      );
      return response.json();
    })
  );
  
  // Sort by total scans
  const comparison = results
    .map(r => r.data)
    .sort((a, b) => b.qrCode.totalScans - a.qrCode.totalScans);
  
  console.log('QR Code Comparison (by total scans):');
  comparison.forEach((qr, i) => {
    const recentTotal = qr.timeline.reduce((sum, t) => sum + t.scans, 0);
    console.log(`${i + 1}. ${qr.qrCode.name}`);
    console.log(`   Total: ${qr.qrCode.totalScans} | Recent: ${recentTotal}`);
  });
  
  return comparison;
}