# Get outbound WhatsApp statistics by country

`GET /v1/whatsapp/stats/countries`

Returns delivery counts, read engagement and latency grouped by the recipient's destination
country. Rows use send-time attribution, rank by accepted volume, and are capped by `limit`
(default 50, maximum 200). A recent period under-reports `delivered` while delivery reports
are still arriving. The maximum window is 365 days; a longer range returns `422`.

A country row covers messages addressed to a single recipient. A recipient whose country
cannot be resolved (a number shaped like a phone number that belongs to no country, or a
non-geographic range such as freephone) is counted under `ZZ` rather than dropped,
matching the SMS country breakdown. Group sends are omitted entirely: one spans
up to eight recipients in as many countries, so no single destination country describes
it. These rows therefore sum to the summary less that group volume. A window reaching before this
breakdown shipped falls short by more than that: history was seeded only where the
recipient's country could be recovered from stored data, so a phone-addressed send
accepted before the cutover has no `accepted` leg here. Two cases follow, and they read
differently. Acceptance days more than 14 days before the cutover are a plain shortfall
and never change. In the 14 days immediately before it, a `delivered`, `read` or `failed`
callback arriving after the cutover does carry a country and is attributed to its original
acceptance day, so a row there can report deliveries with `accepted` at zero. Its
`delivery_rate` and `failure_rate` are then null for want of a denominator while
`read_rate` still computes and looks healthy. The 14 days are the status recording window,
after which a callback is dropped. All of this is confined to pre-cutover acceptance days
and gone once the requested window starts after the cutover date.

Latency reports the same three families as the summary: `processing`, `delivery` and
`total`. The delivery family depends on a best-effort handoff timestamp that a fast
delivery callback can beat, so it can be absent for a country whose other two families
are present.

A breakdown is already a single-dimension view and takes no dimension filter; to restrict
statistics to a single template, category, phone number or tag, use the summary, daily or
hourly statistics instead.

## Code samples

### TypeScript

```ts
const stats = await bird.whatsapp.stats.byCountry({ from: "2026-08-01", to: "2026-08-31" });
for (const row of stats.data ?? []) {
  console.log(row.country, row.delivery);
}
```

### Python

```py
stats = client.whatsapp.stats.by_country(from_="2026-08-01", to="2026-08-31")
for row in stats.data or []:
    print(row.country, row.delivery)
```

### Go

```go
stats, err := client.Whatsapp.Stats.ByCountry(context.Background(), bird.WhatsappStatsByCountryParams{
	From: time.Now().AddDate(0, -1, 0),
	To:   time.Now(),
})
if err != nil {
	log.Fatal(err)
}
for _, row := range *stats.Data {
	fmt.Println(*row.Country, *row.Delivery.Accepted)
}
```

### PHP

```php
$byCountry = $bird->whatsapp->stats->byCountry(['from' => '2026-08-01', 'to' => '2026-08-31']);
foreach ($byCountry->getData() ?? [] as $row) {
    echo $row->getCountry(), ' ', $row->getDelivery()?->getAccepted(), PHP_EOL;
}
```

### CLI

```sh
bird whatsapp stats by-country
```

### cURL

```sh
curl -X GET "https://us1.platform.bird.com/v1/whatsapp/stats/countries" \
  -H "Authorization: Bearer $TOKEN" \
  --url-query "limit=50"
```

## Example response `200`

```json
{
  "period": {
    "from": "2026-05-01",
    "to": "2026-05-25",
    "data_as_of": "2026-05-25T14:03:10Z"
  },
  "data": [
    {
      "country": "US",
      "delivery": {
        "accepted": 4820,
        "sent": 4810,
        "delivered": 4720,
        "failed": 25,
        "rejected": 412,
        "delivery_rate": 0.9793,
        "failure_rate": 0.0052
      },
      "engagement": {
        "read": 3105,
        "read_rate": 0.6578
      },
      "latency": {
        "processing": {
          "p50_ms": 610,
          "p95_ms": 2140,
          "p99_ms": 5380
        },
        "delivery": {
          "p50_ms": 1530,
          "p95_ms": 6820,
          "p99_ms": 18400
        },
        "total": {
          "p50_ms": 2180,
          "p95_ms": 9060,
          "p99_ms": 24300
        }
      }
    }
  ],
  "total": 4
}
```

## Query parameters

- `from` (string): Inclusive start of the window, a calendar day (YYYY-MM-DD). Interpreted in `timezone`, or UTC when omitted. Must not be after `to`. Max window 365 days. Defaults to 30 days before `to` when omitted.
- `to` (string): Inclusive end of the window, a calendar day (YYYY-MM-DD). Interpreted in `timezone`, or UTC when omitted. Max window 365 days. Defaults to today in that timezone when omitted.
- `timezone` (string): IANA timezone identifier used to group statistics, for example `Asia/Kathmandu`. The default is UTC. Day and hour boundaries, including the default window when `from` and `to` are omitted, follow this timezone. When this parameter is set, pass `from` and `to` as calendar days or `Z` instants instead of timestamps with explicit UTC offsets.
- `limit` (integer): Maximum number of country rows to return, ranked by accepted volume descending.

