Skip to content
Start here

Fetch complete analytics data for your livestreams

client.RealtimeKit.Livestreams.GetLivestreamAnalyticsComplete(ctx, appID, params) (*LivestreamGetLivestreamAnalyticsCompleteResponse, error)
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
AccountID param.Field[string]

Path param: The account identifier tag.

maxLength32
EndTime param.Field[Time]optional

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

formatdate-time
StartTime param.Field[Time]optional

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

formatdate-time
ReturnsExpand Collapse
type LivestreamGetLivestreamAnalyticsCompleteResponse struct{…}
Data LivestreamGetLivestreamAnalyticsCompleteResponseDataoptional
Count int64optional

Count of total livestreams.

TotalIngestSeconds int64optional

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

TotalViewerSeconds int64optional

Total view time for which the viewers watched the stream.

Success booloptional

Fetch complete analytics data for your livestreams

package main

import (
  "context"
  "fmt"

  "github.com/cloudflare/cloudflare-go"
  "github.com/cloudflare/cloudflare-go/option"
  "github.com/cloudflare/cloudflare-go/realtime_kit"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  response, err := client.RealtimeKit.Livestreams.GetLivestreamAnalyticsComplete(
    context.TODO(),
    "app_id",
    realtime_kit.LivestreamGetLivestreamAnalyticsCompleteParams{
      AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", 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
}