Skip to main content

Concurrent Users - Get Live Count

Endpoint

/o?method=live

Enterprise Only
This API is available exclusively in Countly Enterprise.

Overview

Get the current number of online users and the all-time maximum counts for an application. Returns both regular users and new users separately. The response is updated in real-time based on active sessions.

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

  • Required permission: Read on the Online Users feature (concurrent_users)

Request Parameters

ParameterTypeRequiredDescription
api_keyStringYes (or auth_token)API key for authentication
auth_tokenStringYes (or api_key)Auth token for authentication
app_idStringYesApplication identifier

Configuration Impact

SettingDefaultAffectsUser-visible impact
concurrent_users.*Online Users feature defaultsLive-count and alert behavior for online-user endpoints.Changes to Online Users settings can alter alert handling, thresholds, or returned live metrics.

Response

Success Response

{
"o": 1250,
"n": 45,
"om": 5000,
"nm": 250
}

Response Fields

FieldTypeDescription
oNumberCurrent number of online (existing) users in the app
nNumberCurrent number of new online users in the app
omNumberAll-time maximum concurrent online (existing) users
nmNumberAll-time maximum concurrent new online users

Error Responses

HTTP StatusError ResponseDescription
400{"result": "Missing required parameters"}Missing app_id or authentication
500{"result": "Concurrent users API error."}Server error in data retrieval or processing

Behavior/Processing

  • Requires Read permission on concurrent_users.
  • Builds an app list from app_id, then applies app visibility filtering before querying repositories.
  • Reads two repositories in parallel: existing/overall online users (o) and new online users (n).
  • For each repository, reads the current online value with getOnline and the all-time maximum with getOveralls.
  • Response keys are composed from repository key and metric suffix: o, om, n, and nm.
  • Missing repository records are returned as 0, not as null or omitted fields.
  • Database/read errors return Concurrent users API error..

Database Collections

CollectionUsed forData touched by this endpoint
countly.concurrent_usersEndpoint data sourceStores endpoint-related records this endpoint reads or modifies.
countly.appEndpoint data sourceStores endpoint-related records this endpoint reads or modifies.

Limitations

  • Requires Read permission on the Online Users feature (concurrent_users)
  • om and nm reset when maximum values are explicitly cleared via /i/concurrent_users_max/reset
  • Data updates every read_interval seconds (default: 10 seconds); values lag slightly behind real-time

Examples

Example: Get live user counts

curl "https://your-server.com/o?method=live&app_id=YOUR_APP_ID" \
-d "api_key=YOUR_API_KEY"

Ⓔ Enterprise

This feature is part of Countly Enterprise.

Get Access:

Last Updated: 2026-04-18


Last Updated

2026-04-18