## Response body

- `period` (object, required): The window the response covers (echoed back), plus `data_as_of`.
- `period.from` (string, required): Inclusive start of the window, as a calendar day (`YYYY-MM-DD`) or an RFC 3339 hour boundary.
- `period.to` (string, required): Inclusive end of the window, as a calendar day (`YYYY-MM-DD`) or an RFC 3339 hour boundary.
- `period.data_as_of` (nullable string): Latest time reflected in the statistics. More recent events might not be included yet. Null when the freshness boundary is unavailable.
- `data` (array of object, required): Country rows ranked by accepted volume descending. Empty when no eligible activity occurred in the period; rows sum to the summary less group-send volume, and less any pre-cutover phone-addressed sends still inside the window.
- `data.country` (string, required): The destination country this row aggregates, as an ISO 3166-1 alpha-2 code. `ZZ` collects recipients whose country could not be resolved.
- `data.delivery` (object, required)
- `data.delivery.accepted` (integer, required): Distinct messages accepted for sending after admission checks. This is the denominator for `delivery_rate` and `failure_rate`.
- `data.delivery.sent` (integer, required): Distinct messages handed off for delivery.
- `data.delivery.delivered` (integer, required): Distinct messages confirmed delivered to the recipient's device.
- `data.delivery.failed` (integer, required): Distinct messages that failed during sending or delivery.
- `data.delivery.rejected` (integer, required): Distinct messages rejected before any send attempt, because the recipient is on the workspace's suppression list, no reachable recipient was given, the destination has no price, or the wallet could not fund the send. Rejected messages are never charged and are not counted in `accepted`, so the total addressed is `accepted + rejected`. Excluded from `failure_rate`, which covers send failures only.
- `data.delivery.delivery_rate` (nullable number, required): Share of accepted messages that were delivered, computed as `delivered / accepted`. Null when no messages were accepted in scope.
- `data.delivery.failure_rate` (nullable number, required): Share of accepted messages that ultimately failed, computed as `failed / accepted`. Null when no messages were accepted in scope.
- `data.engagement` (object, required)
- `data.engagement.read` (integer, required): Distinct messages confirmed read by the recipient.
- `data.engagement.read_rate` (nullable number, required): Distinct messages read relative to messages delivered in the same scope, computed as `read / delivery.delivered`. Both counts are attributed by send time, so a read is counted alongside its own message's delivery. The rate can exceed 1 where a read receipt arrived for a message whose delivery receipt did not, or, at high volume, because the counts are close estimates. Null when `delivery.delivered` is zero.
- `data.latency` (object, required)
- `data.latency.processing` (object): Approximate p50, p95, and p99 latency percentiles in milliseconds for one latency family. All three are null when no qualifying event contributed a measurement.
- `data.latency.processing.p50_ms` (nullable integer, required): Median (50th percentile) latency in milliseconds. Null when no qualifying event contributed a measurement.
- `data.latency.processing.p95_ms` (nullable integer, required): 95th percentile latency in milliseconds. Null when no qualifying event contributed a measurement.
- `data.latency.processing.p99_ms` (nullable integer, required): 99th percentile latency in milliseconds. Null when no qualifying event contributed a measurement.
- `data.latency.delivery` (object): Approximate p50, p95, and p99 latency percentiles in milliseconds for one latency family. All three are null when no qualifying event contributed a measurement.
- `data.latency.delivery.p50_ms` (nullable integer, required): Median (50th percentile) latency in milliseconds. Null when no qualifying event contributed a measurement.
- `data.latency.delivery.p95_ms` (nullable integer, required): 95th percentile latency in milliseconds. Null when no qualifying event contributed a measurement.
- `data.latency.delivery.p99_ms` (nullable integer, required): 99th percentile latency in milliseconds. Null when no qualifying event contributed a measurement.
- `data.latency.total` (object): Approximate p50, p95, and p99 latency percentiles in milliseconds for one latency family. All three are null when no qualifying event contributed a measurement.
- `data.latency.total.p50_ms` (nullable integer, required): Median (50th percentile) latency in milliseconds. Null when no qualifying event contributed a measurement.
- `data.latency.total.p95_ms` (nullable integer, required): 95th percentile latency in milliseconds. Null when no qualifying event contributed a measurement.
- `data.latency.total.p99_ms` (nullable integer, required): 99th percentile latency in milliseconds. Null when no qualifying event contributed a measurement.
- `total` (integer, required): Total distinct countries with activity in the period, regardless of `limit`.

## Related resources

- [Should I use a Bird SDK or call the API directly?](/explained/platform/should-i-use-an-sdk-or-call-the-api-directly) (answer)
- [Build your first integration](/learn/paths/integration) (course)
- [Send your first email](/docs/get-started/send-your-first-email) (docs)

[Get an implementation brief](/learn/workspace?topic=api-basics)
