GET /admin/daysStats  API documentation

Get the revenues reports by day (similar to the Days tab of the admin dashboard).

GET https://demo.trafficmanager.com/api/v1/admin/daysStats/{startTime}/{endTime}/

Authentication:

The request must be authenticated with the following HTTP headers:
  • x-api-key: Your API key, found in the Security page
  • x-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 response
  • user_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
  • 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/daysStats/2021-01-01/2021-01-30/?totals=1

Response example

Without totals parameter:

{
    "data": [
        [
            "2021-07-30",
            100,
            50,
            25,
            2,
            0.3,
            0.15,
            7.5,
            10,
            3
        ],
        [
            "2021-08-01",
            73,
            2,
            2,
            0,
            0,
            0,
            0,
            0,
            0
        ]
    ],
    "status": 200
}
    

With totals=1:

{
    "data": [
        [
            "2021-07-30",
            100,
            50,
            25,
            2,
            0.3,
            0.15,
            7.5,
            10,
            3
        ],
        [
            "2021-08-01",
            73,
            2,
            2,
            0,
            0,
            0,
            0,
            0,
            0
        ]
    ],
    "total": {
        [
            173,
            52,
            27,
            2,
            0.3,
            0.15,
            7.5,
            10,
            3
        ]
    },
    "status": 200
}