GET /admin/affiliateStats API documentation
Get the offer revenues reports by affiliate (similar to the first tab of the admin dashboard).
GET https://demo.trafficmanager.com/api/v1/admin/affiliateStats/{startTime}/{endTime}/
Authentication:
The request must be authenticated with the following HTTP headers:x-api-key
: Your API key, found in the Security pagex-user-id
: Your User ID, found in the Security page
If the HTTP headers are not passed, but you are logged in to the TrafficManager panel, the current user is used instead (so you can easily preview or download the data using your browser)
GET Parameters:
- Required:
startTime
: Start time. Unix timestamp or any value accepted by strtotime. For example:2023-01-01
,today
,-10 minutes
...endTime
: End time. Unix timestamp or any value accepted by strtotime. For example:2023-01-01 23:59:59
,today 23:59:59
,-5 minutes
...- Optional:
totals
: if 1, the totals for each day will be added to the responseuser_id
: affiliate ID filter (if set, returns only the data for that affiliate)offer_id
: offer ID filter (if set, returns only the data for that offer)
Returned values:
- The response is a JSON array where every row has the following data:
- Date
- Username
- Number of impressions
- Number of clicks
- Number of unique clicks
- Number of conversions
- EPC (average payout per n clicks, calculated as: payout/clicks*n, where n is the EPC factor, currently 100)
- Unique EPC (average payout per n unique clicks)
- Total payout to the affiliate
- Total revenues
- Total profit (revenues - payout)
Request example
GET https://demo.trafficmanager.com/api/v1/admin/affiliateStats/2021-01-01/2021-01-30/?totals=1
Response example
Without totals parameter:
{ "data": [ [ "2021-07-30 - 2021-08-01", "affiliate0", 100, 50, 25, 2, 0.3, 0.15, 7.5, 10, 3 ] ], "status": 200 }
With totals=1:
{ "data": [ [ "2021-07-30 - 2021-08-01", "affiliate0", 100, 50, 25, 2, 0.3, 0.15, 7.5, 10, 3 ], [ "2021-07-30 - 2021-08-01", "affiliate2", 75, 21, 25, 0, 0, 0, 0, 0, 0 ] ], "total": { [ 175, 71, 50, 2, 0.3, 0.15, 7.5, 10, 3 ], }, "status": 200 }