Identify your peak performance times. This endpoint provides data on when your links are most active, helping you optimize your posting schedule.
Query Parameters
Distribution type: hourly or weekly.
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.
Response
Whether the request was successful.
The hour (0-23) or day (e.g., “Monday”) label.
Total clicks during this period.
Total QR scans during this period.
Request Examples
cURL
Node.js
TypeScript
Python
PHP
Go
Java
# Get hourly distribution for last 7 days
curl -X GET "https://jmpy.me/api/v1/analytics/distribution?type=hourly&dateRange=last_7_days" \
-H "Authorization: Bearer YOUR_API_KEY"
const fetch = require ( 'node-fetch' );
const response = await fetch (
'https://jmpy.me/api/v1/analytics/distribution?type=hourly&dateRange=last_7_days' ,
{
headers: { 'Authorization' : 'Bearer YOUR_API_KEY' }
}
);
const { data } = await response . json ();
console . log ( 'Hourly Distribution:' , data );
import axios from 'axios' ;
interface DistributionPoint {
label : string ;
clicks : number ;
scans : number ;
}
const response = await axios . get <{ success : boolean ; data : DistributionPoint [] }>(
'https://jmpy.me/api/v1/analytics/distribution' ,
{
headers: { 'Authorization' : 'Bearer YOUR_API_KEY' },
params: { type: 'weekly' , dateRange: 'last_30_days' }
}
);
console . log ( response . data . data );
import requests
response = requests.get(
'https://jmpy.me/api/v1/analytics/distribution' ,
headers = { 'Authorization' : 'Bearer YOUR_API_KEY' },
params = { 'type' : 'hourly' , 'dateRange' : 'last_7_days' }
)
distribution = response.json()[ 'data' ]
for point in distribution:
print ( f "Hour { point[ 'label' ] } : { point[ 'clicks' ] } clicks" )
<? php
$client = new GuzzleHttp\ Client ();
$response = $client -> request ( 'GET' , 'https://jmpy.me/api/v1/analytics/distribution' , [
'headers' => [ 'Authorization' => 'Bearer YOUR_API_KEY' ],
'query' => [ 'type' => 'weekly' , 'dateRange' => 'last_30_days' ]
]);
$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/distribution?type=hourly&dateRange=last_7_days" , 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/distribution?type=hourly&dateRange=last_7_days" ))
. header ( "Authorization" , "Bearer YOUR_API_KEY" )
. build ();
HttpResponse < String > response = client . send (request, HttpResponse . BodyHandlers . ofString ());
System . out . println ( response . body ());
Response Example (Hourly)
{
"success" : true ,
"data" : [
{ "label" : "0" , "clicks" : 120 , "scans" : 15 },
{ "label" : "1" , "clicks" : 85 , "scans" : 10 },
{ "label" : "12" , "clicks" : 450 , "scans" : 55 },
{ "label" : "18" , "clicks" : 620 , "scans" : 80 }
]
}
Use Cases
Identify the exact hours when your audience is most active. Use this data to schedule your social media posts or email campaigns right before peak engagement periods.
analyze weekend vs weekday performance
Switch to weekly distribution to see if your links perform better on weekends or specific workdays, allowing you to tailor your content strategy accordingly.
Detect regional peak engagement
Combine with location filters to understand when specific regions (e.g., US vs Europe) are interacting with your links, helping you manage global campaigns.