RTCIceCandidateStats

Baseline Widely available *

This feature is well established and works across many devices and browser versions. It’s been available across browsers since February 2020.

* Some parts of this feature may have varying levels of support.

The RTCIceCandidateStats dictionary of the WebRTC API is used to report statistics related to an RTCIceCandidate.

The statistics can be obtained by iterating the RTCStatsReport returned by RTCPeerConnection.getStats() until you find a report with the type of local-candidate.

Instance properties

address Optional

A string containing the address of the candidate. This value may be an IPv4 address, an IPv6 address, or a fully-qualified domain name. This property was previously named ip and only accepted IP addresses. Corresponds to RTCIceCandidate.address.

candidateType

A string matching one of the values in RTCIceCandidate.type, indicating what kind of candidate the object provides statistics for.

deleted

A boolean indicating whether or not the candidate has been deleted or released.

foundation Optional

A string that uniquely identifies the candidate across multiple transports. Corresponds to RTCIceCandidate.foundation.

port Optional

The network port number used by the candidate. Corresponds to RTCIceCandidate.port.

priority Optional

The candidate's priority. Corresponds to RTCIceCandidate.priority.

protocol Optional

A string specifying the protocol (tcp or udp) used to transmit data on the port. Corresponds to RTCIceCandidate.protocol.

relayProtocol

A string specifying the protocol being used by a local ICE candidate to communicate with the TURN server.

transportId

A string uniquely identifying the transport object that was inspected in order to obtain the RTCTransportStats associated with the candidate corresponding to these statistics.

url Optional

A string specifying the URL of the ICE server from which the described candidate was obtained. This property is only available for local candidates.

usernameFragment Optional

A string containing the ICE username fragment ("ice-ufrag"). Corresponds to RTCIceCandidate.usernameFragment.

Common instance properties

The following properties are common to all WebRTC statistics objects.

id

A string that uniquely identifies the object that is being monitored to produce this set of statistics.

timestamp

A DOMHighResTimeStamp object indicating the time at which the sample was taken for this statistics object.

type

A string with the value "local-candidate", indicating the type of statistics that the object contains.

Examples

Given a variable myPeerConnection, which is an instance of RTCPeerConnection, the code below uses await to wait for the statistics report, and then iterates it using RTCStatsReport.forEach(). It then filters the dictionaries for just those reports that have the type of local-candidate and logs the result.

js
const stats = await myPeerConnection.getStats();

stats.forEach((report) => {
  if (report.type === "local-candidate") {
    // Log the ICE candidate information
    console.log(report);
  }
});

Specifications

