Skip to content
Start here

Fetch details of peer

client.realtimeKit.sessions.getParticipantDataFromPeerId(stringappId, stringpeerId, SessionGetParticipantDataFromPeerIDParams { account_id, filters } params, RequestOptionsoptions?): SessionGetParticipantDataFromPeerIDResponse { data, success }
GET/accounts/{account_id}/realtime/kit/{app_id}/sessions/peer-report/{peer_id}

Returns details of the given peer ID along with call statistics for the given session ID.

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
peerId: string
params: SessionGetParticipantDataFromPeerIDParams { account_id, filters }
account_id: string

Path param: The account identifier tag.

maxLength32
filters?: "device_info" | "ip_information" | "precall_network_information" | 2 more

Query param: Comma separated list of filters to apply. Note that there must be no spaces between the filters.

One of the following:
"device_info"
"ip_information"
"precall_network_information"
"events"
"quality_stats"
ReturnsExpand Collapse
SessionGetParticipantDataFromPeerIDResponse { data, success }
data?: Data { participant }
participant?: Participant { id, created_at, custom_participant_id, 10 more }
id?: string
created_at?: string
custom_participant_id?: string
display_name?: string
duration?: number
joined_at?: string
left_at?: string
peer_report?: PeerReport { metadata, quality }
metadata?: Metadata { audio_devices_updates, browser_metadata, candidate_pairs, 10 more }
audio_devices_updates?: Array<unknown>
browser_metadata?: BrowserMetadata { browser, browser_version, engine, 2 more }
browser?: string
browser_version?: string
engine?: string
user_agent?: string
webgl_support?: string
candidate_pairs?: CandidatePairs { consuming_transport, producing_transport }
consuming_transport?: Array<unknown>
producing_transport?: Array<ProducingTransport>
available_outgoing_bitrate?: number
bytes_discarded_on_send?: number
bytes_received?: number
bytes_sent?: number
current_round_trip_time?: number
last_packet_received_timestamp?: number
last_packet_sent_timestamp?: number
local_candidate_address?: string
local_candidate_id?: string
local_candidate_network_type?: string
local_candidate_port?: number
local_candidate_protocol?: string
local_candidate_type?: string
nominated?: boolean
packets_discarded_on_send?: number
packets_received?: number
packets_sent?: number
remote_candidate_address?: string
remote_candidate_id?: string
remote_candidate_port?: number
remote_candidate_protocol?: string
remote_candidate_type?: string
total_round_trip_time?: number
device_info?: DeviceInfo { cpus, is_mobile, os, os_version }
cpus?: number
is_mobile?: boolean
os?: string
os_version?: string
events?: Array<Event>
name?: string
timestamp?: string
ip_information?: IPInformation { asn, city, country, 3 more }
asn?: ASN { asn }
asn?: string
city?: string
country?: string
ipv4?: string
region?: string
timezone?: string
pc_metadata?: Array<PcMetadata>
effective_network_type?: string
reflexive_connectivity?: boolean
relay_connectivity?: boolean
timestamp?: string
turn_connectivity?: boolean
room_view_type?: string
sdk_name?: string
sdk_version?: string
selected_device_updates?: Array<unknown>
speaker_devices_updates?: Array<unknown>
video_devices_updates?: Array<unknown>
quality?: Quality { audio_consumer, audio_consumer_cumulative, audio_producer, 13 more }
audio_consumer?: Array<unknown>
audio_consumer_cumulative?: unknown
audio_producer?: Array<AudioProducer>
bytes_sent?: number
jitter?: number
mid?: string
mos_quality?: number
packets_lost?: number
packets_sent?: number
producer_id?: string
rtt?: number
ssrc?: number
timestamp?: string
audio_producer_cumulative?: AudioProducerCumulative { packet_loss, quality_mos, rtt }
packet_loss?: PacketLoss { 10_or_greater_event_fraction, 25_or_greater_event_fraction, 5_or_greater_event_fraction, 2 more }
"10_or_greater_event_fraction"?: number
"25_or_greater_event_fraction"?: number
"5_or_greater_event_fraction"?: number
"50_or_greater_event_fraction"?: number
avg?: number
quality_mos?: QualityMos { avg, p50, p75, p90 }
avg?: number
p50?: number
p75?: number
p90?: number
rtt?: RTT { 100ms_or_greater_event_fraction, 250ms_or_greater_event_fraction, 500ms_or_greater_event_fraction, avg }
"100ms_or_greater_event_fraction"?: number
"250ms_or_greater_event_fraction"?: number
"500ms_or_greater_event_fraction"?: number
avg?: number
screenshare_audio_consumer?: Array<unknown>
screenshare_audio_consumer_cumulative?: unknown
screenshare_audio_producer?: Array<unknown>
screenshare_audio_producer_cumulative?: unknown
screenshare_video_consumer?: Array<unknown>
screenshare_video_consumer_cumulative?: unknown
screenshare_video_producer?: Array<unknown>
screenshare_video_producer_cumulative?: unknown
video_consumer?: Array<unknown>
video_consumer_cumulative?: unknown
video_producer?: Array<unknown>
video_producer_cumulative?: unknown
peer_stats?: PeerStats { device_info, events, ip_information, precall_network_information }
device_info?: DeviceInfo { browser, browser_version, cpus, 8 more }
browser?: string
browser_version?: string
cpus?: number
engine?: string
is_mobile?: boolean
os?: string
os_version?: string
sdk_name?: string
sdk_version?: string
user_agent?: string
webgl_support?: string
events?: Array<Event>
metadata?: Metadata { connection_info }
connection_info?: ConnectionInfo { backend_r_t_t, connectivity, effective_network_type, 7 more }
backend_r_t_t?: number
connectivity?: Connectivity { host, reflexive, relay }
host?: boolean
reflexive?: boolean
relay?: boolean
effective_network_type?: string
fractional_loss?: number
ip_details?: IPDetails { asn, city, country, 5 more }
asn?: ASN { asn }
asn?: string
city?: string
country?: string
ip?: string
loc?: string
postal?: string
region?: string
timezone?: string
jitter?: number
location?: Location { coords }
coords?: Coords { latitude, longitude }
latitude?: number
longitude?: number
r_t_t?: number
throughput?: number
turn_connectivity?: boolean
timestamp?: string
type?: string
ip_information?: IPInformation { asn, city, country, 5 more }
asn?: ASN { asn }
asn?: string
city?: string
country?: string
ip_location?: string
ipv4?: string
org?: string
region?: string
timezone?: string
precall_network_information?: PrecallNetworkInformation { backend_rtt, effective_networktype, fractional_loss, 6 more }
backend_rtt?: number
effective_networktype?: string
fractional_loss?: number
jitter?: number
reflexive_connectivity?: boolean
relay_connectivity?: boolean
rtt?: number
throughput?: number
turn_connectivity?: boolean
quality_stats?: QualityStats { audio_bandwidth, audio_stats, average_quality, 13 more }
audio_bandwidth?: number
audio_stats?: Array<unknown>
average_quality?: number
end?: string | null
first_audio_packet_received?: string
first_video_packet_received?: string
last_audio_packet_received?: string
last_video_packet_received?: string
peer_ids?: Array<string>
start?: string | null
total_audio_packets?: number
total_audio_packets_lost?: number
total_video_packets?: number
total_video_packets_lost?: number
video_bandwidth?: number
video_stats?: Array<unknown>
role?: string
updated_at?: string
user_id?: string
success?: boolean

