Skip to content
Start here

Fetch complete analytics data for your livestreams

client.realtimeKit.livestreams.getLivestreamAnalyticsComplete(stringappId, LivestreamGetLivestreamAnalyticsCompleteParams { account_id, end_time, start_time } params, RequestOptionsoptions?): LivestreamGetLivestreamAnalyticsCompleteResponse { data, success }
GET/accounts/{account_id}/realtime/kit/{app_id}/analytics/livestreams/overall

Returns livestream analytics for the specified time range.

Security

API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
Accepted Permissions (at least one required)
Realtime AdminRealtime
ParametersExpand Collapse
appId: string

The app identifier tag.

maxLength32
params: LivestreamGetLivestreamAnalyticsCompleteParams { account_id, end_time, start_time }
account_id: string

Path param: The account identifier tag.

maxLength32
end_time?: string

Query param: Specify the end time range in ISO format to access the livestream analytics.

formatdate-time
start_time?: string

Query param: Specify the start time range in ISO format to access the livestream analytics.

formatdate-time
ReturnsExpand Collapse
LivestreamGetLivestreamAnalyticsCompleteResponse { data, success }
data?: Data { count, total_ingest_seconds, total_viewer_seconds }
count?: number

Count of total livestreams.

total_ingest_seconds?: number

Total time duration for which the input was given or the meeting was streamed.

total_viewer_seconds?: number

Total view time for which the viewers watched the stream.

success?: boolean

Fetch complete analytics data for your livestreams

import Cloudflare from 'cloudflare';

const client = new Cloudflare({
  apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted
});

const response = await client.realtimeKit.livestreams.getLivestreamAnalyticsComplete('app_id', {
  account_id: '023e105f4ecef8ad9ca31a8372d0c353',
});

console.log(response.data);
{
  "data": {
    "count": 0,
    "total_ingest_seconds": 0,
    "total_viewer_seconds": 0
  },
  "success": true
}
Returns Examples
{
  "data": {
    "count": 0,
    "total_ingest_seconds": 0,
    "total_viewer_seconds": 0
  },
  "success": true
}