Skip to content
Start here

Fetch day-wise session and recording analytics data for an App

client.RealtimeKit.Livestreams.GetOrgAnalytics(ctx, appID, params) (*LivestreamGetOrgAnalyticsResponse, error)
GET/accounts/{account_id}/realtime/kit/{app_id}/analytics/daywise

Returns day-wise session and recording analytics data of an App for the specified time range start_date to end_date. If start_date and end_date are not provided, the default time range is set from 30 days ago to the current date.

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 LivestreamGetOrgAnalyticsParams
AccountID param.Field[string]

Path param: The account identifier tag.

maxLength32
EndDate param.Field[string]optional

Query param: end date in YYYY-MM-DD format

StartDate param.Field[string]optional

Query param: start date in YYYY-MM-DD format

ReturnsExpand Collapse
type LivestreamGetOrgAnalyticsResponse struct{…}
Data LivestreamGetOrgAnalyticsResponseDataoptional
RecordingStats LivestreamGetOrgAnalyticsResponseDataRecordingStatsoptional

Recording statistics of an App during the range specified

DayStats []LivestreamGetOrgAnalyticsResponseDataRecordingStatsDayStatoptional

Day wise recording stats

Day stringoptional
TotalRecordingMinutes int64optional

Total recording minutes for a specific day

TotalRecordings int64optional

Total number of recordings for a specific day

RecordingCount int64optional

Total number of recordings during the range specified

RecordingMinutesConsumed float64optional

Total recording minutes during the range specified

SessionStats LivestreamGetOrgAnalyticsResponseDataSessionStatsoptional

Session statistics of an App during the range specified

DayStats []LivestreamGetOrgAnalyticsResponseDataSessionStatsDayStatoptional

Day wise session stats

Day stringoptional
TotalSessionMinutes float64optional

Total session minutes for a specific day

TotalSessions int64optional

Total number of sessions for a specific day

SessionsCount int64optional

Total number of sessions during the range specified

SessionsMinutesConsumed float64optional

Total session minutes during the range specified

Success booloptional

Fetch day-wise session and recording analytics data for an App

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.GetOrgAnalytics(
    context.TODO(),
    "app_id",
    realtime_kit.LivestreamGetOrgAnalyticsParams{
      AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.Data)
}
{
  "data": {
    "recording_stats": {
      "day_stats": [
        {
          "day": "day",
          "total_recording_minutes": 0,
          "total_recordings": 0
        }
      ],
      "recording_count": 0,
      "recording_minutes_consumed": 0
    },
    "session_stats": {
      "day_stats": [
        {
          "day": "day",
          "total_session_minutes": 0,
          "total_sessions": 0
        }
      ],
      "sessions_count": 0,
      "sessions_minutes_consumed": 0
    }
  },
  "success": true
}
Returns Examples
{
  "data": {
    "recording_stats": {
      "day_stats": [
        {
          "day": "day",
          "total_recording_minutes": 0,
          "total_recordings": 0
        }
      ],
      "recording_count": 0,
      "recording_minutes_consumed": 0
    },
    "session_stats": {
      "day_stats": [
        {
          "day": "day",
          "total_session_minutes": 0,
          "total_sessions": 0
        }
      ],
      "sessions_count": 0,
      "sessions_minutes_consumed": 0
    }
  },
  "success": true
}