Skip to main content

/o/server-stats/top

Endpoint

/o/server-stats/top

Overview

Returns top 3 apps by current/previous hour datapoint volume for the current UTC month.

Authentication

Countly API supports three authentication methods:

  1. API Key (parameter): api_key=YOUR_API_KEY
  2. Auth Token (parameter): auth_token=YOUR_AUTH_TOKEN
  3. Auth Token (header): countly-token: YOUR_AUTH_TOKEN

Permissions

Authenticated dashboard user credentials are required (api_key or auth_token).

Request Parameters

ParameterTypeRequiredDescription
api_keyStringYes (or use auth_token)API key for authentication.
auth_tokenStringNoAuth token as query parameter or countly-token header.

Response

Success Response

[
{
"a": "6991c75b024cb89cdc04efd2",
"v": 186
},
{
"a": "6a11c75b024cb89cdc04ef01",
"v": 122
},
{
"a": "6b22c75b024cb89cdc04ef02",
"v": 95
}
]

Response Fields

FieldTypeDescription
(root)ArrayRaw list of top app datapoint entries.
[].aStringApp ID.
[].vNumberDatapoint score computed from current and previous hour.

Error Responses

400 Bad Request

{
"result": "Missing parameter \"api_key\" or \"auth_token\""
}

401 Unauthorized

{
"result": "User does not exist"
}

Behavior/Processing

  • Determines current UTC month/day/hour.
  • Reads month documents from server-stats datapoints collection.
  • For each app, sums dp for current hour and previous hour (if present).
  • Excludes [CLY]_consolidated from returned list.
  • Sorts descending by score and returns top 3 entries.

Database Collections

CollectionUsed forData touched by this endpoint
countly.membersAuthentication validationReads member account and lock status during authenticated-user validation authentication.
countly.server_stats_data_pointsStores monthly and hourly datapoint metrics per appReads current-month documents and computes per-app top scores.

Examples

Read top apps by current/previous hour datapoints

/o/server-stats/top?api_key=YOUR_API_KEY

Limitations

  • Uses current UTC month and hour only; does not accept period.
  • Returns maximum 3 app entries.
  • Consolidated technical app key ([CLY]_consolidated) is intentionally excluded.

Last Updated

2026-02-17