Fetch details of peer

import Cloudflare from 'cloudflare';

const client = new Cloudflare({
  apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted
});

const response = await client.realtimeKit.sessions.getParticipantDataFromPeerId(
  'app_id',
  'peer_id',
  { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
);

console.log(response.data);
{
  "data": {
    "participant": {
      "id": "id",
      "created_at": "created_at",
      "custom_participant_id": "custom_participant_id",
      "display_name": "display_name",
      "duration": 0,
      "joined_at": "joined_at",
      "left_at": "left_at",
      "peer_report": {
        "metadata": {
          "audio_devices_updates": [
            {}
          ],
          "browser_metadata": {
            "browser": "browser",
            "browser_version": "browser_version",
            "engine": "engine",
            "user_agent": "user_agent",
            "webgl_support": "webgl_support"
          },
          "candidate_pairs": {
            "consuming_transport": [
              {}
            ],
            "producing_transport": [
              {
                "available_outgoing_bitrate": 0,
                "bytes_discarded_on_send": 0,
                "bytes_received": 0,
                "bytes_sent": 0,
                "current_round_trip_time": 0,
                "last_packet_received_timestamp": 0,
                "last_packet_sent_timestamp": 0,
                "local_candidate_address": "local_candidate_address",
                "local_candidate_id": "local_candidate_id",
                "local_candidate_network_type": "local_candidate_network_type",
                "local_candidate_port": 0,
                "local_candidate_protocol": "local_candidate_protocol",
                "local_candidate_related_address": "local_candidate_related_address",
                "local_candidate_related_port": 0,
                "local_candidate_type": "local_candidate_type",
                "nominated": true,
                "packets_discarded_on_send": 0,
                "packets_received": 0,
                "packets_sent": 0,
                "remote_candidate_address": "remote_candidate_address",
                "remote_candidate_id": "remote_candidate_id",
                "remote_candidate_port": 0,
                "remote_candidate_protocol": "remote_candidate_protocol",
                "remote_candidate_type": "remote_candidate_type",
                "total_round_trip_time": 0
              }
            ]
          },
          "device_info": {
            "cpus": 0,
            "is_mobile": true,
            "os": "os",
            "os_version": "os_version"
          },
          "events": [
            {
              "name": "name",
              "timestamp": "timestamp"
            }
          ],
          "ip_information": {
            "asn": {
              "asn": "asn"
            },
            "city": "city",
            "country": "country",
            "ipv4": "ipv4",
            "region": "region",
            "timezone": "timezone"
          },
          "pc_metadata": [
            {
              "effective_network_type": "effective_network_type",
              "reflexive_connectivity": true,
              "relay_connectivity": true,
              "timestamp": "timestamp",
              "turn_connectivity": true
            }
          ],
          "room_view_type": "room_view_type",
          "sdk_name": "sdk_name",
          "sdk_version": "sdk_version",
          "selected_device_updates": [
            {}
          ],
          "speaker_devices_updates": [
            {}
          ],
          "video_devices_updates": [
            {}
          ]
        },
        "quality": {
          "audio_consumer": [
            {}
          ],
          "audio_consumer_cumulative": {},
          "audio_producer": [
            {
              "bytes_sent": 0,
              "jitter": 0,
              "mid": "mid",
              "mos_quality": 0,
              "packets_lost": 0,
              "packets_sent": 0,
              "producer_id": "producer_id",
              "rtt": 0,
              "ssrc": 0,
              "timestamp": "timestamp"
            }
          ],
          "audio_producer_cumulative": {
            "packet_loss": {
              "10_or_greater_event_fraction": 0,
              "25_or_greater_event_fraction": 0,
              "5_or_greater_event_fraction": 0,
              "50_or_greater_event_fraction": 0,
              "avg": 0
            },
            "quality_mos": {
              "avg": 0,
              "p50": 0,
              "p75": 0,
              "p90": 0
            },
            "rtt": {
              "100ms_or_greater_event_fraction": 0,
              "250ms_or_greater_event_fraction": 0,
              "500ms_or_greater_event_fraction": 0,
              "avg": 0
            }
          },
          "screenshare_audio_consumer": [
            {}
          ],
          "screenshare_audio_consumer_cumulative": {},
          "screenshare_audio_producer": [
            {}
          ],
          "screenshare_audio_producer_cumulative": {},
          "screenshare_video_consumer": [
            {}
          ],
          "screenshare_video_consumer_cumulative": {},
          "screenshare_video_producer": [
            {}
          ],
          "screenshare_video_producer_cumulative": {},
          "video_consumer": [
            {}
          ],
          "video_consumer_cumulative": {},
          "video_producer": [
            {}
          ],
          "video_producer_cumulative": {}
        }
      },
      "peer_stats": {
        "device_info": {
          "browser": "browser",
          "browser_version": "browser_version",
          "cpus": 0,
          "engine": "engine",
          "is_mobile": true,
          "os": "os",
          "os_version": "os_version",
          "sdk_name": "sdk_name",
          "sdk_version": "sdk_version",
          "user_agent": "user_agent",
          "webgl_support": "webgl_support"
        },
        "events": [
          {
            "metadata": {
              "connection_info": {
                "backend_r_t_t": 0,
                "connectivity": {
                  "host": true,
                  "reflexive": true,
                  "relay": true
                },
                "effective_network_type": "effective_network_type",
                "fractional_loss": 0,
                "ip_details": {
                  "asn": {
                    "asn": "asn"
                  },
                  "city": "city",
                  "country": "country",
                  "ip": "ip",
                  "loc": "loc",
                  "postal": "postal",
                  "region": "region",
                  "timezone": "timezone"
                },
                "jitter": 0,
                "location": {
                  "coords": {
                    "latitude": 0,
                    "longitude": 0
                  }
                },
                "r_t_t": 0,
                "throughput": 0,
                "turn_connectivity": true
              }
            },
            "timestamp": "timestamp",
            "type": "type"
          }
        ],
        "ip_information": {
          "asn": {
            "asn": "asn"
          },
          "city": "city",
          "country": "country",
          "ip_location": "ip_location",
          "ipv4": "ipv4",
          "org": "org",
          "region": "region",
          "timezone": "timezone"
        },
        "precall_network_information": {
          "backend_rtt": 0,
          "effective_networktype": "effective_networktype",
          "fractional_loss": 0,
          "jitter": 0,
          "reflexive_connectivity": true,
          "relay_connectivity": true,
          "rtt": 0,
          "throughput": 0,
          "turn_connectivity": true
        }
      },
      "quality_stats": {
        "audio_bandwidth": 0,
        "audio_stats": [
          {}
        ],
        "average_quality": 0,
        "end": "end",
        "first_audio_packet_received": "first_audio_packet_received",
        "first_video_packet_received": "first_video_packet_received",
        "last_audio_packet_received": "last_audio_packet_received",
        "last_video_packet_received": "last_video_packet_received",
        "peer_ids": [
          "string"
        ],
        "start": "start",
        "total_audio_packets": 0,
        "total_audio_packets_lost": 0,
        "total_video_packets": 0,
        "total_video_packets_lost": 0,
        "video_bandwidth": 0,
        "video_stats": [
          {}
        ]
      },
      "role": "role",
      "updated_at": "updated_at",
      "user_id": "user_id"
    }
  },
  "success": true
}
Returns Examples
{
  "data": {
    "participant": {
      "id": "id",
      "created_at": "created_at",
      "custom_participant_id": "custom_participant_id",
      "display_name": "display_name",
      "duration": 0,
      "joined_at": "joined_at",
      "left_at": "left_at",
      "peer_report": {
        "metadata": {
          "audio_devices_updates": [
            {}
          ],
          "browser_metadata": {
            "browser": "browser",
            "browser_version": "browser_version",
            "engine": "engine",
            "user_agent": "user_agent",
            "webgl_support": "webgl_support"
          },
          "candidate_pairs": {
            "consuming_transport": [
              {}
            ],
            "producing_transport": [
              {
                "available_outgoing_bitrate": 0,
                "bytes_discarded_on_send": 0,
                "bytes_received": 0,
                "bytes_sent": 0,
                "current_round_trip_time": 0,
                "last_packet_received_timestamp": 0,
                "last_packet_sent_timestamp": 0,
                "local_candidate_address": "local_candidate_address",
                "local_candidate_id": "local_candidate_id",
                "local_candidate_network_type": "local_candidate_network_type",
                "local_candidate_port": 0,
                "local_candidate_protocol": "local_candidate_protocol",
                "local_candidate_related_address": "local_candidate_related_address",
                "local_candidate_related_port": 0,
                "local_candidate_type": "local_candidate_type",
                "nominated": true,
                "packets_discarded_on_send": 0,
                "packets_received": 0,
                "packets_sent": 0,
                "remote_candidate_address": "remote_candidate_address",
                "remote_candidate_id": "remote_candidate_id",
                "remote_candidate_port": 0,
                "remote_candidate_protocol": "remote_candidate_protocol",
                "remote_candidate_type": "remote_candidate_type",
                "total_round_trip_time": 0
              }
            ]
          },
          "device_info": {
            "cpus": 0,
            "is_mobile": true,
            "os": "os",
            "os_version": "os_version"
          },
          "events": [
            {
              "name": "name",
              "timestamp": "timestamp"
            }
          ],
          "ip_information": {
            "asn": {
              "asn": "asn"
            },
            "city": "city",
            "country": "country",
            "ipv4": "ipv4",
            "region": "region",
            "timezone": "timezone"
          },
          "pc_metadata": [
            {
              "effective_network_type": "effective_network_type",
              "reflexive_connectivity": true,
              "relay_connectivity": true,
              "timestamp": "timestamp",
              "turn_connectivity": true
            }
          ],
          "room_view_type": "room_view_type",
          "sdk_name": "sdk_name",
          "sdk_version": "sdk_version",
          "selected_device_updates": [
            {}
          ],
          "speaker_devices_updates": [
            {}
          ],
          "video_devices_updates": [
            {}
          ]
        },
        "quality": {
          "audio_consumer": [
            {}
          ],
          "audio_consumer_cumulative": {},
          "audio_producer": [
            {
              "bytes_sent": 0,
              "jitter": 0,
              "mid": "mid",
              "mos_quality": 0,
              "packets_lost": 0,
              "packets_sent": 0,
              "producer_id": "producer_id",
              "rtt": 0,
              "ssrc": 0,
              "timestamp": "timestamp"
            }
          ],
          "audio_producer_cumulative": {
            "packet_loss": {
              "10_or_greater_event_fraction": 0,
              "25_or_greater_event_fraction": 0,
              "5_or_greater_event_fraction": 0,
              "50_or_greater_event_fraction": 0,
              "avg": 0
            },
            "quality_mos": {
              "avg": 0,
              "p50": 0,
              "p75": 0,
              "p90": 0
            },
            "rtt": {
              "100ms_or_greater_event_fraction": 0,
              "250ms_or_greater_event_fraction": 0,
              "500ms_or_greater_event_fraction": 0,
              "avg": 0
            }
          },
          "screenshare_audio_consumer": [
            {}
          ],
          "screenshare_audio_consumer_cumulative": {},
          "screenshare_audio_producer": [
            {}
          ],
          "screenshare_audio_producer_cumulative": {},
          "screenshare_video_consumer": [
            {}
          ],
          "screenshare_video_consumer_cumulative": {},
          "screenshare_video_producer": [
            {}
          ],
          "screenshare_video_producer_cumulative": {},
          "video_consumer": [
            {}
          ],
          "video_consumer_cumulative": {},
          "video_producer": [
            {}
          ],
          "video_producer_cumulative": {}
        }
      },
      "peer_stats": {
        "device_info": {
          "browser": "browser",
          "browser_version": "browser_version",
          "cpus": 0,
          "engine": "engine",
          "is_mobile": true,
          "os": "os",
          "os_version": "os_version",
          "sdk_name": "sdk_name",
          "sdk_version": "sdk_version",
          "user_agent": "user_agent",
          "webgl_support": "webgl_support"
        },
        "events": [
          {
            "metadata": {
              "connection_info": {
                "backend_r_t_t": 0,
                "connectivity": {
                  "host": true,
                  "reflexive": true,
                  "relay": true
                },
                "effective_network_type": "effective_network_type",
                "fractional_loss": 0,
                "ip_details": {
                  "asn": {
                    "asn": "asn"
                  },
                  "city": "city",
                  "country": "country",
                  "ip": "ip",
                  "loc": "loc",
                  "postal": "postal",
                  "region": "region",
                  "timezone": "timezone"
                },
                "jitter": 0,
                "location": {
                  "coords": {
                    "latitude": 0,
                    "longitude": 0
                  }
                },
                "r_t_t": 0,
                "throughput": 0,
                "turn_connectivity": true
              }
            },
            "timestamp": "timestamp",
            "type": "type"
          }
        ],
        "ip_information": {
          "asn": {
            "asn": "asn"
          },
          "city": "city",
          "country": "country",
          "ip_location": "ip_location",
          "ipv4": "ipv4",
          "org": "org",
          "region": "region",
          "timezone": "timezone"
        },
        "precall_network_information": {
          "backend_rtt": 0,
          "effective_networktype": "effective_networktype",
          "fractional_loss": 0,
          "jitter": 0,
          "reflexive_connectivity": true,
          "relay_connectivity": true,
          "rtt": 0,
          "throughput": 0,
          "turn_connectivity": true
        }
      },
      "quality_stats": {
        "audio_bandwidth": 0,
        "audio_stats": [
          {}
        ],
        "average_quality": 0,
        "end": "end",
        "first_audio_packet_received": "first_audio_packet_received",
        "first_video_packet_received": "first_video_packet_received",
        "last_audio_packet_received": "last_audio_packet_received",
        "last_video_packet_received": "last_video_packet_received",
        "peer_ids": [
          "string"
        ],
        "start": "start",
        "total_audio_packets": 0,
        "total_audio_packets_lost": 0,
        "total_video_packets": 0,
        "total_video_packets_lost": 0,
        "video_bandwidth": 0,
        "video_stats": [
          {}
        ]
      },
      "role": "role",
      "updated_at": "updated_at",
      "user_id": "user_id"
    }
  },
  "success": true
}