Specification
Identifiers for WebRTC's Statistics API
# dom-rtcstatstype-local-candidate

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
local-candidate stats
Chrome – Full support
Chrome 80 (Release date: 2020-02-04)
footnote Full support
Edge – Full support
Edge 80 (Release date: 2020-02-07)
footnote Full support
Firefox – Full support
Firefox 27 (Release date: 2014-02-04)
footnote Full support
Opera – Full support
Opera 67 (Release date: 2020-03-03)
footnote Full support
Safari – Full support
Safari 12.1 (Release date: 2019-03-25)
footnote Full support
Chrome Android – Full support
Chrome Android 80 (Release date: 2020-02-04)
footnote Full support
Firefox for Android – Full support
Firefox for Android 27 (Release date: 2014-02-04)
footnote Full support
Opera Android – Full support
Opera Android 57 (Release date: 2020-03-30)
footnote Full support
Safari on iOS – Full support
Safari on iOS 12.2 (Release date: 2019-03-25)
footnote Full support
Samsung Internet – Full support
Samsung Internet 13 (Release date: 2020-12-02)
footnote Full support
WebView Android – Full support
WebView Android 80 (Release date: 2020-02-04)
footnote Full support
WebView on iOS – Full support
WebView on iOS 12.2 (Release date: 2019-03-25)
footnote Full support
address in 'local-candidate' stats
Chrome – Full support
Chrome 91 (Release date: 2021-05-25)
footnote Full support
Edge – Full support
Edge 91 (Release date: 2021-05-27)
footnote Full support
Firefox – Full support
Firefox 27 (Release date: 2014-02-04)
altname
altname Alternate name: ipAddress
Firefox – Full support
Firefox 65 (Release date: 2019-01-29)
footnote Full support
Opera – Full support
Opera 77 (Release date: 2021-06-09)
footnote Full support
Safari – No support
Safari
footnote No support
Chrome Android – Full support
Chrome Android 91 (Release date: 2021-05-25)
footnote Full support
Firefox for Android – Full support
Firefox for Android 27 (Release date: 2014-02-04)
altname
altname Alternate name: ipAddress
Firefox for Android – Full support
Firefox for Android 65 (Release date: 2019-01-29)
footnote Full support
Opera Android – Full support
Opera Android 64 (Release date: 2021-05-25)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – Full support
Samsung Internet 16 (Release date: 2021-11-25)
footnote Full support
WebView Android – Full support
WebView Android 91 (Release date: 2021-05-25)
footnote Full support
WebView on iOS – No support
WebView on iOS
footnote No support
candidateType in 'local-candidate' stats
Chrome – Full support
Chrome 80 (Release date: 2020-02-04)
footnote Full support
Edge – Full support
Edge 80 (Release date: 2020-02-07)
footnote Full support
Firefox – Full support
Firefox 27 (Release date: 2014-02-04)
footnote Full support
Opera – Full support
Opera 67 (Release date: 2020-03-03)
footnote Full support
Safari – Full support
Safari 12.1 (Release date: 2019-03-25)
footnote Full support
Chrome Android – Full support
Chrome Android 80 (Release date: 2020-02-04)
footnote Full support
Firefox for Android – Full support
Firefox for Android 27 (Release date: 2014-02-04)
footnote Full support
Opera Android – Full support
Opera Android 57 (Release date: 2020-03-30)
footnote Full support
Safari on iOS – Full support
Safari on iOS 12.2 (Release date: 2019-03-25)
footnote Full support
Samsung Internet – Full support
Samsung Internet 13 (Release date: 2020-12-02)
footnote Full support
WebView Android – Full support
WebView Android 80 (Release date: 2020-02-04)
footnote Full support
WebView on iOS – Full support
WebView on iOS 12.2 (Release date: 2019-03-25)
footnote Full support
foundation in 'local-candidate' stats
Experimental
Chrome – Full support
Chrome 108 (Release date: 2022-11-29)
footnote Full support
Edge – Full support
Edge 108 (Release date: 2022-12-05)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 94 (Release date: 2022-12-15)
footnote Full support
Safari – No support
Safari
footnote No support
Chrome Android – Full support
Chrome Android 108 (Release date: 2022-11-29)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – Full support
Opera Android 73 (Release date: 2023-01-17)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – Full support
Samsung Internet 21 (Release date: 2023-05-19)
footnote Full support
WebView Android – Full support
WebView Android 108 (Release date: 2022-11-29)
footnote Full support
WebView on iOS – No support
WebView on iOS
footnote No support
id in 'local-candidate' stats
Chrome – Full support
Chrome 80 (Release date: 2020-02-04)
footnote Full support
Edge – Full support
Edge 80 (Release date: 2020-02-07)
footnote Full support
Firefox – Full support
Firefox 72 (Release date: 2020-01-07)
footnote Full support
Opera – Full support
Opera 67 (Release date: 2020-03-03)
footnote Full support
Safari – Full support
Safari 13.1 (Release date: 2020-03-24)
footnote Full support
Chrome Android – Full support
Chrome Android 80 (Release date: 2020-02-04)
footnote Full support
Firefox for Android – Full support
Firefox for Android 79 (Release date: 2020-07-28)
footnote Full support
Opera Android – Full support
Opera Android 57 (Release date: 2020-03-30)
footnote Full support
Safari on iOS – Full support
Safari on iOS 13.4 (Release date: 2020-03-24)
footnote Full support
Samsung Internet – Full support
Samsung Internet 13 (Release date: 2020-12-02)
footnote Full support
WebView Android – Full support
WebView Android 80 (Release date: 2020-02-04)
footnote Full support
WebView on iOS – Full support
WebView on iOS 13.4 (Release date: 2020-03-24)
footnote Full support
port in 'local-candidate' stats
Chrome – Full support
Chrome 80 (Release date: 2020-02-04)
footnote Full support
Edge – Full support
Edge 80 (Release date: 2020-02-07)
footnote Full support
Firefox – Full support
Firefox 27 (Release date: 2014-02-04)
altname
altname Alternate name: portNumber
Firefox – Full support
Firefox 72 (Release date: 2020-01-07)
footnote Full support
Opera – Full support
Opera 67 (Release date: 2020-03-03)
footnote Full support
Safari – Full support
Safari 12.1 (Release date: 2019-03-25)
footnote Full support
Chrome Android – Full support
Chrome Android 80 (Release date: 2020-02-04)
footnote Full support
Firefox for Android – Full support
Firefox for Android 27 (Release date: 2014-02-04)
altname
altname Alternate name: portNumber
Firefox for Android – Full support
Firefox for Android 79 (Release date: 2020-07-28)
footnote Full support
Opera Android – Full support
Opera Android 57 (Release date: 2020-03-30)
footnote Full support
Safari on iOS – Full support
Safari on iOS 12.2 (Release date: 2019-03-25)
footnote Full support
Samsung Internet – Full support
Samsung Internet 13 (Release date: 2020-12-02)
footnote Full support
WebView Android – Full support
WebView Android 80 (Release date: 2020-02-04)
footnote Full support
WebView on iOS – Full support
WebView on iOS 12.2 (Release date: 2019-03-25)
footnote Full support
priority in 'local-candidate' stats
Chrome – Full support
Chrome 80 (Release date: 2020-02-04)
footnote Full support
Edge – Full support
Edge 80 (Release date: 2020-02-07)
footnote Full support
Firefox – Full support
Firefox 72 (Release date: 2020-01-07)
footnote Full support
Opera – Full support
Opera 67 (Release date: 2020-03-03)
footnote Full support
Safari – Full support
Safari 12.1 (Release date: 2019-03-25)
footnote Full support
Chrome Android – Full support
Chrome Android 80 (Release date: 2020-02-04)
footnote Full support
Firefox for Android – Full support
Firefox for Android 79 (Release date: 2020-07-28)
footnote Full support
Opera Android – Full support
Opera Android 57 (Release date: 2020-03-30)
footnote Full support
Safari on iOS – Full support
Safari on iOS 12.2 (Release date: 2019-03-25)
footnote Full support
Samsung Internet – Full support
Samsung Internet 13 (Release date: 2020-12-02)
footnote Full support
WebView Android – Full support
WebView Android 80 (Release date: 2020-02-04)
footnote Full support
WebView on iOS – Full support
WebView on iOS 12.2 (Release date: 2019-03-25)
footnote Full support
protocol in 'local-candidate' stats
Chrome – Full support
Chrome 80 (Release date: 2020-02-04)
footnote Full support
Edge – Full support
Edge 80 (Release date: 2020-02-07)
footnote Full support
Firefox – Full support
Firefox 31 (Release date: 2014-07-22)
altname
altname Alternate name: mozLocalTransport
Firefox – Full support
Firefox 64 (Release date: 2018-12-11)
footnote Full support
Opera – Full support
Opera 67 (Release date: 2020-03-03)
footnote Full support
Safari – Full support
Safari 12.1 (Release date: 2019-03-25)
footnote Full support
Chrome Android – Full support
Chrome Android 80 (Release date: 2020-02-04)
footnote Full support
Firefox for Android – Full support
Firefox for Android 31 (Release date: 2014-07-22)
altname
altname Alternate name: mozLocalTransport
Firefox for Android – Full support
Firefox for Android 64 (Release date: 2018-12-11)
footnote Full support
Opera Android – Full support
Opera Android 57 (Release date: 2020-03-30)
footnote Full support
Safari on iOS – Full support
Safari on iOS 12.2 (Release date: 2019-03-25)
footnote Full support
Samsung Internet – Full support
Samsung Internet 13 (Release date: 2020-12-02)
footnote Full support
WebView Android – Full support
WebView Android 80 (Release date: 2020-02-04)
footnote Full support
WebView on iOS – Full support
WebView on iOS 12.2 (Release date: 2019-03-25)
footnote Full support
timestamp in 'local-candidate' stats
Chrome – Full support
Chrome 80 (Release date: 2020-02-04)
footnote Full support
Edge – Full support
Edge 80 (Release date: 2020-02-07)
footnote Full support
Firefox – Full support
Firefox 72 (Release date: 2020-01-07)
footnote Full support
Opera – Full support
Opera 67 (Release date: 2020-03-03)
footnote Full support
Safari – Full support
Safari 13.1 (Release date: 2020-03-24)
footnote Full support
Chrome Android – Full support
Chrome Android 80 (Release date: 2020-02-04)
footnote Full support
Firefox for Android – Full support
Firefox for Android 79 (Release date: 2020-07-28)
footnote Full support
Opera Android – Full support
Opera Android 57 (Release date: 2020-03-30)
footnote Full support
Safari on iOS – Full support
Safari on iOS 13.4 (Release date: 2020-03-24)
footnote Full support
Samsung Internet – Full support
Samsung Internet 13 (Release date: 2020-12-02)
footnote Full support
WebView Android – Full support
WebView Android 80 (Release date: 2020-02-04)
footnote Full support
WebView on iOS – Full support
WebView on iOS 13.4 (Release date: 2020-03-24)
footnote Full support
transportId in 'local-candidate' stats
Chrome – Full support
Chrome 80 (Release date: 2020-02-04)
footnote Full support
Edge – Full support
Edge 80 (Release date: 2020-02-07)
footnote Full support
Firefox – Full support
Firefox 31 (Release date: 2014-07-22)
altname
altname Alternate name: transport
Opera – Full support
Opera 67 (Release date: 2020-03-03)
footnote Full support
Safari – Full support
Safari 12.1 (Release date: 2019-03-25)
footnote Full support
Chrome Android – Full support
Chrome Android 80 (Release date: 2020-02-04)
footnote Full support
Firefox for Android – Full support
Firefox for Android 31 (Release date: 2014-07-22)
altname
altname Alternate name: transport
Opera Android – Full support
Opera Android 57 (Release date: 2020-03-30)
footnote Full support
Safari on iOS – Full support
Safari on iOS 12.2 (Release date: 2019-03-25)
footnote Full support
Samsung Internet – Full support
Samsung Internet 13 (Release date: 2020-12-02)
footnote Full support
WebView Android – Full support
WebView Android 80 (Release date: 2020-02-04)
footnote Full support
WebView on iOS – Full support
WebView on iOS 12.2 (Release date: 2019-03-25)
footnote Full support
type in 'local-candidate' stats
Chrome – Full support
Chrome 80 (Release date: 2020-02-04)
footnote Full support
Edge – Full support
Edge 80 (Release date: 2020-02-07)
footnote Full support
Firefox – Full support
Firefox 72 (Release date: 2020-01-07)
footnote Full support
Opera – Full support
Opera 67 (Release date: 2020-03-03)
footnote Full support
Safari – Full support
Safari 13.1 (Release date: 2020-03-24)
footnote Full support
Chrome Android – Full support
Chrome Android 80 (Release date: 2020-02-04)
footnote Full support
Firefox for Android – Full support
Firefox for Android 79 (Release date: 2020-07-28)
footnote Full support
Opera Android – Full support
Opera Android 57 (Release date: 2020-03-30)
footnote Full support
Safari on iOS – Full support
Safari on iOS 13.4 (Release date: 2020-03-24)
footnote Full support
Samsung Internet – Full support
Samsung Internet 13 (Release date: 2020-12-02)
footnote Full support
WebView Android – Full support
WebView Android 80 (Release date: 2020-02-04)
footnote Full support
WebView on iOS – Full support
WebView on iOS 13.4 (Release date: 2020-03-24)
footnote Full support
usernameFragment in 'local-candidate' stats
Experimental
Chrome – Full support
Chrome 108 (Release date: 2022-11-29)
footnote Full support
Edge – Full support
Edge 108 (Release date: 2022-12-05)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 94 (Release date: 2022-12-15)
footnote Full support
Safari – No support
Safari
footnote No support
Chrome Android – Full support
Chrome Android 108 (Release date: 2022-11-29)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – Full support
Opera Android 73 (Release date: 2023-01-17)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – Full support
Samsung Internet 21 (Release date: 2023-05-19)
footnote Full support
WebView Android – Full support
WebView Android 108 (Release date: 2022-11-29)
footnote Full support
WebView on iOS – No support
WebView on iOS
footnote No support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
Experimental. Expect behavior to change in the future.
Uses a non-standard name
Has more compatibility info.