GET
/statistics/redirects/count
Get redirect counts by day
Statistics
Description
Retrieve daily redirect statistics.
Returns a time series of redirect counts grouped by day, with zero values filled in for days with no data.
Authentication Required: User must be authenticated.
Authorization:
- Merchants can only filter by their own merchantid
- Affiliates can only filter by their own affiliateid
- At least one of affiliateid or merchantid is required
Parameters
affiliate_id
integer
query
The affiliate ID to get redirect statistics for. Users can only query their own affiliate_id.
merchant_id
integer
query
The merchant ID to get redirect statistics for. Users can only query their own merchant_id.
start_date
string
query
Start date for the statistics range (ISO 8601 format). Defaults to 30 days ago.
end_date
string
query
End date for the statistics range (ISO 8601 format). Defaults to current time.
exclude_bots
boolean
query
Exclude bot traffic from the statistics. Defaults to false (includes bot traffic).
Responses
200
Successful response with daily redirect counts
application/jsonstatusstring
Example:
successdataarray
Array of daily redirect counts, including days with zero redirects
Example:
{
"status": "success",
"data": [
{
"date": "2024-01-01",
"count": 45
},
{
"date": "2024-01-02",
"count": 0
},
{
"date": "2024-01-03",
"count": 67
},
{
"date": "2024-01-04",
"count": 23
}
]
}
400
Bad request - missing required parameters
application/jsonExample:
{
"status": "error",
"message": "Either affiliate_id or merchant_id is required"
}
401
Authentication required
application/jsonExample:
{
"status": "error",
"message": "Not authenticated or insufficient permissions"
}
500
Internal server error
application/jsonstatusstring
Example:
errormessagestring
Example:
Failed to fetch redirect statisticserrorstring
Example:
Connection error