Count the events for a pixel, a project or a DelivrDSP campaign over a time window, optionally narrowed by a filter or reduced to the distinct values of one field. Use it to size a window before you pull rows with the tier routes.
Counts only, and not billed. The response is a number, never event rows.
Scope. Name one of pixel_id or project_id (source=pixel, the default), or campaign_id with source=dsp. A project counts across all its pixels.
Window. start_ms and end_ms are required, and the maximum window depends on the query:
- A plain count: 168 hours.
- A count with
filterordistinct: 75 hours. - With
include_cold=true: 92 days, for either kind.
A wider window returns 400.
Example. Count the page views on one pixel over one day:
GET /api/v2/event_counts?pixel_id=px_123&start_ms=1792022400000&end_ms=1792108800000&filter=event_type:eq:page_view| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
400Invalid query. A missing or invalid start_ms or end_ms, a window wider than allowed, no pixel, project or campaign, or an unknown distinct field.
401Missing or invalid API key.
429Rate limit exceeded.
500Query failed.
