GET
https://jmpy.me/api/v1
/
qranalytics
/
locations
Location Analytics
curl --request GET \
  --url https://jmpy.me/api/v1/qranalytics/locations \
  --header 'Authorization: Bearer <token>'
{
  "countries": [
    {
      "country": "<string>",
      "scans": 123,
      "uniqueScanners": 123,
      "percentage": 123
    }
  ],
  "cities": [
    {
      "country": "<string>",
      "city": "<string>",
      "scans": 123,
      "uniqueScanners": 123
    }
  ],
  "totalScans": 123
}
Get geographic location breakdown of QR code scans including country and city distribution.
This endpoint returns user-level aggregated location data across all your QR codes. For location analytics on a specific QR code, use the Complete Analytics endpoint.

Query Parameters

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

Response

countries
array
Country distribution of scans.
cities
array
City distribution of scans (top 30).
totalScans
integer
Total number of scans with location data.
Geographic analytics may be restricted based on your plan. Users on free plans may have limited access to city-level data. Upgrade to access full geographic analytics.

Request Examples

# Get location analytics for last 30 days
curl -X GET "https://jmpy.me/api/v1/qranalytics/locations?days=30" \
  -H "Authorization: Bearer YOUR_API_KEY"

# Get location analytics for last 90 days
curl -X GET "https://jmpy.me/api/v1/qranalytics/locations?days=90" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response Examples

{
  "success": true,
  "data": {
    "countries": [
      { 
        "country": "United States", 
        "scans": 823, 
        "uniqueScanners": 650, 
        "percentage": 35.1 
      },
      { 
        "country": "United Kingdom", 
        "scans": 456, 
        "uniqueScanners": 380, 
        "percentage": 19.4 
      },
      { 
        "country": "Germany", 
        "scans": 312, 
        "uniqueScanners": 260, 
        "percentage": 13.3 
      },
      { 
        "country": "Canada", 
        "scans": 234, 
        "uniqueScanners": 190, 
        "percentage": 10.0 
      }
    ],
    "cities": [
      { 
        "country": "United States", 
        "city": "New York", 
        "scans": 234, 
        "uniqueScanners": 189 
      },
      { 
        "country": "United Kingdom", 
        "city": "London", 
        "scans": 189, 
        "uniqueScanners": 156 
      },
      { 
        "country": "United States", 
        "city": "Los Angeles", 
        "scans": 145, 
        "uniqueScanners": 120 
      },
      { 
        "country": "Germany", 
        "city": "Berlin", 
        "scans": 98, 
        "uniqueScanners": 82 
      }
    ],
    "totalScans": 2345
  }
}

Use Cases

Prepare location data for visualization on a map.
async function getMapData() {
  const response = await fetch(
    'https://jmpy.me/api/v1/qranalytics/locations?days=30',
    { headers: { 'Authorization': 'Bearer YOUR_API_KEY' } }
  );
  const { data } = await response.json();
  
  // Format for map visualization
  const countryData = data.countries.map(country => ({
    name: country.country,
    value: country.scans,
    percentage: country.percentage
  }));
  
  return countryData;
}
Analyze which countries and cities drive the most QR engagement.
import requests

def identify_key_markets():
    response = requests.get(
        'https://jmpy.me/api/v1/qranalytics/locations?days=30',
        headers={'Authorization': 'Bearer YOUR_API_KEY'}
    )
    
    data = response.json()['data']
    
    # Top 3 countries represent key markets
    key_markets = data['countries'][:3]
    
    print("=== Key Market Analysis ===")
    print("\nPrimary Markets (Country Level):")
    for market in key_markets:
        print(f"  {market['country']}: {market['percentage']}% of traffic")
    
    # Identify top city in each key market
    print("\nTop Cities per Market:")
    for market in key_markets:
        top_city = next(
            (c for c in data['cities'] if c['country'] == market['country']),
            None
        )
        if top_city:
            print(f"  {market['country']}: {top_city['city']} ({top_city['scans']} scans)")
Compare QR performance across different regions.
async function compareRegionalPerformance() {
  const response = await fetch(
    'https://jmpy.me/api/v1/qranalytics/locations?days=30',
    { headers: { 'Authorization': 'Bearer YOUR_API_KEY' } }
  );
  const { data } = await response.json();
  
  // Group countries by region
  const regions: Record<string, number> = {
    'North America': 0,
    'Europe': 0,
    'Asia': 0,
    'Other': 0
  };
  
  const regionMap: Record<string, string> = {
    'United States': 'North America',
    'Canada': 'North America',
    'Mexico': 'North America',
    'United Kingdom': 'Europe',
    'Germany': 'Europe',
    'France': 'Europe',
    'Japan': 'Asia',
    'China': 'Asia',
    'India': 'Asia'
  };
  
  data.countries.forEach(country => {
    const region = regionMap[country.country] || 'Other';
    regions[region] += country.scans;
  });
  
  console.log('Regional Performance:');
  Object.entries(regions)
    .sort((a, b) => b[1] - a[1])
    .forEach(([region, scans]) => {
      console.log(`  ${region}: ${scans} scans`);
    });
}