Understand where your traffic is coming from. This endpoint categorizes engagement by source type, such as Direct, Social, Referral, Email, and Search.
Query Parameters
Predefined date range: last_hour, last_24_hours, last_7_days, last_30_days, last_year, all_time, custom.
Filter by URL type: all, standard, branded, subdomain.
Filter by Campaign UUID or name.
Comma-separated list of tags to filter by.
Response
Whether the request was successful.
Source category (e.g., “Direct”, “Social”, “Referral”, “Email”, “Search”).
Total clicks from this source.
Percentage of total traffic.
Request Examples
cURL
Node.js
TypeScript
Python
PHP
Go
Java
curl -X GET "https://jmpy.me/api/v1/analytics/user-traffic-sources?dateRange=last_7_days&tags=marketing" \
-H "Authorization: Bearer YOUR_API_KEY"
const fetch = require ( 'node-fetch' );
const response = await fetch (
'https://jmpy.me/api/v1/analytics/user-traffic-sources?dateRange=last_7_days&tags=marketing' ,
{
headers: { 'Authorization' : 'Bearer YOUR_API_KEY' }
}
);
const { data } = await response . json ();
console . log ( 'Traffic Sources:' , data );
import axios from 'axios' ;
interface TrafficSource {
source : string ;
clicks : number ;
percentage : number ;
}
const response = await axios . get <{ success : boolean ; data : TrafficSource [] }>(
'https://jmpy.me/api/v1/analytics/user-traffic-sources' ,
{
headers: { 'Authorization' : 'Bearer YOUR_API_KEY' },
params: { dateRange: 'last_7_days' , tags: 'marketing' }
}
);
console . log ( response . data . data );
import requests
response = requests.get(
'https://jmpy.me/api/v1/analytics/user-traffic-sources' ,
headers = { 'Authorization' : 'Bearer YOUR_API_KEY' },
params = { 'dateRange' : 'last_7_days' , 'tags' : 'marketing' }
)
sources = response.json()[ 'data' ]
for source in sources:
print ( f " { source[ 'source' ] } : { source[ 'clicks' ] } clicks ( { source[ 'percentage' ] } %)" )
<? php
$client = new GuzzleHttp\ Client ();
$response = $client -> request ( 'GET' , 'https://jmpy.me/api/v1/analytics/user-traffic-sources' , [
'headers' => [ 'Authorization' => 'Bearer YOUR_API_KEY' ],
'query' => [ 'dateRange' => 'last_7_days' , 'tags' => 'marketing' ]
]);
$data = json_decode ( $response -> getBody (), true );
print_r ( $data [ 'data' ]);
?>
package main
import (
" fmt "
" net/http "
" io "
)
func main () {
req , _ := http . NewRequest ( "GET" , "https://jmpy.me/api/v1/analytics/user-traffic-sources?dateRange=last_7_days&tags=marketing" , 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 ();
HttpRequest request = HttpRequest . newBuilder ()
. uri ( URI . create ( "https://jmpy.me/api/v1/analytics/user-traffic-sources?dateRange=last_7_days&tags=marketing" ))
. header ( "Authorization" , "Bearer YOUR_API_KEY" )
. build ();
HttpResponse < String > response = client . send (request, HttpResponse . BodyHandlers . ofString ());
System . out . println ( response . body ());
Response Example
{
"success" : true ,
"data" : [
{ "source" : "Direct" , "clicks" : 1500 , "percentage" : 45.0 },
{ "source" : "Social" , "clicks" : 1200 , "percentage" : 36.0 },
{ "source" : "Referral" , "clicks" : 300 , "percentage" : 9.0 },
{ "source" : "Email" , "clicks" : 200 , "percentage" : 6.0 },
{ "source" : "Search" , "clicks" : 133 , "percentage" : 4.0 }
]
}
Use Cases
Monitor the percentage of “Direct” vs “Referral” traffic to evaluate the health of your link distribution. High direct traffic often indicates strong brand recall or private messaging sharing (e.g., Slack, WhatsApp).
Verify ad campaign attribution
Compare “Social” and “Search” traffic spikes with your active ad periods to verify that your marketing spend is driving the expected volume of engagement through your shortened links.
Identify unexpected referral sources
Discover new websites or platforms that are linking to your content. If a specific “Referral” source is consistently high, you may want to establish a more formal partnership with that entity.