Skip to main content
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

redirectId
string
required
The unique identifier of the redirect to retrieve statistics for

Query parameters

start
string
Start date for the analytics period in ISO 8601 formatExample: 2024-01-01T00:00:00Z
end
string
End date for the analytics period in ISO 8601 formatExample: 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:
data
object
meta
object

Example request

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