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>",
"utm_source": "<string>",
"utm_medium": "<string>",
"utm_campaign": "<string>",
"utm_term": "<string>",
"utm_content": "<string>"
}
]
}QR Code Analytics
Recent Activity
Get the most recent QR code scan activity
GET
/
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>",
"utm_source": "<string>",
"utm_medium": "<string>",
"utm_campaign": "<string>",
"utm_term": "<string>",
"utm_content": "<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
Number of recent scans to return (max 100).
Response
Array of recent scan events.
Show Scan Event Object
Show Scan Event Object
Unique click/scan event ID.
ISO 8601 timestamp when the scan occurred.
Device type:
Mobile, Desktop, or Tablet.Browser name (e.g., “Chrome”, “Safari”).
Operating system (e.g., “iOS”, “Android”, “Windows”).
Country name where the scan originated.
City name where the scan originated.
Whether this was the visitor’s first scan of this QR code.
UUID of the QR code that was scanned.
Name of the QR code that was scanned.
Content type of the QR code:
url, text, vcard, wifi, email, sms, phone.Campaign source (if provided, otherwise
null).Campaign medium (if provided, otherwise
null).Campaign name (if provided, otherwise
null).Campaign term/keywords (if provided, otherwise
null).Campaign content/ad variant (if provided, otherwise
null).Request Examples
- cURL
- Node.js
- TypeScript
- Python
- PHP
- Go
- Java
# 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"
const fetch = require('node-fetch');
const response = await fetch(
'https://jmpy.me/api/v1/qranalytics/recent?limit=20',
{
headers: { 'Authorization': 'Bearer YOUR_API_KEY' }
}
);
const data = await response.json();
console.log('Recent Scan Activity:');
data.data.forEach(scan => {
const time = new Date(scan.scannedAt).toLocaleString();
console.log(`[${time}] ${scan.qrName}`);
console.log(` Device: ${scan.deviceType} | Location: ${scan.city}, ${scan.country}`);
});
import axios from 'axios';
interface RecentScan {
id: string;
scannedAt: string;
deviceType: string;
browser: string;
os: string;
country: string;
city: string;
isUnique: boolean;
qrId: string;
qrName: string;
contentType: string;
}
const response = await axios.get<{ success: boolean; data: RecentScan[] }>(
'https://jmpy.me/api/v1/qranalytics/recent',
{
headers: { 'Authorization': 'Bearer YOUR_API_KEY' },
params: { limit: 20 }
}
);
const recentScans = response.data.data;
console.log(`Showing ${recentScans.length} recent scans`);
recentScans.forEach(scan => {
console.log(`${scan.scannedAt}: ${scan.qrName} from ${scan.country}`);
});
import requests
from datetime import datetime
response = requests.get(
'https://jmpy.me/api/v1/qranalytics/recent',
headers={'Authorization': 'Bearer YOUR_API_KEY'},
params={'limit': 20}
)
recent_scans = response.json()['data']
print("Recent Scan Activity:")
for scan in recent_scans:
timestamp = datetime.fromisoformat(scan['scannedAt'].replace('Z', '+00:00'))
time_str = timestamp.strftime('%Y-%m-%d %H:%M')
print(f"[{time_str}] {scan['qrName']}")
print(f" Device: {scan['deviceType']} ({scan['browser']}/{scan['os']})")
print(f" Location: {scan['city']}, {scan['country']}")
print()
<?php
$client = new GuzzleHttp\Client();
$response = $client->request('GET', 'https://jmpy.me/api/v1/qranalytics/recent', [
'headers' => [
'Authorization' => 'Bearer YOUR_API_KEY'
],
'query' => [
'limit' => 20
]
]);
$recentScans = json_decode($response->getBody(), true)['data'];
echo "Recent Scan Activity:\n";
foreach ($recentScans as $scan) {
$time = date('Y-m-d H:i', strtotime($scan['scannedAt']));
echo "[{$time}] {$scan['qrName']}\n";
echo " Device: {$scan['deviceType']} | Location: {$scan['city']}, {$scan['country']}\n\n";
}
?>
package main
import (
"fmt"
"net/http"
"net/url"
"io"
)
func main() {
baseURL := "https://jmpy.me/api/v1/qranalytics/recent"
params := url.Values{}
params.Add("limit", "20")
req, _ := http.NewRequest("GET", baseURL+"?"+params.Encode(), nil)
req.Header.Add("Authorization", "Bearer YOUR_API_KEY")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.URI;
import java.net.http.HttpResponse;
HttpClient client = HttpClient.newHttpClient();
String url = "https://jmpy.me/api/v1/qranalytics/recent?limit=20";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(url))
.header("Authorization", "Bearer YOUR_API_KEY")
.GET()
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
Response Examples
- 200 OK
- 401 Unauthorized
{
"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",
"utm_source": "newsletter",
"utm_medium": "email",
"utm_campaign": "summer_promo",
"utm_term": null,
"utm_content": null
},
{
"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",
"utm_source": "flyer",
"utm_medium": "print",
"utm_campaign": "store_launch",
"utm_term": null,
"utm_content": null
},
{
"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",
"utm_source": null,
"utm_medium": null,
"utm_campaign": null,
"utm_term": null,
"utm_content": null
}
]
}
{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "User authentication required"
}
}
Use Cases
Build a live activity feed
Build a live activity feed
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`;
}
Monitor for unusual activity
Monitor for unusual activity
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
Filter by device type
Filter by device type
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')
};
}
Related Endpoints
Top Performing
See which QR codes drive the most scans
Scans Timeline
Get time-series scan data
Device Analytics
Get device breakdown for all scans
Location Analytics
Get geographic distribution of scans
⌘I