The basic statistics endpoint provides essential metrics about your redirect’s performance, including total hits, unique visitors, bot detection, and high-level summary data.
Endpoint
GET /analytics/redirect/:redirectId/stats/basic
Function signature
getBasicStats (
redirectId : string ,
params ?: { start? : string ; end ?: string }
): Promise < AxiosResponse >
Path parameters
The unique identifier of the redirect to retrieve statistics for
Query parameters
Start date for the analytics period in ISO 8601 format Example: 2024-01-01T00:00:00Z
End date for the analytics period in ISO 8601 format Example: 2024-01-31T23:59:59Z
If no date range is specified, the endpoint returns statistics for the last 30 days by default.
Response
The endpoint returns an object containing basic statistics:
Total number of hits during the specified period
Number of unique visitors (based on IP and user agent fingerprinting)
Number of hits identified as coming from bots
Number of hits from human visitors
Average number of hits per day during the period
Maximum number of hits in a single day
Date when peak hits occurred (ISO 8601 format)
Percentage of successful redirects (2xx/3xx status codes)
The redirect ID for which statistics were retrieved
Start of the analyzed period
End of the analyzed period
Example request
TypeScript
JavaScript
cURL
Python
import { getBasicStats } from '@quickleap/api' ;
const response = await getBasicStats ( 'redirect_abc123' , {
start: '2024-01-01T00:00:00Z' ,
end: '2024-01-31T23:59:59Z'
});
console . log ( 'Total hits:' , response . data . data . totalHits );
console . log ( 'Unique visitors:' , response . data . data . uniqueVisitors );
console . log ( 'Success rate:' , response . data . data . successRate + '%' );
Example response
{
"data" : {
"totalHits" : 45678 ,
"uniqueVisitors" : 12453 ,
"botHits" : 3421 ,
"humanHits" : 42257 ,
"avgHitsPerDay" : 1473.5 ,
"peakHits" : 3892 ,
"peakDate" : "2024-01-15T00:00:00Z" ,
"successRate" : 98.7
},
"meta" : {
"redirectId" : "redirect_abc123" ,
"period" : {
"start" : "2024-01-01T00:00:00Z" ,
"end" : "2024-01-31T23:59:59Z"
}
}
}
Use cases
Dashboard overview : Display high-level metrics on your redirect dashboard
Performance monitoring : Track overall redirect health and success rates
Capacity planning : Use average and peak metrics to plan infrastructure
Bot detection : Monitor the ratio of bot to human traffic
Trend analysis : Compare statistics across different time periods