Skip to content

GET /stats/ ​

Description ​

The Statistics resource helps you to obtain all kinds of useful statistics about your overall account or per applications usage, or also statistics about certain end-user tags. You can retrieve information on your conversion usage, storage usage, or bandwidth usage, as well as the end-users/tags currently held for fraud by the anti-fraud system.

Endpoints ​

Authentication ​

  • Required: Yes
  • Method: Bearer token

Request Headers ​

  • Authorization: Bearer [AUTH_TOKEN]

Parameters ​

Query Parameters ​

  • format: string (Optional)
    Values: json, xml
    Overrides the Request Accept header.
  • human: boolean (Optional)
    Values: true, false
    Causes the response to be in a structured, more human-readable form.
  • view: string (Optional)
    Values: user, application
    Default: user
    Whether to query the statistics for your overall user account (user) or separately per application (application).
  • current_subscription: boolean (Optional)
    Values: true, false
    Default: false
    If true, the time period of your currently active subscription (= your current billing period) is queried. If false, all statistics of the current user are returned without any time/date restrictions.
  • from_date: string (Optional)
    Format: YYYY-MM-DD'T'hh:mm:ss'Z' (e.g. 2025-04-19T00:00:00.000Z)
  • to_date: string (Optional)
    Format: YYYY-MM-DD'T'hh:mm:ss'Z' (e.g. 2025-04-19T00:00:00.000Z)
  • action: string (Optional)
    Values: aggregate
    Returns a summed-up aggregate over all (matching) statistics records instead of individual records. Currently, only aggregate is a valid action.

Example Request ​

bash
curl -X GET "https://api.xvid.com/v1/stats/bandwidth/?format=json&current_subscription=true&human=true" \
  -H "Authorization: Bearer AUTH_TOKEN"

Example Response ​

Bandwidth Usage ​

json
{
  "stats": [
    {
      "bandwidth_data": 27159296,
      "from_date": 1438300800001,
      "to_date": 1438387200000,
      "user": {
        "id": "54b67486e4b0e8aca492f67d",
        "href": "https://api.xvid.com/v1/users/54b67486e4b0e8aca492f67d"
      }
    },
    ...
  ]
}

Storage Usage ​

json
{
  "stats": [
    {
      "user": {
        "id": "552b874d14eab3a29d1b3d8d",
        "href": "https://api.xvid.com/v1/users/552b874d14eab3a29d1b3d8d"
      },
      "from_date": 1435795200001,
      "to_date": 1435881600000,
      "storage_data": 730774413
    },
    ...
  ]
}

Conversion Usage ​

json
{
  "stats": [{
    "from_date": 1434931200001,
    "to_date": 1436351027259,
    "user": {
      "id": "552b874d14eab3a29d1b3d8d",
      "href": "https://api.xvid.com/v1/users/552b874d14eab3a29d1b3d8d"
    },
    "conversion_data": 130520484
  }]
}

Conversion Usage per Application ​

When querying with view=application, statistics are returned separately per application instead of for your overall account:

bash
curl -X GET "https://api.xvid.com/v1/stats/conversion/?view=application&human=true" \
  -H "Authorization: Bearer AUTH_TOKEN"
json
{
  "stats": [{
    "application": {
      "id": "552cae3514ea10cb4d3ac69e"
    },
    "from_date": 1434931200001,
    "to_date": 1435017600000,
    "conversion_data": 64752296
  },
  ...
  ]
}

Error Responses ​

400 Bad Request ​

json
{
  "error": {
    "error_code": "0x0000011",
    "error_message": "Invalid Input"
  }
}

403 Forbidden ​

json
{
  "error": {
    "error_code": "0x0000003",
    "error_message": "Invalid access token"
  }
}

500 Internal Server Error ​

json
{
  "error": {
    "error_code": "0x0000001",
    "error_message": "Internal Error"
  }
}