Skip to main content

/o?method=density

Endpoint

/o?method=density

Overview

Returns density time-series metrics for the selected app and period.

Authentication

Countly API supports three authentication methods:

  1. API key query parameter: api_key=YOUR_API_KEY
  2. Auth token query parameter: auth_token=YOUR_AUTH_TOKEN
  3. Auth token header: countly-token: YOUR_AUTH_TOKEN

Permissions

  • Required permission: density Read.

Request Parameters

ParameterTypeRequiredDescription
api_keyStringYes (or use auth_token)API key for authentication.
auth_tokenStringNoAuth token as query parameter or countly-token header.
app_idStringYesTarget app ID.
methodStringYesMust be density.
periodStringNoCountly period (for example hour, 7days, 30days, month, or timestamp range).
timezoneStringNoOptional timezone override for period handling.
timestampNumberNoOptional timestamp for period anchoring.
actionStringNoOptional refresh action for fetch behavior.

Response

Success Response

{
"2026": {
"2": {
"17": {
"0": {
"dnst": 128
},
"1": {
"dnst": 143
}
}
}
},
"meta": {
"density": ["1x", "2x", "3x"]
}
}

Response Fields

FieldTypeDescription
(root object)ObjectTime-bucketed density metrics object.
metaObjectDensity metadata arrays.

Error Responses

400 Bad Request

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

401 Unauthorized

{
"result": "User does not have right"
}

Behavior/Processing

Behavior Modes

ModeTriggerProcessing PathResponse Shape
Density metrics readmethod=densityValidates read access and fetches density time object for requested period.Raw density metrics object

Impact on Other Data

  • Read-only endpoint.

Database Collections

CollectionUsed forData touched by this endpoint
countly.membersAuthentication and permission validationReads member record by api_key or auth_token to verify read access.
countly.appsApp context validationReads app record for the requested app_id during access validation.
countly.densityDensity metric sourceReads density metric documents for requested app and period.

Examples

Read density metrics for last 30 days

/o?
api_key=YOUR_API_KEY&
method=density&
app_id=6991c75b024cb89cdc04efd2&
period=30days

Read density metrics for custom range

/o?
api_key=YOUR_API_KEY&
method=density&
app_id=6991c75b024cb89cdc04efd2&
period=[1738368000000,1738972800000]

Last Updated

2026-02-17