Skip to content
Start here

Fetch day-wise analytics data for your livestreams

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

Returns day-wise 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 LivestreamGetLivestreamAnalyticsDaywiseParams
AccountID param.Field[string]

Path param: The account identifier tag.

maxLength32
EndTime param.Field[int64]Optional

Query param: Specify the end time as a Unix timestamp in seconds to access the livestream analytics.

formatint64
Filters param.Field[string]Optional

Query param: Optional filters for livestream analytics.

StartTime param.Field[int64]Optional

Query param: Specify the start time as a Unix timestamp in seconds to access the livestream analytics.

formatint64
ReturnsExpand Collapse
type LivestreamGetLivestreamAnalyticsDaywiseResponse struct{…}
Data []LivestreamGetLivestreamAnalyticsDaywiseResponseDataOptional
Count int64Optional

Count of total livestream sessions.

Date stringOptional

Analytics date.

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 day-wise 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.GetLivestreamAnalyticsDaywise(
    context.TODO(),
    "app_id",
    realtime_kit.LivestreamGetLivestreamAnalyticsDaywiseParams{
      AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.Data)
}
{
  "data": [
    {
      "count": 4,
      "date": "2023-07-15",
      "total_ingest_seconds": 531,
      "total_viewer_seconds": 116
    }
  ],
  "success": true
}
Returns Examples
{
  "data": [
    {
      "count": 4,
      "date": "2023-07-15",
      "total_ingest_seconds": 531,
      "total_viewer_seconds": 116
    }
  ],
  "success": true
}