GET
https://jmpy.me/api/v1
/
analytics
/
device
/
:shortUrlId
Device Analytics
curl --request GET \
  --url https://jmpy.me/api/v1/analytics/device/:shortUrlId \
  --header 'Authorization: Bearer <token>'
{
  "data": {
    "browsers": [
      {
        "name": "<string>",
        "clicks": 123,
        "percentage": 123
      }
    ],
    "operating_systems": [
      {
        "name": "<string>",
        "clicks": 123,
        "percentage": 123
      }
    ],
    "device_types": [
      {
        "type": "<string>",
        "clicks": 123,
        "percentage": 123
      }
    ]
  },
  "total_device_combinations": 123
}
Get detailed breakdown of devices, browsers, and operating systems used by visitors clicking your short URLs.
For user-level device analytics across all your URLs, use the User Device Analytics endpoint.

Path Parameters

shortUrlId
string
required
Short URL identifier. Accepts:
  • UUID: 550e8400-e29b-41d4-a716-446655440000
  • Short code: abc123
  • Custom alias: my-custom-link

Response

data
object
Device analytics data.
total_device_combinations
integer
Total number of unique device combinations tracked.

Request Examples

# Get device analytics by UUID
curl -X GET "https://jmpy.me/api/v1/analytics/device/550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer YOUR_API_KEY"

# Get device analytics by short code
curl -X GET "https://jmpy.me/api/v1/analytics/device/abc123" \
  -H "Authorization: Bearer YOUR_API_KEY"

# Get device analytics by custom alias
curl -X GET "https://jmpy.me/api/v1/analytics/device/my-promo-link" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response Examples

{
  "success": true,
  "data": {
    "data": {
      "browsers": [
        { "name": "Chrome", "clicks": 2345, "percentage": 51.8 },
        { "name": "Safari", "clicks": 1234, "percentage": 27.3 },
        { "name": "Firefox", "clicks": 567, "percentage": 12.5 },
        { "name": "Edge", "clicks": 234, "percentage": 5.2 },
        { "name": "Other", "clicks": 143, "percentage": 3.2 }
      ],
      "operating_systems": [
        { "name": "iOS", "clicks": 1890, "percentage": 41.8 },
        { "name": "Android", "clicks": 1234, "percentage": 27.3 },
        { "name": "Windows", "clicks": 987, "percentage": 21.8 },
        { "name": "macOS", "clicks": 312, "percentage": 6.9 },
        { "name": "Linux", "clicks": 100, "percentage": 2.2 }
      ],
      "device_types": [
        { "type": "Mobile", "clicks": 2654, "percentage": 58.7 },
        { "type": "Desktop", "clicks": 1569, "percentage": 34.7 },
        { "type": "Tablet", "clicks": 300, "percentage": 6.6 }
      ]
    },
    "total_device_combinations": 15
  }
}

User-Level Device Analytics

Get aggregated device analytics across all your short URLs.

Endpoint

GET /analytics/user-devices

Query Parameters

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

Request Example

curl -X GET "https://jmpy.me/api/v1/analytics/user-devices?days=30" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response Example

{
  "success": true,
  "data": {
    "data": {
      "browsers": [
        { "name": "Chrome", "clicks": 12450, "percentage": 48.2 },
        { "name": "Safari", "clicks": 8230, "percentage": 31.9 }
      ],
      "operating_systems": [
        { "name": "iOS", "clicks": 9870, "percentage": 38.2 },
        { "name": "Android", "clicks": 7650, "percentage": 29.6 }
      ],
      "device_types": [
        { "type": "Mobile", "clicks": 15430, "percentage": 59.7 },
        { "type": "Desktop", "clicks": 9120, "percentage": 35.3 }
      ]
    }
  }
}
Device analytics may be restricted based on your plan. Users on free plans may have limited access to detailed device breakdowns. Upgrade to access full device analytics.

Use Cases

Analyze mobile vs desktop traffic to prioritize responsive design.
async function getMobileDesktopRatio(shortUrlId) {
  const response = await fetch(
    `https://jmpy.me/api/v1/analytics/device/${shortUrlId}`,
    { headers: { 'Authorization': 'Bearer YOUR_API_KEY' } }
  );
  const { data } = await response.json();
  
  const devices = data.data.device_types;
  const mobile = devices.find(d => d.type === 'Mobile');
  const desktop = devices.find(d => d.type === 'Desktop');
  
  console.log(`Mobile: ${mobile?.percentage || 0}%`);
  console.log(`Desktop: ${desktop?.percentage || 0}%`);
  
  if (mobile && mobile.percentage > 60) {
    console.log('Recommendation: Prioritize mobile-first design');
  }
}
Generate a report for QA teams showing which browsers to prioritize testing.
import requests

def generate_browser_report(short_url_id):
    response = requests.get(
        f'https://jmpy.me/api/v1/analytics/device/{short_url_id}',
        headers={'Authorization': 'Bearer YOUR_API_KEY'}
    )
    
    browsers = response.json()['data']['data']['browsers']
    
    # Group into tiers
    tier1 = [b for b in browsers if b['percentage'] >= 10]  # Must support
    tier2 = [b for b in browsers if 5 <= b['percentage'] < 10]  # Should support
    tier3 = [b for b in browsers if b['percentage'] < 5]  # Nice to have
    
    print("=== Browser Testing Priority ===")
    print("\nTier 1 (Must Test):")
    for b in tier1:
        print(f"  - {b['name']}: {b['percentage']}%")
    
    print("\nTier 2 (Should Test):")
    for b in tier2:
        print(f"  - {b['name']}: {b['percentage']}%")
Prepare data for visualization in a chart library.
interface ChartData {
  labels: string[];
  values: number[];
  percentages: number[];
}

async function getDeviceChartData(shortUrlId: string): Promise<{
  devices: ChartData;
  browsers: ChartData;
}> {
  const response = await fetch(
    `https://jmpy.me/api/v1/analytics/device/${shortUrlId}`,
    { headers: { 'Authorization': 'Bearer YOUR_API_KEY' } }
  );
  const { data } = await response.json();
  const analytics = data.data;
  
  return {
    devices: {
      labels: analytics.device_types.map(d => d.type),
      values: analytics.device_types.map(d => d.clicks),
      percentages: analytics.device_types.map(d => d.percentage)
    },
    browsers: {
      labels: analytics.browsers.map(b => b.name),
      values: analytics.browsers.map(b => b.clicks),
      percentages: analytics.browsers.map(b => b.percentage)
    }
  };
}