GET
https://jmpy.me/api/v1
/
analytics
/
click-details
/
:shortUrlId
Click Details
curl --request GET \
  --url https://jmpy.me/api/v1/analytics/click-details/:shortUrlId \
  --header 'Authorization: Bearer <token>'
{
  "data": [
    {
      "id": "<string>",
      "short_code": "<string>",
      "original_url": "<string>",
      "clicked_at": "<string>",
      "ip_address": "<string>",
      "user_agent": "<string>",
      "referrer": "<string>",
      "country": "<string>",
      "city": "<string>",
      "device_type": "<string>",
      "browser": "<string>",
      "os": "<string>"
    }
  ],
  "pagination": {
    "limit": 123,
    "offset": 123,
    "total": 123
  }
}
Get detailed click records with timestamps, IP addresses, user agents, referrers, and geographic information.
The shortUrlId parameter is optional. If omitted, returns click details for all your URLs.

Path Parameters

shortUrlId
string
Short URL identifier. Accepts:
  • UUID: 550e8400-e29b-41d4-a716-446655440000
  • Short code: abc123
  • Custom alias: my-custom-link
If omitted, returns clicks for all your URLs.

Query Parameters

limit
integer
default:100
Maximum number of click records to return (max 1000).
offset
integer
default:0
Number of records to skip for pagination.

Response

data
array
Array of click records.
pagination
object
Pagination information.

Request Examples

# Get clicks for a specific URL by UUID
curl -X GET "https://jmpy.me/api/v1/analytics/click-details/550e8400-e29b-41d4-a716-446655440000?limit=50" \
  -H "Authorization: Bearer YOUR_API_KEY"

# Get clicks for a URL by short code
curl -X GET "https://jmpy.me/api/v1/analytics/click-details/abc123?limit=100&offset=0" \
  -H "Authorization: Bearer YOUR_API_KEY"

# Get clicks for a URL by custom alias
curl -X GET "https://jmpy.me/api/v1/analytics/click-details/my-promo-link" \
  -H "Authorization: Bearer YOUR_API_KEY"

# Get all clicks (no shortUrlId)
curl -X GET "https://jmpy.me/api/v1/analytics/click-details?limit=50&offset=0" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response Examples

{
  "success": true,
  "data": {
    "data": [
      {
        "id": "click-uuid-1",
        "short_code": "abc123",
        "original_url": "https://example.com/page",
        "clicked_at": "2024-01-15T14:32:00Z",
        "ip_address": "192.168.xxx.xxx",
        "user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 17_0...",
        "referrer": "https://twitter.com",
        "country": "US",
        "city": "New York",
        "device_type": "mobile",
        "browser": "Safari",
        "os": "iOS"
      },
      {
        "id": "click-uuid-2",
        "short_code": "abc123",
        "original_url": "https://example.com/page",
        "clicked_at": "2024-01-15T14:28:00Z",
        "ip_address": "10.0.xxx.xxx",
        "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)...",
        "referrer": "https://google.com",
        "country": "UK",
        "city": "London",
        "device_type": "desktop",
        "browser": "Chrome",
        "os": "Windows"
      }
    ],
    "pagination": {
      "limit": 100,
      "offset": 0,
      "total": 2
    }
  }
}

Use Cases

Fetch all clicks and export them for analysis in spreadsheet software.
async function exportClicksToCSV(shortUrlId) {
  let allClicks = [];
  let offset = 0;
  const limit = 1000;
  
  // Paginate through all clicks
  while (true) {
    const response = await fetch(
      `https://jmpy.me/api/v1/analytics/click-details/${shortUrlId}?limit=${limit}&offset=${offset}`,
      { headers: { 'Authorization': 'Bearer YOUR_API_KEY' } }
    );
    const { data } = await response.json();
    
    allClicks = allClicks.concat(data.data);
    
    if (data.data.length < limit) break;
    offset += limit;
  }
  
  // Convert to CSV
  const headers = 'clicked_at,country,city,device_type,browser,os,referrer';
  const rows = allClicks.map(c => 
    `${c.clicked_at},${c.country},${c.city},${c.device_type},${c.browser},${c.os},${c.referrer}`
  );
  
  return [headers, ...rows].join('\n');
}
Poll for new clicks and display them in real-time.
async function monitorClicks(shortUrlId, onNewClick) {
  let lastClickId = null;
  
  setInterval(async () => {
    const response = await fetch(
      `https://jmpy.me/api/v1/analytics/click-details/${shortUrlId}?limit=10`,
      { headers: { 'Authorization': 'Bearer YOUR_API_KEY' } }
    );
    const { data } = await response.json();
    
    const clicks = data.data;
    if (clicks.length > 0 && clicks[0].id !== lastClickId) {
      // New clicks detected
      const newClicks = lastClickId 
        ? clicks.slice(0, clicks.findIndex(c => c.id === lastClickId))
        : clicks;
      
      newClicks.forEach(click => onNewClick(click));
      lastClickId = clicks[0].id;
    }
  }, 5000); // Poll every 5 seconds
}
Group clicks by country and calculate percentages.
import requests
from collections import Counter

def analyze_by_country(short_url_id):
    response = requests.get(
        f'https://jmpy.me/api/v1/analytics/click-details/{short_url_id}',
        headers={'Authorization': 'Bearer YOUR_API_KEY'},
        params={'limit': 1000}
    )
    
    clicks = response.json()['data']['data']
    countries = Counter(click['country'] for click in clicks)
    total = len(clicks)
    
    for country, count in countries.most_common():
        percentage = (count / total) * 100
        print(f"{country}: {count} clicks ({percentage:.1f}%)")