Skip to main content

Read

Endpoint

/o/active_users

Enterprise Only
This API is available exclusively in Countly Enterprise.

Overview

Retrieve active user metrics (DAU, WAU, MAU) for a specified time period.

Authentication

Authentication Methods:

  • API Key (parameter): api_key=YOUR_API_KEY
  • Auth Token (parameter): auth_token=YOUR_AUTH_TOKEN
  • Auth Token (header): countly-token: YOUR_AUTH_TOKEN

Permissions

  • Read (active_users feature)

Request Parameters

ParameterTypeRequiredDescription
api_keyStringYes (or auth_token)API key for authentication
auth_tokenStringYes (or api_key)Auth token for authentication
app_idStringYesApplication ID to fetch metrics for
periodString or ArrayNoTime period: "yesterday", "hour", "7days", "30days", "60days", "day", "month", or custom array [start_timestamp, end_timestamp] (default: "30days")
db_overrideStringNoOverride Drill adapter (ignored if set to "compare" or "config")
comparisonBooleanNoWhen true, enables QueryRunner comparison mode (runs query on all available adapters for comparison logging)

Response

Success Response

{
"calculating": false,
"data": {
"2024.2.11": {
"d": 245,
"w": 1820,
"m": 5340
},
"2024.2.12": {
"d": 258,
"w": 1943,
"m": 5467
}
}
}

Response Fields

FieldTypeDescription
calculatingBooleantrue when background calculation is in progress
dataObjectDictionary of dates with metrics
data.<date>.dNumberDaily Active Users for that calendar day
data.<date>.wNumberWeekly Active Users (unique users in past 7 days including current day)
data.<date>.mNumberMonthly Active Users (unique users in past 30 days including current day)
drillDisabledBooleanPresent when Drill is disabled or unavailable

Error Responses

  • HTTP 400 - Missing authentication:
{
"result": "Missing parameter \"api_key\" or \"auth_token\""
}
  • HTTP 401 - Missing app_id:
{
"result": "No app_id provided"
}

Behavior/Processing

  • Requires Drill to be enabled; otherwise returns drillDisabled: true with empty data.
  • Calculates missing or stale entries in the background and returns calculating: true until refreshed.
  • db_override selects a Drill adapter unless set to compare or config.
  • comparison=true enables comparison mode for query execution.
  • For period=month, the response is grouped by month keys (YYYY.M) and values are averaged from daily values within each month.

Database Collections

CollectionUsed forData touched by this endpoint
countly.active_usersEndpoint data sourceStores endpoint-related records this endpoint reads or modifies.
countly_drill.drill_eventsDrill event recordsStores granular event rows queried or updated by this endpoint.

Examples

Example 1: Get Active Users for Last 30 Days

Description: Retrieves DAU/WAU/MAU metrics for the default 30-day period.

Request:

curl "https://your-server.com/o/active_users?api_key=YOUR_API_KEY&app_id=123456789&period=30days"

Response:

{
"calculating": false,
"data": {
"2024.2.11": {
"d": 245,
"w": 1820,
"m": 5340
},
"2024.2.12": {
"d": 258,
"w": 1943,
"m": 5467
},
"2024.2.13": {
"d": 201,
"w": 1756,
"m": 5289
}
}
}

Example 2: Get Active Users for Custom Date Range

Description: Retrieves active user metrics for a specific date range using timestamps.

Request:

curl "https://your-server.com/o/active_users?api_key=YOUR_API_KEY&app_id=123456789&period=[1707619200,1710297600]"

Response:

{
"calculating": false,
"data": {
"2024.2.11": {"d": 245, "w": 1820, "m": 5340},
"2024.2.12": {"d": 258, "w": 1943, "m": 5467}
}
}


Ⓔ Enterprise

This feature is part of Countly Enterprise.

Get Access:

Already a Customer? Use support portal if you have any questions


Last Updated

2026-02-15

Last Updated

2026-02-16