Skip to main content

Ads

Ad creative registry and matching.

📄️Find videos this ad fits into (NDJSON stream)

Given a registered creative (`ad_id`), stream back the scenes it fits into as NDJSON. Each line is a JSON object with a `type` field, in this order: `analyzing` (`stage` progress markers), `ad_analysis` (the creative's analysis — same fields as `GET /v1/ads/{ad_id}/analysis`), `agent_step` (query planning: `tool`, `query`, `ok`, `note`), `meta` (`facets`, `tags`, `brand_context`, `candidates` — the candidate scenes before rerank), one `result` per reranked scene (`video_id`, `video_title`, `scene_id`, `scene_index`, `score` 0–10, `reason`, `timestamp_ms` — absolute position in the video, `timestamp_sec_in_clip`, `scene_start_ms`, `scene_end_ms`, `clip_url`), then `done`. A failure is emitted as `error` (`message`) and ends the stream. `result` lines arrive as the rerank finishes, not sorted — order by `score` client-side, and ignore `type` values you do not recognise.