Documentation
Sign inGet started

Received messages by country

GET
/v1/sms/stats/inbound/countries
const stats = await bird.sms.stats.inbound.byCountry({ from: "2026-05-01", to: "2026-05-31" });
for (const row of stats.data ?? []) {
  console.log(row.country, row.received);
}
Returns the number of messages your numbers received, broken down by country.
Rows are ranked by volume, highest first, and counted by the time the carrier received each message. The country is that of the Bird number the message arrived on, not the sender's.
A row carries a count and nothing else. A received message has one state, so there is no lifecycle to break down and no delivery latency to report.
The maximum window is 365 days; a longer range returns 422. Set timezone to resolve the period against your local calendar instead of UTC.
Paramètres de requête
from
string
Start date (inclusive), YYYY-MM-DD. Interpreted as a calendar day in timezone (a UTC day when timezone is omitted). Defaults to 30 days before to when omitted.
to
string
End date (inclusive), YYYY-MM-DD. Interpreted as a calendar day in timezone (a UTC day when timezone is omitted). Defaults to today in that timezone when omitted. Window may not exceed 365 days.
timezone
string
IANA timezone identifier (for example Asia/Kathmandu) to report in; defaults to UTC. Day and hour boundaries and the default window when from and to are omitted both follow it, so a calendar-day from or to names a local day. A from or to carrying its own UTC offset is rejected while this is set: pass a calendar day or a Z instant.
limit
integer
Maximum rows to return, ranked by volume. Defaults to 50; the maximum is 200, and asking for more returns 422 rather than silently returning fewer.
Contenu de la réponse
period
object
obligatoire
The window the server actually computed against. The summary serves two window grains: calendar days (bounds are YYYY-MM-DD) and hours (bounds are RFC 3339 instants on the hour). The grain of from and to mirrors the grain of the request's bounds.
Afficher les attributs enfants
period.from
string
obligatoire
Inclusive start of the window the response covers -- a calendar day (YYYY-MM-DD) for day windows, or an hour boundary (RFC 3339) for hour windows.
period.to
string
obligatoire
Inclusive end of the window the response covers -- a calendar day (YYYY-MM-DD) for day windows, or an hour boundary (RFC 3339) for hour windows.
period.data_as_of
nullable string
The instant the statistics in this response are current to: events recorded up to roughly this time are reflected, while more recent events may not be yet. Statistics are served from a rolling aggregation that refreshes every few seconds, so a response is near-real-time but not live; use this field to label data freshness (for example "as of 14:03") rather than assuming the numbers are to-the-second. Null when the freshness boundary is not being reported.
data
array of object
obligatoire
One row per country with activity in the period, most messages first, capped at the requested limit. A country with no messages in the period is absent rather than zero-filled, because unlike a time bucket it is not part of a continuous axis.
Afficher les attributs enfants
data.country
string
obligatoire
The country of the Bird number the messages arrived on, as an ISO 3166-1 alpha-2 code. This is where the message was received, not where the sender is.
data.received
integer
obligatoire
Distinct messages received on numbers in this country during the period.
total
integer
obligatoire
Total number of distinct countries the messages arrived in with activity in the period, regardless of limit. When it exceeds the number of rows returned, the ranking was capped; raise limit (up to 200) or narrow the window to see more.