Skip to content
Start here

Fetch livestream details using livestream ID

realtime_kit.livestreams.get_livestream_session_for_livestream_id(strlivestream_id, LivestreamGetLivestreamSessionForLivestreamIDParams**kwargs) -> LivestreamGetLivestreamSessionForLivestreamIDResponse
GET/accounts/{account_id}/realtime/kit/{app_id}/livestreams/{livestream_id}

Returns details of a livestream with sessions for the given livestream ID. Retreive the livestream ID using the Start livestreaming a meeting API.

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
account_id: str

The account identifier tag.

maxLength32
app_id: str

The app identifier tag.

maxLength32
livestream_id: str
page_no: Optional[int]

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

per_page: Optional[int]

Number of results per page.

ReturnsExpand Collapse
class LivestreamGetLivestreamSessionForLivestreamIDResponse:
data: Optional[Data]
livestream: Optional[DataLivestream]
id: Optional[str]

ID of the livestream.

created_at: Optional[str]

Timestamp the object was created at. The time is returned in ISO format.

disabled: Optional[str]

Specifies if the livestream was disabled.

ingest_server: Optional[str]

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

meeting_id: Optional[str]

The ID of the meeting.

name: Optional[str]

Name of the livestream.

playback_url: Optional[str]

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

status: Optional[Literal["LIVE", "IDLE", "ERRORED", "INVOKED"]]
One of the following:
"LIVE"
"IDLE"
"ERRORED"
"INVOKED"
stream_key: Optional[str]

Unique key for accessing each livestream.

updated_at: Optional[str]

Timestamp the object was updated at. The time is returned in ISO format.

paging: Optional[DataPaging]
end_offset: Optional[int]
start_offset: Optional[int]
total_count: Optional[int]
session: Optional[DataSession]
id: Optional[str]

ID of the session.

created_at: Optional[datetime]

Timestamp the object was created at. The time is returned in ISO format.

formatdate-time
err_message: Optional[str]
ingest_seconds: Optional[float]

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

invoked_time: Optional[datetime]

Timestamp the object was invoked. The time is returned in ISO format.

formatdate-time
livestream_id: Optional[str]
started_time: Optional[datetime]

Timestamp the object was started. The time is returned in ISO format.

formatdate-time
stopped_time: Optional[datetime]

Timestamp the object was stopped. The time is returned in ISO format.

formatdate-time
updated_at: Optional[datetime]

Timestamp the object was updated at. The time is returned in ISO format.

formatdate-time
viewer_seconds: Optional[float]

The total view time for which the viewers watched the stream.

success: Optional[bool]

Fetch livestream details using livestream ID

import os
from cloudflare import Cloudflare

client = Cloudflare(
    api_token=os.environ.get("CLOUDFLARE_API_TOKEN"),  # This is the default and can be omitted
)
response = client.realtime_kit.livestreams.get_livestream_session_for_livestream_id(
    livestream_id="livestream_id",
    account_id="023e105f4ecef8ad9ca31a8372d0c353",
    app_id="app_id",
)
print(response.data)
{
  "data": {
    "livestream": {
      "id": "id",
      "created_at": "created_at",
      "disabled": "disabled",
      "ingest_server": "ingest_server",
      "meeting_id": "meeting_id",
      "name": "name",
      "playback_url": "playback_url",
      "status": "LIVE",
      "stream_key": "stream_key",
      "updated_at": "updated_at"
    },
    "paging": {
      "end_offset": 1,
      "start_offset": 1,
      "total_count": 1
    },
    "session": {
      "id": "id",
      "created_at": "2019-12-27T18:11:19.117Z",
      "err_message": "err_message",
      "ingest_seconds": 0,
      "invoked_time": "2019-12-27T18:11:19.117Z",
      "livestream_id": "livestream_id",
      "started_time": "2019-12-27T18:11:19.117Z",
      "stopped_time": "2019-12-27T18:11:19.117Z",
      "updated_at": "2019-12-27T18:11:19.117Z",
      "viewer_seconds": 0
    }
  },
  "success": true
}
Returns Examples
{
  "data": {
    "livestream": {
      "id": "id",
      "created_at": "created_at",
      "disabled": "disabled",
      "ingest_server": "ingest_server",
      "meeting_id": "meeting_id",
      "name": "name",
      "playback_url": "playback_url",
      "status": "LIVE",
      "stream_key": "stream_key",
      "updated_at": "updated_at"
    },
    "paging": {
      "end_offset": 1,
      "start_offset": 1,
      "total_count": 1
    },
    "session": {
      "id": "id",
      "created_at": "2019-12-27T18:11:19.117Z",
      "err_message": "err_message",
      "ingest_seconds": 0,
      "invoked_time": "2019-12-27T18:11:19.117Z",
      "livestream_id": "livestream_id",
      "started_time": "2019-12-27T18:11:19.117Z",
      "stopped_time": "2019-12-27T18:11:19.117Z",
      "updated_at": "2019-12-27T18:11:19.117Z",
      "viewer_seconds": 0
    }
  },
  "success": true
}