GET
https://jmpy.me/api/v1
/
qranalytics
/
recent
Recent Activity
curl --request GET \
  --url https://jmpy.me/api/v1/qranalytics/recent \
  --header 'Authorization: Bearer <token>'
{
  "data": [
    {
      "id": "<string>",
      "scannedAt": "<string>",
      "deviceType": "<string>",
      "browser": "<string>",
      "os": "<string>",
      "country": "<string>",
      "city": "<string>",
      "isUnique": true,
      "qrId": "<string>",
      "qrName": "<string>",
      "contentType": "<string>"
    }
  ]
}
Get a feed of the most recent QR code scans with detailed information about each scan event including device, location, and QR code details.

Query Parameters

limit
integer
default:20
Number of recent scans to return (max 100).

Response

data
array
Array of recent scan events.

Request Examples

# Get last 20 scan events
curl -X GET "https://jmpy.me/api/v1/qranalytics/recent?limit=20" \
  -H "Authorization: Bearer YOUR_API_KEY"

# Get last 50 scan events
curl -X GET "https://jmpy.me/api/v1/qranalytics/recent?limit=50" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response Examples

{
  "success": true,
  "data": [
    {
      "id": "click-uuid-1",
      "scannedAt": "2025-01-07T15:30:45Z",
      "deviceType": "Mobile",
      "browser": "Safari",
      "os": "iOS",
      "country": "United States",
      "city": "New York",
      "isUnique": true,
      "qrId": "550e8400-e29b-41d4-a716-446655440000",
      "qrName": "Product Launch Campaign",
      "contentType": "url"
    },
    {
      "id": "click-uuid-2",
      "scannedAt": "2025-01-07T15:28:12Z",
      "deviceType": "Mobile",
      "browser": "Chrome",
      "os": "Android",
      "country": "Germany",
      "city": "Berlin",
      "isUnique": false,
      "qrId": "660e8400-e29b-41d4-a716-446655440001",
      "qrName": "Store Front Display",
      "contentType": "url"
    },
    {
      "id": "click-uuid-3",
      "scannedAt": "2025-01-07T15:25:33Z",
      "deviceType": "Desktop",
      "browser": "Chrome",
      "os": "Windows",
      "country": "United Kingdom",
      "city": "London",
      "isUnique": true,
      "qrId": "770e8400-e29b-41d4-a716-446655440002",
      "qrName": "Business Card",
      "contentType": "vcard"
    }
  ]
}

Use Cases

Create a real-time activity feed showing recent QR scans.
async function getActivityFeed() {
  const response = await fetch(
    'https://jmpy.me/api/v1/qranalytics/recent?limit=10',
    { headers: { 'Authorization': 'Bearer YOUR_API_KEY' } }
  );
  const { data } = await response.json();
  
  // Format for activity feed display
  return data.map(scan => {
    const timeAgo = getTimeAgo(new Date(scan.scannedAt));
    const icon = scan.isUnique ? '🆕' : '🔄';
    
    return {
      icon,
      message: `${scan.qrName} scanned from ${scan.city}, ${scan.country}`,
      detail: `${scan.deviceType}${scan.browser}${scan.os}`,
      time: timeAgo
    };
  });
}

function getTimeAgo(date) {
  const seconds = Math.floor((new Date() - date) / 1000);
  if (seconds < 60) return `${seconds}s ago`;
  if (seconds < 3600) return `${Math.floor(seconds / 60)}m ago`;
  if (seconds < 86400) return `${Math.floor(seconds / 3600)}h ago`;
  return `${Math.floor(seconds / 86400)}d ago`;
}
Set up monitoring to detect unusual scan patterns.
import requests
from collections import Counter
from datetime import datetime, timedelta

def monitor_activity():
    response = requests.get(
        'https://jmpy.me/api/v1/qranalytics/recent?limit=100',
        headers={'Authorization': 'Bearer YOUR_API_KEY'}
    )
    
    scans = response.json()['data']
    
    # Count scans by QR code
    qr_counts = Counter(scan['qrName'] for scan in scans)
    
    # Check for unusual spikes (more than 20 scans in recent history)
    alerts = []
    for qr_name, count in qr_counts.items():
        if count > 20:
            alerts.append({
                'type': 'SPIKE',
                'qr': qr_name,
                'count': count,
                'message': f"Unusual activity: {qr_name} has {count} recent scans"
            })
    
    # Check for unusual locations
    locations = Counter(scan['country'] for scan in scans)
    unusual_countries = [c for c, count in locations.items() 
                       if c not in ['United States', 'United Kingdom', 'Germany']]
    
    if unusual_countries:
        alerts.append({
            'type': 'NEW_REGION',
            'countries': unusual_countries,
            'message': f"New activity from: {', '.join(unusual_countries)}"
        })
    
    return alerts
Get recent scans filtered by device type for targeted analysis.
interface FilteredActivity {
  mobile: RecentScan[];
  desktop: RecentScan[];
  tablet: RecentScan[];
}

async function getFilteredActivity(): Promise<FilteredActivity> {
  const response = await fetch(
    'https://jmpy.me/api/v1/qranalytics/recent?limit=100',
    { headers: { 'Authorization': 'Bearer YOUR_API_KEY' } }
  );
  const { data } = await response.json();
  
  return {
    mobile: data.filter(s => s.deviceType === 'Mobile'),
    desktop: data.filter(s => s.deviceType === 'Desktop'),
    tablet: data.filter(s => s.deviceType === 'Tablet')
  };
}