Get detailed geographic breakdown of clicks by country, region, and city.
Path Parameters
Short URL identifier. Accepts:
UUID : 550e8400-e29b-41d4-a716-446655440000
Short code : abc123
Custom alias : my-custom-link
Query Parameters
Predefined date range: last_hour, last_24_hours, last_7_days, last_30_days, last_year, all_time, custom.
Start date for custom range (ISO 8601).
End date for custom range (ISO 8601).
Filter by URL type: all, standard, branded, subdomain.
Filter by Campaign UUID or name.
Comma-separated list of tags to filter by.
Filter clicks by country name (e.g. Pakistan, United States).
Filter clicks by ISO country code (e.g. pk, us). Supports alias country_code.
Filter clicks by region name (e.g. Sindh, California).
Filter clicks by city name (e.g. Karachi, New York).
Filter clicks by device type. Options: desktop, mobile, tablet. Supports alias device_type.
Filter clicks by browser (e.g. chrome, firefox, safari).
Filter clicks by OS (e.g. windows, macos, android, ios).
Filter clicks by UTM Source. Supports alias utm_source.
Filter clicks by UTM Medium. Supports alias utm_medium.
Filter clicks by UTM Campaign. Supports alias utm_campaign.
Filter clicks by UTM Term. Supports alias utm_term.
Filter clicks by UTM Content. Supports alias utm_content.
Filter clicks by referrer URL.
Filter clicks by referrer domain (e.g. t.co, facebook.com). Supports alias referrer_domain.
Response
Array of geographic location records. ISO 3166-1 alpha-2 country code (e.g., “US”, “GB”).
State/province/region name.
Number of clicks from this location.
Percentage of total clicks.
Total number of unique locations tracked.
Request Examples
cURL
Node.js
TypeScript
Python
PHP
Go
Java
# Get location analytics by UUID
curl -X GET "https://jmpy.me/api/v1/analytics/geographic/550e8400-e29b-41d4-a716-446655440000" \
-H "Authorization: Bearer YOUR_API_KEY"
# Get location analytics by short code
curl -X GET "https://jmpy.me/api/v1/analytics/geographic/abc123" \
-H "Authorization: Bearer YOUR_API_KEY"
# Get location analytics by custom alias
curl -X GET "https://jmpy.me/api/v1/analytics/geographic/my-promo-link" \
-H "Authorization: Bearer YOUR_API_KEY"
const fetch = require ( 'node-fetch' );
const shortUrlId = '550e8400-e29b-41d4-a716-446655440000' ;
const response = await fetch (
`https://jmpy.me/api/v1/analytics/geographic/ ${ shortUrlId } ` ,
{
headers: { 'Authorization' : 'Bearer YOUR_API_KEY' }
}
);
const data = await response . json ();
// Display top countries
console . log ( 'Top Countries:' );
data . data . data . slice ( 0 , 5 ). forEach ( loc => {
console . log ( ` ${ loc . country } : ${ loc . clicks } clicks ( ${ loc . percentage } %)` );
});
import axios from 'axios' ;
interface LocationData {
country : string ;
country_code : string ;
region : string ;
city : string ;
clicks : number ;
percentage : number ;
}
interface LocationAnalyticsResponse {
data : LocationData [];
total_locations : number ;
}
const shortUrlId = '550e8400-e29b-41d4-a716-446655440000' ;
const response = await axios . get <{ success : boolean ; data : LocationAnalyticsResponse }>(
`https://jmpy.me/api/v1/analytics/geographic/ ${ shortUrlId } ` ,
{
headers: { 'Authorization' : 'Bearer YOUR_API_KEY' }
}
);
// Group by country
const byCountry = response . data . data . data . reduce (( acc , loc ) => {
acc [ loc . country ] = ( acc [ loc . country ] || 0 ) + loc . clicks ;
return acc ;
}, {} as Record < string , number >);
import requests
short_url_id = '550e8400-e29b-41d4-a716-446655440000'
response = requests.get(
f 'https://jmpy.me/api/v1/analytics/geographic/ { short_url_id } ' ,
headers = { 'Authorization' : 'Bearer YOUR_API_KEY' }
)
data = response.json()[ 'data' ]
locations = data[ 'data' ]
print ( f "Total unique locations: { data[ 'total_locations' ] } " )
print ( " \n Top 5 Countries:" )
# Aggregate by country
countries = {}
for loc in locations:
country = loc[ 'country' ]
countries[country] = countries.get(country, 0 ) + loc[ 'clicks' ]
for country, clicks in sorted (countries.items(), key = lambda x : - x[ 1 ])[: 5 ]:
print ( f " { country } : { clicks } clicks" )
<? php
$client = new GuzzleHttp\ Client ();
$shortUrlId = '550e8400-e29b-41d4-a716-446655440000' ;
$response = $client -> request ( 'GET' ,
"https://jmpy.me/api/v1/analytics/geographic/{ $shortUrlId }" , [
'headers' => [
'Authorization' => 'Bearer YOUR_API_KEY'
]
]);
$data = json_decode ( $response -> getBody (), true );
$locations = $data [ 'data' ][ 'data' ];
echo "Top Locations: \n " ;
foreach ( array_slice ( $locations , 0 , 10 ) as $loc ) {
echo " { $loc ['country']}, { $loc ['city']}: { $loc ['clicks']} clicks \n " ;
}
?>
package main
import (
" fmt "
" net/http "
" io "
)
func main () {
shortUrlId := "550e8400-e29b-41d4-a716-446655440000"
url := fmt . Sprintf (
"https://jmpy.me/api/v1/analytics/geographic/ %s " ,
shortUrlId ,
)
req , _ := http . NewRequest ( "GET" , url , 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;
String shortUrlId = "550e8400-e29b-41d4-a716-446655440000" ;
String url = String . format (
"https://jmpy.me/api/v1/analytics/geographic/%s" ,
shortUrlId
);
HttpClient client = HttpClient . newHttpClient ();
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
403 Feature Disabled
404 Not Found
{
"success" : true ,
"data" : {
"data" : [
{
"country" : "United States" ,
"country_code" : "US" ,
"region" : "California" ,
"city" : "San Francisco" ,
"clicks" : 534 ,
"percentage" : 11.8
},
{
"country" : "United States" ,
"country_code" : "US" ,
"region" : "New York" ,
"city" : "New York" ,
"clicks" : 489 ,
"percentage" : 10.8
},
{
"country" : "United Kingdom" ,
"country_code" : "GB" ,
"region" : "England" ,
"city" : "London" ,
"clicks" : 423 ,
"percentage" : 9.4
},
{
"country" : "Germany" ,
"country_code" : "DE" ,
"region" : "Berlin" ,
"city" : "Berlin" ,
"clicks" : 312 ,
"percentage" : 6.9
},
{
"country" : "Canada" ,
"country_code" : "CA" ,
"region" : "Ontario" ,
"city" : "Toronto" ,
"clicks" : 287 ,
"percentage" : 6.3
}
],
"total_locations" : 127
}
}
{
"success" : false ,
"error" : {
"code" : "FEATURE_DISABLED" ,
"message" : "Geographic analytics is not available on your current plan" ,
"details" : {
"feature" : "Geographic analytics" ,
"currentPlan" : "Free" ,
"upgradeRequired" : true
}
}
}
{
"success" : false ,
"error" : {
"code" : "NOT_FOUND" ,
"message" : "Short URL not found" ,
"details" : "No short URL found with code or alias: invalid-code"
}
}
User-Level Location Analytics
Get aggregated location analytics across all your short URLs.
Endpoint
GET /analytics/user-locations
Query Parameters
Number of days to include in analytics (1-365).
Predefined date range: last_hour, last_24_hours, last_7_days, last_30_days, last_year, all_time, custom.
Start date for custom range (ISO 8601).
End date for custom range (ISO 8601).
Filter by URL type: all, standard, branded, subdomain.
Filter by Campaign UUID or name.
Comma-separated list of tags to filter by.
Filter clicks by country name (e.g. Pakistan, United States).
Filter clicks by ISO country code (e.g. pk, us). Supports alias country_code.
Filter clicks by region name (e.g. Sindh, California).
Filter clicks by city name (e.g. Karachi, New York).
Filter clicks by device type. Options: desktop, mobile, tablet. Supports alias device_type.
Filter clicks by browser (e.g. chrome, firefox, safari).
Filter clicks by OS (e.g. windows, macos, android, ios).
Filter clicks by UTM Source. Supports alias utm_source.
Filter clicks by UTM Medium. Supports alias utm_medium.
Filter clicks by UTM Campaign. Supports alias utm_campaign.
Filter clicks by UTM Term. Supports alias utm_term.
Filter clicks by UTM Content. Supports alias utm_content.
Filter clicks by referrer URL.
Filter clicks by referrer domain (e.g. t.co, facebook.com). Supports alias referrer_domain.
Request Example
curl -X GET "https://jmpy.me/api/v1/analytics/user-locations?days=30" \
-H "Authorization: Bearer YOUR_API_KEY"
Response Example
{
"success" : true ,
"data" : {
"data" : {
"countries" : [
{ "country" : "United States" , "country_code" : "US" , "clicks" : 8234 , "percentage" : 45.2 },
{ "country" : "United Kingdom" , "country_code" : "GB" , "clicks" : 3456 , "percentage" : 19.0 },
{ "country" : "Germany" , "country_code" : "DE" , "clicks" : 2134 , "percentage" : 11.7 },
{ "country" : "Canada" , "country_code" : "CA" , "clicks" : 1567 , "percentage" : 8.6 },
{ "country" : "Australia" , "country_code" : "AU" , "clicks" : 892 , "percentage" : 4.9 }
],
"cities" : [
{ "city" : "New York" , "country" : "United States" , "clicks" : 1234 },
{ "city" : "London" , "country" : "United Kingdom" , "clicks" : 987 },
{ "city" : "San Francisco" , "country" : "United States" , "clicks" : 876 }
]
}
}
}
Geographic analytics may be restricted based on your plan. Free plans have limited access to location data. Pro and Enterprise plans have full access including city-level data.
Use Cases
Create a geographic heatmap
Prepare location data for visualization on a world map. async function getMapData ( shortUrlId ) {
const response = await fetch (
`https://jmpy.me/api/v1/analytics/geographic/ ${ shortUrlId } ` ,
{ headers: { 'Authorization' : 'Bearer YOUR_API_KEY' } }
);
const { data } = await response . json ();
// Group by country for country-level heatmap
const countryData = {};
data . data . forEach ( loc => {
if ( ! countryData [ loc . country_code ]) {
countryData [ loc . country_code ] = {
country: loc . country ,
code: loc . country_code ,
clicks: 0
};
}
countryData [ loc . country_code ]. clicks += loc . clicks ;
});
// Convert to array sorted by clicks
return Object . values ( countryData )
. sort (( a , b ) => b . clicks - a . clicks );
}
Analyze geographic distribution to identify your strongest markets. import requests
def identify_target_markets ( short_url_id , threshold = 5 ):
"""
Identify countries with >threshold% of traffic as target markets.
"""
response = requests.get(
f 'https://jmpy.me/api/v1/analytics/geographic/ { short_url_id } ' ,
headers = { 'Authorization' : 'Bearer YOUR_API_KEY' }
)
locations = response.json()[ 'data' ][ 'data' ]
# Aggregate by country
countries = {}
total_clicks = sum (loc[ 'clicks' ] for loc in locations)
for loc in locations:
code = loc[ 'country_code' ]
countries[code] = countries.get(code, 0 ) + loc[ 'clicks' ]
# Identify target markets
target_markets = []
for code, clicks in countries.items():
percentage = (clicks / total_clicks) * 100
if percentage >= threshold:
target_markets.append({
'country_code' : code,
'clicks' : clicks,
'percentage' : round (percentage, 1 )
})
return sorted (target_markets, key = lambda x : - x[ 'percentage' ])
Regional performance comparison
Device Analytics Get device and browser breakdown
Click Details Get individual click records with location
Referrer Analytics See traffic sources by region
Complete Analytics Get all analytics in one request