> ## Documentation Index
> Fetch the complete documentation index at: https://docs.daily.co/llms.txt
> Use this file to discover all available pages before exploring further.

# getNetworkStats()

> Returns current network quality stats and per-interval send/receive metrics.

`getNetworkStats()`

✓ Prebuilt✓ Custom

Returns a snapshot of the current network statistics, calculated from [WebRTC stats](https://www.w3.org/TR/webrtc-stats/). Stats in `stats.latest` are updated approximately every two seconds — poll this method to monitor network performance over time.

If a value cannot be determined for a given interval, it is set to `null`. This most commonly occurs for `packetLoss` calculations due to the values it relies upon being missing or stale, or media not being transmitted. For instance, if you join a call with audio and video off, your bitrates will be 0 and `packetLoss` will be `null` because it is unknown.

## Return value

Returns a `Promise<DailyNetworkStats>`:

**networkState** `string`

Current network quality assessment: `'good'`, `'warning'`, `'bad'`, or `'unknown'`. Calculated from send/receive packet loss, round trip time, and available outgoing bitrate, averaged over a \~30-second rolling window. In Prebuilt, Daily lowers bandwidth at `'warning'` and disables the local camera at `'bad'`.

**networkStateReasons** `string[]`

Reasons for the current `networkState`. Possible values: `'sendPacketLoss'`, `'recvPacketLoss'`, `'roundTripTime'`, `'availableOutgoingBitrate'`. Empty when state is `'good'` or `'unknown'`.

**stats** `DailyNetworkStatsData | \{\}`

Network statistics. Empty object (`{}`) when stats are not yet available.

**stats fields**

**averageNetworkRoundTripTime** `number`

Average round trip time over the course of the call.

**worstAudioRecvPacketLoss** `number`

Highest audio receive packet loss seen during any reporting interval.

**worstAudioSendPacketLoss** `number`

Highest audio send packet loss seen during any reporting interval.

**worstVideoRecvPacketLoss** `number`

Highest video receive packet loss seen during any reporting interval.

**worstVideoSendPacketLoss** `number`

Highest video send packet loss seen during any reporting interval.

**worstVideoRecvJitter** `number`

Highest video receive jitter seen during any reporting interval.

**worstVideoSendJitter** `number`

Highest video send jitter seen during any reporting interval.

**worstAudioRecvJitter** `number`

Highest audio receive jitter seen during any reporting interval.

**worstAudioSendJitter** `number`

Highest audio send jitter seen during any reporting interval.

**latest** `object`

Statistics from the most recent reporting interval (\~2s).

**latest fields**

**timestamp** `number`

Unix timestamp (ms) of when the stats were recorded.

**recvBitsPerSecond** `number | null`

Total incoming bits per second (audio + video).

**sendBitsPerSecond** `number | null`

Total outgoing bits per second (audio + video).

**networkRoundTripTime** `number | null`

Average round trip time across all connections.

**availableOutgoingBitrate** `number | null`

Average available outgoing bitrate across all connections.

**audioRecvBitsPerSecond** `number | null`

Incoming audio payload bits per second.

**audioSendBitsPerSecond** `number | null`

Outgoing audio payload bits per second.

**audioRecvPacketLoss** `number | null`

Estimated packet loss percentage for incoming audio.

**audioSendPacketLoss** `number | null`

Estimated packet loss percentage for outgoing audio. Always `null` in Firefox.

**videoRecvBitsPerSecond** `number | null`

Incoming video payload bits per second.

**videoSendBitsPerSecond** `number | null`

Outgoing video payload bits per second.

**videoRecvPacketLoss** `number | null`

Estimated packet loss percentage for incoming video.

**videoSendPacketLoss** `number | null`

Estimated packet loss percentage for outgoing video.

**totalRecvPacketLoss** `number | null`

Overall estimated packet loss for all incoming media.

**totalSendPacketLoss** `number | null`

Overall estimated packet loss for all outgoing media.

**videoRecvJitter** `number | null`

Average jitter across inbound video streams.

**videoSendJitter** `number | null`

Average jitter across outbound video streams.

**audioRecvJitter** `number | null`

Average jitter across inbound audio streams.

**audioSendJitter** `number | null`

Average jitter across outbound audio streams. Always `null` in Firefox.

**threshold** `string` *deprecated*

Deprecated in 0.77.0. Use `networkState` instead. Was `'good'`, `'low'`, or `'very-low'`.

**quality** `number` *deprecated*

Deprecated in 0.77.0. Was a subjective 1–100 quality score.

> [!WARNING]
>
> Firefox does not report send-side packet loss or jitter for audio (`audioSendPacketLoss` and `audioSendJitter` are always `null`), and does not provide `availableOutgoingBitrate`, `networkRoundTripTime`, or `averageNetworkRoundTripTime`.

## Example

```javascript Example Usage theme={null}
const { networkState, networkStateReasons, stats } = await call.getNetworkStats();

if (networkState === 'bad') {
  console.log('Poor network. Reasons:', networkStateReasons);
}

if (stats.latest) {
  console.log('Packet loss (send):', stats.latest.totalSendPacketLoss);
  console.log('Round trip time:', stats.latest.networkRoundTripTime);
}
```

```JSON Sample response theme={null}
{
  "networkState": "bad",
  "networkStateReasons": ["sendPacketLoss", "recvPacketLoss"],
  "threshold": "good",
  "quality": 37,
  "stats": {
    "averageNetworkRoundTripTime": 0.01992261904761905,
    "latest": {
      "audioRecvBitsPerSecond": 23050.048937297845,
      "audioRecvJitter": 0.026,
      "audioRecvPacketLoss": 0.15053763440860216,
      "audioSendBitsPerSecond": 30177.83704675053,
      "audioSendJitter": null,
      "audioSendPacketLoss": null,
      "availableOutgoingBitrate": 2889866,
      "networkRoundTripTime": 0.02,
      "recvBitsPerSecond": 1700344.1895481267,
      "sendBitsPerSecond": 1724499.7493844875,
      "timestamp": 1743011906315,
      "totalRecvPacketLoss": 0.11670020120724346,
      "totalSendPacketLoss": 0.08984375,
      "videoRecvBitsPerSecond": 1567291.2594309496,
      "videoRecvJitter": 0.036,
      "videoRecvPacketLoss": 0.10891089108910891,
      "videoSendBitsPerSecond": 1589251.349980054,
      "videoSendJitter": 0.008922,
      "videoSendPacketLoss": 0.08984375
    },
    "worstAudioRecvJitter": 0.026,
    "worstAudioRecvPacketLoss": 0.23232323232323232,
    "worstAudioSendJitter": 0.003166,
    "worstAudioSendPacketLoss": 0.1953125,
    "worstVideoRecvJitter": 0.036,
    "worstVideoRecvPacketLoss": 0.10891089108910891,
    "worstVideoSendJitter": 0.014355,
    "worstVideoSendPacketLoss": 0.13671875
  }
}
```

## See also

> [card] Methods
>
> * [getCpuLoadStats()](https://docs.daily.co/reference/daily-js/instance-methods/get-cpu-load-stats.md)
> * [updateSendSettings()](https://docs.daily.co/reference/daily-js/instance-methods/update-send-settings.md)
> * [updateReceiveSettings()](https://docs.daily.co/reference/daily-js/instance-methods/update-receive-settings.md)

> [card] Events
>
> * [network-quality-change](https://docs.daily.co/reference/daily-js/events/network-events.md#network-quality-change)
> * [network-connection](https://docs.daily.co/reference/daily-js/events/network-events.md#network-connection)

> [card] Guides
>
> * [Call quality](https://docs.daily.co/docs/daily-js/guides/network-quality.md)
> * [Logging and metrics](https://docs.daily.co/docs/guides/architecture-and-monitoring/logging-and-metrics.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.