Skip to content
Start here

Fetch all livestreams

client.RealtimeKit.Livestreams.GetAllLivestreams(ctx, appID, params) (*LivestreamGetAllLivestreamsResponse, error)
GET/accounts/{account_id}/realtime/kit/{app_id}/livestreams

Returns details of livestreams associated with the given App ID. It includes livestreams created by your App and RealtimeKit meetings that are livestreamed by your App. If you only want details of livestreams created by your App and not RealtimeKit meetings, you can use the exclude_meetings query parameter.

Security
API Token

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

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Accepted Permissions (at least one required)
Realtime AdminRealtime
ParametersExpand Collapse
appID string

The app identifier tag.

params LivestreamGetAllLivestreamsParams
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 live stream.

formatdate-time
ExcludeMeetings param.Field[bool]Optional

Query param: Exclude the RealtimeKit meetings that are livestreamed.

PageNo param.Field[int64]Optional

Query param: The page number from which you want your page search results to be displayed.

PerPage param.Field[int64]Optional

Query param: Number of results per page.

SortOrder param.Field[LivestreamGetAllLivestreamsParamsSortOrder]Optional

Query param: Specifies the sorting order for the results.

const LivestreamGetAllLivestreamsParamsSortOrderAsc LivestreamGetAllLivestreamsParamsSortOrder = "ASC"
const LivestreamGetAllLivestreamsParamsSortOrderDsc LivestreamGetAllLivestreamsParamsSortOrder = "DSC"
StartTime param.Field[Time]Optional

Query param: Specify the start time range in ISO format to access the live stream.

formatdate-time
Status param.Field[LivestreamGetAllLivestreamsParamsStatus]Optional

Query param: Specifies the status of the operation.

const LivestreamGetAllLivestreamsParamsStatusLive LivestreamGetAllLivestreamsParamsStatus = "LIVE"
const LivestreamGetAllLivestreamsParamsStatusIdle LivestreamGetAllLivestreamsParamsStatus = "IDLE"
const LivestreamGetAllLivestreamsParamsStatusErrored LivestreamGetAllLivestreamsParamsStatus = "ERRORED"
const LivestreamGetAllLivestreamsParamsStatusInvoked LivestreamGetAllLivestreamsParamsStatus = "INVOKED"
ReturnsExpand Collapse
type LivestreamGetAllLivestreamsResponse struct{…}
Data []LivestreamGetAllLivestreamsResponseData
ID string

ID of the livestream.

formatuuid
CreatedAt Time

Timestamp the livestream was created at, in ISO format.

formatdate-time
Disabled bool

Specifies if the livestream is disabled.

ExternalID string

ID of the underlying Cloudflare Stream live input.

IngestServer string

The server URL to which the RTMP encoder sends the video and audio data.

ManualIngest bool

Specifies if the livestream is ingested manually by an RTMP encoder.

MeetingID string

ID of the meeting being livestreamed, if any.

Name string

Name of the livestream.

PlaybackURL string

The web address that viewers can use to watch the livestream.

Status LivestreamGetAllLivestreamsResponseDataStatus

Status of the livestream.

One of the following:
const LivestreamGetAllLivestreamsResponseDataStatusLive LivestreamGetAllLivestreamsResponseDataStatus = "LIVE"
const LivestreamGetAllLivestreamsResponseDataStatusIdle LivestreamGetAllLivestreamsResponseDataStatus = "IDLE"
const LivestreamGetAllLivestreamsResponseDataStatusErrored LivestreamGetAllLivestreamsResponseDataStatus = "ERRORED"
const LivestreamGetAllLivestreamsResponseDataStatusInvoked LivestreamGetAllLivestreamsResponseDataStatus = "INVOKED"
const LivestreamGetAllLivestreamsResponseDataStatusMetricsReady LivestreamGetAllLivestreamsResponseDataStatus = "METRICS_READY"
StreamKey string

Unique key for accessing each livestream. Empty if the livestream is disabled.

UpdatedAt Time

Timestamp the livestream was last updated at, in ISO format.

formatdate-time
Paging LivestreamGetAllLivestreamsResponsePaging
EndOffset float64
StartOffset float64
TotalCount float64
minimum0
Success bool

Fetch all 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.GetAllLivestreams(
    context.TODO(),
    "14a396e7-ca44-4937-bf1f-050a69118543",
    realtime_kit.LivestreamGetAllLivestreamsParams{
      AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.Data)
}
{
  "data": [
    {
      "created_at": "2023-07-15T07:08:26.634Z",
      "disabled": false,
      "external_id": "7de6a3fec0f9c05bf1df140950d3a237",
      "id": "b60ef3da-fbbb-441b-9168-8235b0035248",
      "ingest_server": "rtmps://live.cloudflare.com:443/live/",
      "manual_ingest": false,
      "meeting_id": "bbb87945-df1c-49d9-8159-262a7ae6cfde",
      "name": "test",
      "playback_url": "https://customer-s8oj0c1n5ek8ah1e.cloudflarestream.com/7de6a3fec0f9c05bf1df140950d3a237/manifest/video.m3u8",
      "status": "LIVE",
      "stream_key": "f26566285faca6fbe2e79a73a66rsrrsrrsr3cde23a2bb7dbc6c2c1761b98f4e4",
      "updated_at": "2023-07-15T07:08:40.726Z"
    }
  ],
  "paging": {
    "end_offset": 1,
    "start_offset": 1,
    "total_count": 1
  },
  "success": true
}
Returns Examples
{
  "data": [
    {
      "created_at": "2023-07-15T07:08:26.634Z",
      "disabled": false,
      "external_id": "7de6a3fec0f9c05bf1df140950d3a237",
      "id": "b60ef3da-fbbb-441b-9168-8235b0035248",
      "ingest_server": "rtmps://live.cloudflare.com:443/live/",
      "manual_ingest": false,
      "meeting_id": "bbb87945-df1c-49d9-8159-262a7ae6cfde",
      "name": "test",
      "playback_url": "https://customer-s8oj0c1n5ek8ah1e.cloudflarestream.com/7de6a3fec0f9c05bf1df140950d3a237/manifest/video.m3u8",
      "status": "LIVE",
      "stream_key": "f26566285faca6fbe2e79a73a66rsrrsrrsr3cde23a2bb7dbc6c2c1761b98f4e4",
      "updated_at": "2023-07-15T07:08:40.726Z"
    }
  ],
  "paging": {
    "end_offset": 1,
    "start_offset": 1,
    "total_count": 1
  },
  "success": true
}