Sign inGet Started

Get audience membership statistics

GET
/v1/audiences/{audience_id}/membership-statistics
const history = await bird.audiences.membershipHistory(
  "adn_01krdgeqcxet5s7t44vh8rt9mg",
  {
    from: "2026-10-09",
    to: "2026-10-12",
  },
);
for (const point of history.data) {
  console.log(point.bucket, point.total, point.observed_at);
}
Antwort200
{
  "period": {
    "from": "2026-10-09",
    "to": "2026-10-12",
    "data_as_of": null
  },
  "data": [
    {
      "bucket": "2026-10-09",
      "total": null,
      "observed_at": null
    },
    {
      "bucket": "2026-10-10",
      "total": 0,
      "observed_at": "2026-10-10T00:07:12.218Z"
    },
    {
      "bucket": "2026-10-11",
      "total": 1279,
      "observed_at": "2026-10-11T00:05:48.903Z"
    },
    {
      "bucket": "2026-10-12",
      "total": 1284,
      "observed_at": "2026-10-12T00:06:31.44Z"
    }
  ]
}

Returns the first successful observation for each requested UTC date, in chronological order. Changes between observations are unobserved. A missing observation has null total and observed_at; a successful empty audience has zero members. History retains today and the preceding 364 UTC dates; older requested dates are gaps. No history is reconstructed before observation began.

Only daily UTC observations are supported. Period data_as_of is always null because samples do not establish continuous freshness; each point carries its actual observed_at. Future, reversed, invalid or longer-than-365-date windows return 422. For the current exact count, use Get audience membership.

Returns 421 when the workspace's organization is served from a different region from the API host. Retry against that workspace's regional host.

Parameter

audience_idstring

ID of the audience whose observations to read.

Abfrageparameter

fromstring

Inclusive first UTC date. Defaults to 30 days before to, yielding 31 inclusive dates.

tostring

Inclusive last UTC date. Defaults to today in UTC; future dates are rejected. At most 365 inclusive dates.

Antwort-Payload

period
object
erforderlich

Requested UTC date window.

Untergeordnete Attribute anzeigen
data
array of object
erforderlich

One point for every requested date, including gaps.

Untergeordnete Attribute anzeigen
data.bucket
string
erforderlich

UTC date of the observation, or the requested date for a gap.

data.total
nullable integer
erforderlich

Exact number of all members at observation time, or null for a gap.

data.observed_at
nullable string
erforderlich

Actual source observation instant, or null for a gap. This is not a day-close count.

Weiter mit der Dokumentation, Anleitungen und Beispielen zu diesem Thema.