Skip to main content
List ads as flat rows — one row per ad, with optional daily metrics and an optional compare period — from the ads-platform integrations connected to your pixel. Wraps POST /api/query-ads — see the API reference. Unlike upstack query (nested result blocks) or upstack query-channel-details (entity listing with basic details), query-ads always returns a flat { rows, pagination } shape, which makes it the simplest command to script or consume programmatically. When --measures is omitted, the command is a listing-only call: every ad on the pixel comes back with its metadata and no metric series. Adding --measures with a date range attaches a daily metric series per ad.

Usage

Required flags

None. A bare upstack query-ads lists ads with pagination.

Optional flags

From-file schema

--from-file takes a JSON file of parameter-style keys — the same keys as the flags, not the API request body. CLI flags override file values.
Accepted keys: measures (array of { "measure": "<id>" } or a comma-separated string), dateStart, dateEnd, compareDateStart, compareDateEnd, timezone, currency, filter, limit, offset, sortBy, sortDirection, output. Do not use the API body shape (dateRange, compareDateRange) — those keys are ignored and the request fails validation with "dateRange" is required.

Response shape

Listing-only calls return rows with basicDetails and an empty data. Metric calls fill data.primary (one entry per date bucket that has data — ads with no data in the period return an empty data.primary array, not zero-filled buckets) and, when a compare range is given, data.compare. pagination.hasMore tells you whether to page with --offset.

Examples

See also