# Search ad libraries

> For the complete documentation index, see [llms.txt](https://www.shortsintel.com/llms.txt). Every docs page is also available as markdown: add .md to its URL. To connect, read [agents.md](https://www.shortsintel.com/agents.md).

POST `/v1/ads/search`

The Meta, TikTok or Google ad library, by keyword or by advertiser. Pass exactly one of `query` or `advertiser`. Keyword searches are always live.

Meta

- Advertiser: a Facebook Page id, Page URL or name.
- Ambiguous name: a name several Pages carry is a free 409 `advertiser_ambiguous` with `candidates` (`page_id`, `name`, `page_url`, `instagram`, `ad_count`), never a guess. Estimates too, when stored Advertisers share the name.
- Stored results: an `advertiser` search by Page id or URL within 6 hours of a complete observation is served from storage at the same price unless it sets `country`, saying `cached` and `as_of`.
- Complete observation: a `status: all` search with no other filter read to the end, or a fresh `GET /v1/advertisers/{page_id}`.
- Filters: `country` (omit for every country), `status` (running by default), `kind` (commercial by default), `media_type`, `placements` and a start-date range.
- Paging: a `limit` up to 500, read across library pages. `next_cursor` gives more.
- Storage: every Meta Ad returned is stored with its Advertiser and a Snapshot, one Run item each.

TikTok

- Regions: the library holds only Ads delivered in the EU/EEA, Switzerland, the UK and Turkey.
- Results: one page per call, stored (media archived once looked up), with `spend` and `impressions` null.
- Not available: `country`, Meta-only filters and `analyze`.
- Advertiser: an advertiser id (once stored), a library.tiktok.com advertiser URL or a name.
- Ambiguous name: a name several advertisers carry (case counts) is the same free 409, with `candidates` `{ advertiser_id, name, url }`. Pass one's `url` back.

Google

- No keyword search: `query` is refused. Pass an `AR` id, Transparency URL, domain or name.
- Names: pass `country`, or use a domain or `AR` id.
- Filters: `media_type` and `placements` are separate: `youtube` does not imply video. `placements` takes one value.
- Paging: `limit` up to 200; past 40, poll the Run id.
- Failed details: returned with `details_failed`, uncharged; the Run is `partial`.

Analysis

- Scope: `analyze: true` analyses the first 50 Ads from our archived media, the ad copy as context.
- Video Ads: the video set (transcript, hook, offer, angle, persuasion, tone, visual, safety, detected shots, product first seen, opening frame).
- Image and carousel Ads: the image set (copy angle, offer, CTA, visual format, topics, sentiment).
- Reuse: computed once per Ad and version, reused by later Runs at the same charge. Every Ad carries any stored analysis.
- Timing: after the read, so expect a 202 and poll.
- Failures: a failed or refused Ad is uncharged and makes the Run `partial`. A Run with no analysis fails, uncharged.
- Google: first distinct media only, video by YouTube id. Text or unreadable Ads are refused: `intelligence_error`. Those, and media broken in the pass, cost their delivery; the Run is `partial`.

Library failures

- Part-way: the Run is left `partial`, charged for the Ads delivered, with `incomplete` saying why and `next_cursor` resuming.
- Unreachable: the Run (and an estimate) fails with `source_unavailable`, uncharged.

[Open in Playground](https://www.shortsintel.com/console/playground?op=searchAds&library=meta&query=cold+plunge&country=US&status=active&kind=commercial&media_type=video&placements=facebook&started_after=2026-01-01&started_before=2026-02-01&limit=20&order_by=relevance&match=any_words&language=language&analyze=true) (no API Key needed)

## Price

Meta: 1 credit per Ad delivered, plus 20 credits per Ad analysed with `analyze`, computed or already stored; the estimate quotes `limit` Ads, analysed up to the cap. TikTok: 3 credits per page. Google: 3 credits per Ad, plus analysis.

Supports `"estimate": true` in the body: the reply is the price in Credits and whether it would be `cached`, with no Run created and nothing charged.

A cached result costs the same as a fresh one; `cached` says which you got.

## Parameters

| Name | In | Type | Required | Default | Description |
| --- | --- | --- | --- | --- | --- |
| `Idempotency-Key` | header | `string` | Optional | — | 1-255 printable ASCII characters. The same key and payload returns the original Run (202 while running); a different payload or operation is a 409 `idempotency_conflict`. |

## Request body

`application/json`

object

- `library` string required one of `meta`, `tiktok`, `google` `meta`, the Meta Ad Library (Facebook and Instagram Ads, priced per Ad delivered), `tiktok`, the TikTok ad library (Ads delivered in the EU/EEA, Switzerland, the UK and Turkey, priced per page), or `google`, Google's Ads Transparency Center (priced per Ad delivered).
- `query` string length at least 1 Keywords to search Ads for. Pass this or `advertiser`, exactly one. A Meta keyword search is always fetched live. Google has no keyword search and refuses it.
- `advertiser` string length at least 1 Every Ad of one advertiser instead of a keyword search; pass this or `query`, exactly one. Meta: a Facebook Page id, Page URL or name. TikTok: the library's advertiser id, a library.tiktok.com URL or a name. Google: an `AR` id, a Transparency URL, a domain (Ads across its advertisers) or a name; a dotted name with no space (`Dr.Oetker`) reads as a domain. A name several advertisers carry is 409 `advertiser_ambiguous` with candidates, not charged.
- `country` string length 2 to 2 Two-letter country code. Omitted searches every country, except that a Google `advertiser` name may be looked up in the US only: pass `country` with a name, or use a domain or `AR` id. Meta and Google; the TikTok library (Ads delivered in the EU/EEA, Switzerland, the UK and Turkey, searched together) refuses it.
- `status` string one of `active`, `inactive`, `all` Running (`active`, the default), stopped (`inactive`) or `all`. Meta only; the TikTok and Google libraries refuse it.
- `kind` string one of `commercial`, `political`, `issue`, `all` `commercial` (the default), `political`, `issue` or `all`. Meta only; the TikTok and Google libraries refuse it.
- `media_type` string one of `video`, `image`, `carousel`, `text` Only Ads of this format; omitted means every format. Meta: video, image, carousel. Google: video, image, text. The TikTok library refuses it.
- `placements` array of string items 1 to 4 Only Ads placed on at least one of these. Meta: facebook, instagram, messenger, audience_network. Google, one per call: youtube, google_search, google_shopping, google_maps, google_play; `youtube` does not imply video, so add `media_type` for that. The TikTok library refuses it.
- `started_after` string ISO date or timestamp; Ads that started on or after it. Meta and Google; the TikTok library refuses it.
- `started_before` string ISO date or timestamp; Ads that started before it. Meta and Google; the TikTok library refuses it.
- `limit` integer value 1 to 500 Meta: default 50, at most 500, fetched across as many library pages as it takes. TikTok: default 25, at most 30. Google: default 40, at most 200; past 40, a Run id to poll unless you pass `wait`.
- `cursor` string length at least 1 The `next_cursor` of the previous page, to read the next one with the same `library` and filters. Each page is charged.
- `order_by` string one of `relevance`, `impressions`, `winner`, `days_running`, `start_date` `relevance` (the default) keeps the library's order. `impressions` asks the Meta library for its own impressions order, highest first: the library's order changes and `next_cursor` follows it, and an `advertiser` search with it is always read live, never from stored Ads. On a keyword search the library's default order was already its impressions order when checked on 2026-11-15, so `impressions` may return the same order as `relevance`. `winner` sorts by winner Score, `days_running` by days run, `start_date` newest first: highest first, unknowns last; these sort the returned page, and `next_cursor` still follows the library's order. Meta only; the TikTok and Google libraries accept only `relevance`.
- `match` string one of `any_words`, `exact_phrase` Meta keyword search only: `any_words` (the default) matches Ads with the query's words in any order; `exact_phrase` matches the exact phrase. Refused with `advertiser` and on TikTok and Google.
- `language` string matches `^[A-Za-z]{2}$` Meta only: Ads in one content language, as an ISO 639-1 code such as `es`, filtered by the library; an `advertiser` search with it is always read live. Refused on TikTok and Google.
- `analyze` boolean Ad analysis on the first 50 Ads: 20 credits per Ad, computed or stored. Meta and Google; TikTok refuses it.
- `wait` number value 0 to 120 Default `30` Seconds to hold the response open before returning a running Run to poll. Default 30, max 120.
- `max_credits` integer value at least 0 As in the query.
- `estimate` boolean Meta: If a source the call would read is unavailable and the cache cannot answer, the estimate adds `unavailable` (the `{ platform, capability }` parts it cannot reach), or is a 503 `source_unavailable` when it can reach none. A TikTok library estimate quotes the price without checking.

## Responses

### 200 OK

The Run finished inside the wait budget: `{ run, result }`. With `estimate=true`, `{ estimate_credits, cached }` instead.

any of 2 shapes

- Option 1 object The envelope every charged operation answers with: `{ run }` while the Run is running (plus `poll_url` on the 202), joined by `result` once it completes or `error` once it fails.
  - `run` object required Every charged operation creates a Run; the envelope is the same inline or polled.
    - `id` string required
    - `kind` string required What was run, e.g. `video_lookup`.
    - `status` string required one of `running`, `completed`, `partial`, `failed` `partial` keeps the completed items and charges for them, up to what the Balance covers; `failed` charges nothing.
    - `created_at` string required RFC 3339.
    - `completed_at` string required nullable Null while the Run is still running.
    - `charge_credits` integer required What this Run actually cost, in Credits. A stored answer costs the same as a fresh one.
    - `list_price_credits` integer required The full price of the work asked for, in Credits. Equal to `charge_credits` unless the Run charged for only part of it.
    - `cached` boolean required True when a stored result answered without a fresh fetch.
    - `progress` object A running Research's `stage` and counts so far, such as `analysed` of `shortlisted`; a count is absent until known. Absent once the Run settles and on other kinds.
      - `stage` string required one of `keywords`, `searching`, `reading_creators`, `filtering`, `analysing`, `writing_digest`
      - `keywords` integer value at least 0
      - `creators` integer value at least 0
      - `creators_read` integer value at least 0
      - `searches` integer value at least 0
      - `found` integer value at least 0
      - `judged` integer value at least 0
      - `kept` integer value at least 0
      - `dropped_off_topic` integer value at least 0
      - `dropped_unsure` integer value at least 0
      - `shortlisted` integer value at least 0
      - `analysed` integer value at least 0
      - `updated_at` string required
  - `result` object required A page of a list. `items` holds the page; pass `next_cursor` back as `cursor` for the next one.
    - `next_cursor` string required nullable Pass back as `cursor`. Null on the last page.
    - `library` string required one of `meta`, `tiktok`, `google`
    - `items` array of object required
      - `library` string required one of `meta`, `tiktok`, `google`
      - `id` string required
      - `url` string required nullable
      - `advertiser` object required
        - `id` string required nullable
        - `name` string required nullable
        - `likes` integer nullable Deprecated: use `extras.meta.advertiser_likes`.
        - `categories` array of string nullable Deprecated: use `extras.meta.advertiser_categories`.
      - `partner` object nullable Deprecated: use `extras.meta.partner`.
      - `delivery` object required When and where the Ad ran, on every library. Its fields are on [Objects and schemas](https://www.shortsintel.com/docs/concepts/objects#ad-delivery).
      - `is_active` boolean required nullable Deprecated: use `delivery.is_active`.
      - `first_shown` string required nullable Deprecated: use `delivery.first_shown`.
      - `last_shown` string required nullable Deprecated: use `delivery.last_shown`.
      - `placements` array of string required Deprecated: use `delivery.placements`.
      - `creative` object required
        - `media_type` string required nullable one of `video`, `image`, `carousel`, `text` The library's label, on every library; Google text Ads stay `text`.
        - `versions` array of object required One per Meta card or Google variation, in order; else exactly one. Its fields are on [Objects and schemas](https://www.shortsintel.com/docs/concepts/objects#ad-versions).
        - `title` string required nullable Use `versions[].headline`.
        - `body` string required nullable Use `versions[].body`.
        - `cta` string required nullable Use `versions[].cta`.
        - `link_url` string required nullable Use `versions[].link_url`.
        - `format` string required nullable Use `creative.media_type`.
        - `image_urls` array of string required Use `versions[].media`.
        - `video_urls` array of string required Use `versions[].media`.
        - `thumbnail_urls` array of string required Use `versions[].media`.
        - `cta_type` string nullable Use `versions[].cta_type`.
        - `link_description` string nullable Use `versions[].description`.
        - `display_domain` string nullable Use `versions[].display_url`.
        - `cards` array of object nullable Use `versions` (card i is `versions[i]`).
          - `title` string required nullable
          - `body` string required nullable
          - `link_description` string required nullable
          - `cta` string required nullable
          - `cta_type` string required nullable
          - `link_url` string required nullable
          - `image_url` string required nullable
          - `video_url` string required nullable
          - `thumbnail_url` string required nullable
      - `reach` object required Deprecated: use `disclosure` (each string is a range's `raw`).
        - `impressions` string required nullable
        - `spend` string required nullable
        - `currency` string required nullable
        - `audience` string required nullable
      - `disclosure` object required Disclosed delivery volume as ranges. Meta: political spend and impressions, EU reach (`audience`). TikTok: `audience` bucket, lookup `impressions`. Google: impressions, political spend. Its fields are on [Objects and schemas](https://www.shortsintel.com/docs/concepts/objects#ad-disclosure).
      - `kind` string nullable one of `commercial`, `political`, `issue` Meta and Google.
      - `media_type` string nullable one of `video`, `image`, `carousel`, `text` Deprecated: use `creative.media_type`.
      - `countries` array of string nullable Deprecated: use `delivery.countries`.
      - `variant_count` number nullable Deprecated: use `extras.meta.variant_count`.
      - `variant_group_id` string nullable Deprecated: use `extras.meta.variant_group_id`.
      - `days_running` integer required nullable Deprecated: use `delivery.days_running`.
      - `ai_generated` boolean nullable Deprecated: use `extras.meta.ai_generated`.
      - `gated` boolean nullable Deprecated: use `extras.meta.gated`.
      - `variations` array of object Use `creative.versions` (variation i is `versions[i]`).
        - `headline` string required nullable
        - `description` string required nullable
        - `all_text` string required nullable
        - `destination_url` string required nullable
        - `visible_url` string required nullable
        - `image_urls` array of string required
        - `video_id` string required nullable
        - `youtube_url` string required nullable
      - `details_failed` boolean Deprecated: use `extras.google.details_failed`.
      - `archived` boolean True when every media URL is our permanent archived copy; false while any is still the library's expiring URL (retried on the next sighting).
      - `winner_score` object nullable Deprecated: use `extras.meta.winner_score`.
      - `intelligence` any of 2 shapes nullable Present when already computed for this Ad, or asked for with `analyze`; null under `analyze` when it could not be computed.
        - Option 1 object Video Ads: the full video analysis, read from the archived video with the ad copy as context, plus `offer`, `copy`, and detected shots, the product's first appearance and the opening frame under `structure`.
          - `version` integer required
          - `model` string required
          - `computed_at` string required
          - `source` string required
          - `content` object required
            - `summary` string required
            - `niche` string required
            - `languages` array of string required
            - `content_styles` array of string required
            - `keywords` array of object required
              - `keyword` string required
              - `category` string required
              - `sentiment` number required
            - `transcript` string required nullable What is said, one line per line: the Platform's captions or speech-to-text, never the scene breakdown. Empty with no speech; null when it could not be read.
            - `transcript_source` string required nullable one of `caption`, `auto_caption`, `whisper` `caption`: the Platform's captions. `auto_caption`: its automatic captions (YouTube, TikTok), also captions; wording approximate. `whisper`: speech-to-text. Null with a null `transcript` and on analyses before 2026-11-09.
            - `transcript_segments` array of object required nullable Timed lines (ms from the start), to see when the hook lands: the Platform's timed captions, else speech-to-text on the audio. Measured, unlike the approximate `structure.scenes`. Empty with no speech; null when not measured (a YouTube Video without captions, older analyses).
              - `start_ms` integer required
              - `end_ms` integer required
              - `text` string required
          - `hook` object required
            - `opening_line` string required nullable
            - `type` string required
            - `visual_hook` string required nullable
            - `rationale` string required nullable
          - `persuasion` object required
            - `call_to_action` object required
              - `type` string required
              - `text` string required nullable
            - `sponsored` boolean required Whether the video is plausibly a paid promotion. Always true when the Platform labels it an ad or a paid partnership.
            - `sponsorship_signals` array of string required
            - `brands_and_products` array of object required
              - `name` string required
              - `kind` string required
              - `prominence` string required
            - `trend_references` array of object required
              - `name` string required
              - `kind` string required
          - `tone` object required
            - `sentiment_label` string required
            - `sentiment_score` number required
            - `primary_emotion` string required
            - `emotion_intensity` number required nullable
            - `emotion_rationale` string required nullable
            - `speaking_style` string required
            - `speaking_style_notes` string required nullable
          - `visual` object required
            - `format` string required
            - `setting` string required
            - `face_visibility` string required
            - `on_screen_text` array of string required
            - `has_on_screen_captions` boolean required
            - `camera_notes` string required nullable
            - `lighting_notes` string required nullable
            - `elements` any
          - `safety` object required
            - `brand_safety_tier` string required
            - `reasons` array of string required
            - `notes` string required nullable
          - `structure` object required When things happen inside the creative: the timed scenes every analysis carries, plus the shots detected, when the product is first seen and the opening frame on a video Ad.
            - `scenes` array of object required Timed scenes from the scene breakdown, approximate to about a second. Empty when it has none, as on a photo carousel.
              - `start_ms` integer required Approximate scene start, ms from the start.
              - `end_ms` integer required Approximate scene end, ms from the start.
              - `visual` string required nullable
              - `text_overlay` string required nullable Text shown in this scene, at its first appearance only.
              - `speech` string required nullable
              - `audio` string required nullable Notable sound effects or music.
            - `slides` array of object required nullable
              - `slide` integer required
              - `visual` string required nullable
              - `text_overlay` string required nullable
            - `shots` array of object required nullable The detected shots in order, each from one cut to the next. A cut is a frame whose ffmpeg scene score is over 0.2. On 29 labelled Ads this found 86% of hard cuts within 500 ms (median error 67 ms) and 61% of jump cuts overall, but none on UGC Ads. Null when detection failed, and on analysis stored before shots.
              - `start_ms` integer required Shot start: the cut before it, or 0.
              - `end_ms` integer required Shot end: the next cut, or the video's end.
            - `cuts_per_minute` number required nullable Detected cuts per minute of video, to two decimals. Null whenever `shots` is.
            - `avg_shot_ms` integer required nullable The video's length over its number of shots, in ms. Null whenever `shots` is.
            - `product_first_seen_ms` integer required nullable When the promoted product first appears (the item, its packaging or logo, or an app's screen), as the start of that scene in ms, so approximate to one scene. On 26 labelled Ads that show one, it was within 3 s of the labelled time on 23 (88%). Null when no product is shown, and on analysis stored before it.
            - `first_frame` string required nullable What the video's opening frame shows, as text: a description, not a time. Read from the first scene's `**Opening Frame:**` line in the scene breakdown. Checked against the video on 10 Ads, it was accurate on all 10. Null when the breakdown has no opening frame, and on analysis stored before it.
          - `pipeline` string required always `video`
          - `offer` object required nullable The offer, in the same types as an image Ad's `offer`. Null when the extraction failed and on analysis stored before this field.
            - `type` string required
            - `text` string required nullable
          - `copy` object required nullable The persuasion angle, in the same values as an image Ad's `copy.angle`. Null when the extraction failed and on analysis stored before this field.
            - `angle` string required
            - `rationale` string required nullable
        - Option 2 object Image and carousel Ads: the analysis an image can carry, read from the archived images with the ad copy as context.
          - `pipeline` string required always `image`
          - `version` integer required
          - `model` string required
          - `computed_at` string required
          - `images_analyzed` integer required
          - `summary` string required
          - `copy` object required
            - `angle` string required
            - `rationale` string required nullable
            - `headline` string required nullable
          - `offer` object required
            - `type` string required
            - `text` string required nullable
          - `call_to_action` object required
            - `type` string required
            - `text` string required nullable
          - `visual` object required
            - `format` string required
            - `on_image_text` array of string required
          - `topics` array of string required
          - `tone` object required
            - `sentiment_label` string required
            - `sentiment_score` number required
      - `intelligence_error` object Why `analyze` left `intelligence` null: no analysis charge. Its fields are on [Errors](https://www.shortsintel.com/docs/reference/errors).
      - `advertiser_account` object nullable Deprecated: use `extras.tiktok.account`.
      - `targeting` object nullable Deprecated: use `audience` (same content). Its fields are on [Objects and schemas](https://www.shortsintel.com/docs/concepts/objects#ad-audience).
      - `audience` object required nullable Lookup only. TikTok: where and to whom the ad library says the Ad was delivered, impressions as ranges per country by age and gender; null when the Ad came from Creative Center. Meta: EU-delivered Ads only, reach (not impressions) per country by age and gender, with the targeted ages, genders and locations; null for an Ad not delivered in the EU, when the details could not be read, on search and on Google. Its fields are on [Objects and schemas](https://www.shortsintel.com/docs/concepts/objects#ad-audience).
      - `payer` string nullable Deprecated: use `extras.meta.payer`.
      - `beneficiary` string nullable Deprecated: use `extras.meta.beneficiary`.
      - `performance` object nullable Deprecated: use `extras.tiktok.performance`.
      - `objective` string nullable Deprecated: use `extras.tiktok.objective`.
      - `extras` object required Fields only one library fills, under the Ad's library key only; each matches the deprecated top-level field it copies. Its fields are on [Objects and schemas](https://www.shortsintel.com/docs/concepts/objects#ad-extras).
    - `total` number required nullable Meta: the library's count, capped (50,001 seen); for `kind: commercial` that count less the political and issue count. Null when either is capped or a filter Meta cannot apply ran after fetching (`kind` political or issue, `media_type` other than `video`, a start date). Elsewhere what the library reports; on Google an estimate, null with any filter.
    - `cached` boolean Meta `advertiser` searches only: true when the Ads were served from the advertiser's last complete observation (under 6 hours old) at the cached per-Ad price.
    - `as_of` string Meta `advertiser` searches only: when these Ads were observed in the library.
    - `incomplete` object Meta and Google, on a `partial` Run: the problem that stopped the read after some Ads were delivered. Google's `details_failed` counts the Ads marked `details_failed`.
      - `code` string required
      - `detail` string required
    - `intelligence` object Present only with `analyze: true`: Ads within the cap, how many were computed or reused (both charged) or failed (not charged). Per-Ad outcomes page at `GET /v1/runs/{id}/items`.
      - `requested` integer required
      - `computed` integer required
      - `reused` integer required
      - `failed` integer required
      - `cap` integer required
- Option 2 object Returned instead of a Run when `estimate=true`. Nothing is charged; some operations add members.
  - `estimate_credits` integer required What the call would be charged, in Credits.
  - `cached` boolean required Whether a stored result can already answer. It does not change the price.

### 202 Accepted

Still running: `{ run }`. Poll `GET /v1/runs/{id}`.

object

Still running. Poll `poll_url` (`GET /v1/runs/{id}`), waiting the 202's `Retry-After` seconds between polls.

- `run` object required Every charged operation creates a Run; the envelope is the same inline or polled. Its fields are on [Poll or re-read a run](https://www.shortsintel.com/docs/reference/runs/get-run#response-200).
- `poll_url` string required format `uri` Absolute URL of `GET /v1/runs/{id}`, the body's copy of the `Location` header (for MCP). Present only while `running`.

202 · Example

```json
{
  "run": {
    "id": "run_8f2c1ad04b",
    "kind": "ads_search",
    "status": "running",
    "created_at": "2026-09-08T09:14:02.418Z",
    "completed_at": null,
    "charge_credits": 0,
    "list_price_credits": 0,
    "cached": false
  },
  "poll_url": "https://www.shortsintel.com/v1/runs/run_8f2c1ad04b"
}
```

### 400 Bad Request

`invalid_request` (a malformed id, `wait`, `estimate` or Idempotency-Key) or `unsupported_platform`, refused before any Run opens. Nothing is charged.

Codes: `invalid_request`, `unsupported_platform`. The problem body and every code are on [Errors](https://www.shortsintel.com/docs/reference/errors).

### 401 Unauthorized

Codes: `missing_authorization`, `invalid_key`, `key_revoked`, `key_expired`, `invalid_token`. The problem body and every code are on [Errors](https://www.shortsintel.com/docs/reference/errors).

### 402 Payment Required

`insufficient_balance`: the Balance cannot cover the quoted price (the worst case for Research and enriched search). No Run opens and nothing is charged; a multi-item Run that runs short later charges its completed items up to the Balance and ends `partial`.

Code: `insufficient_balance`. The problem body and every code are on [Errors](https://www.shortsintel.com/docs/reference/errors).

### 409 Conflict

`idempotency_conflict` — the same Idempotency-Key with a different payload. Or: `advertiser_ambiguous`: several advertisers carry the name; `candidates` as described above. The Run fails uncharged.

Codes: `idempotency_conflict`, `advertiser_ambiguous`. The problem body and every code are on [Errors](https://www.shortsintel.com/docs/reference/errors).

### 429 Too Many Requests

`rate_limit_exceeded` or `concurrency_limit_exceeded`, with `Retry-After`.

Codes: `rate_limit_exceeded`, `concurrency_limit_exceeded`. The problem body and every code are on [Errors](https://www.shortsintel.com/docs/reference/errors).

### 502 Bad Gateway

A Run that opened and then failed answers `application/problem+json` with its problem's status (`vendor_error` here, `not_found` as 404) and the Run envelope, keeping the Run id. Never charged. The example is a Video lookup's.

Code: `vendor_error`. The problem body and every code are on [Errors](https://www.shortsintel.com/docs/reference/errors).

### 503 Service Unavailable

`source_unavailable`: every source this Run reads failed or is switched off. The Run fails uncharged, envelope alongside; `endpoints` names the source. Retry after `retry_after_seconds` (also `Retry-After`); it does not mean empty. The example is a Video lookup's.

Code: `source_unavailable`. The problem body and every code are on [Errors](https://www.shortsintel.com/docs/reference/errors).

## Related guides

This call creates a Run. With `wait` it holds the response open until the Run finishes or the wait runs out, then answers with the finished result or `202` and the running Run. Poll [`GET /v1/runs/{id}`](https://www.shortsintel.com/docs/reference/runs/get-run) until it settles; re-reading a Run is free.

- [Runs](https://www.shortsintel.com/docs/concepts/runs): How a call becomes a Run, waiting inline, polling and free re-reads.
- [Pricing and estimates](https://www.shortsintel.com/docs/concepts/pricing-and-estimates): Credits, estimates and why a cached result costs the same as a fresh one.
- [Ads](https://www.shortsintel.com/docs/concepts/ads): Search Meta's, TikTok's and Google's ad libraries: the filters, what each Ad carries, the winner Score, Ad analysis, what is stored, and what a search costs.

## Request samples

curl:

```bash
curl -X POST "https://www.shortsintel.com/v1/ads/search" \
  -H "Authorization: Bearer sk_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"library":"meta","query":"cold plunge","country":"US","status":"active","kind":"commercial","media_type":"video","placements":["facebook"],"started_after":"2026-01-01","started_before":"2026-02-01","limit":20,"order_by":"relevance","match":"any_words","language":"language","analyze":true}'
```

TypeScript:

```typescript
const response = await fetch(
  "https://www.shortsintel.com/v1/ads/search",
  {
    method: "POST",
    headers: {
      "Authorization": "Bearer sk_live_YOUR_KEY",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "library": "meta",
      "query": "cold plunge",
      "country": "US",
      "status": "active",
      "kind": "commercial",
      "media_type": "video",
      "placements": [
        "facebook"
      ],
      "started_after": "2026-01-01",
      "started_before": "2026-02-01",
      "limit": 20,
      "order_by": "relevance",
      "match": "any_words",
      "language": "language",
      "analyze": true
    }),
  },
);

if (!response.ok) {
  throw new Error(`ShortsIntel ${response.status}`);
}

const data = await response.json();
```

Python:

```python
import requests

response = requests.post(
    "https://www.shortsintel.com/v1/ads/search",
    headers={
        "Authorization": "Bearer sk_live_YOUR_KEY",
        "Content-Type": "application/json",
    },
    json={
        "library": "meta",
        "query": "cold plunge",
        "country": "US",
        "status": "active",
        "kind": "commercial",
        "media_type": "video",
        "placements": [
            "facebook",
        ],
        "started_after": "2026-01-01",
        "started_before": "2026-02-01",
        "limit": 20,
        "order_by": "relevance",
        "match": "any_words",
        "language": "language",
        "analyze": True,
    },
)
response.raise_for_status()

data = response.json()
```

200 · The Run finished inside the wait budget: `{ run, result }`. With `estimate=true`, `{ estimate_credits, cached }` instead.

```json
{
  "run": {
    "id": "run_8f2c1ad04b",
    "kind": "ads_search",
    "status": "completed",
    "created_at": "2026-09-08T09:14:02.418Z",
    "completed_at": "2026-09-08T09:14:04.930Z",
    "charge_credits": 2,
    "list_price_credits": 2,
    "cached": false
  },
  "result": {
    "library": "meta",
    "items": [
      {
        "library": "meta",
        "id": "1122334455667788",
        "url": "https://www.facebook.com/ads/library/?id=1122334455667788",
        "advertiser": {
          "id": "100064000000001",
          "name": "Plunge"
        },
        "is_active": true,
        "first_shown": "2026-08-01T00:00:00.000Z",
        "last_shown": null,
        "placements": [
          "FACEBOOK",
          "INSTAGRAM"
        ],
        "creative": {
          "title": "Cold water, on your schedule",
          "body": "The tub our testers refused to give back.",
          "cta": "Shop Now",
          "link_url": "https://plunge.example/tub",
          "format": "VIDEO",
          "image_urls": [],
          "video_urls": [
            "https://video.xx.fbcdn.net/ads/plunge-tub-hd.mp4"
          ],
          "thumbnail_urls": [],
          "versions": [
            {
              "headline": "Cold water, on your schedule",
              "body": "The tub our testers refused to give back.",
              "description": null,
              "cta": "Shop Now",
              "cta_type": null,
              "link_url": "https://plunge.example/tub",
              "display_url": null,
              "media": [
                {
                  "kind": "video",
                  "url": "https://video.xx.fbcdn.net/ads/plunge-tub-hd.mp4",
                  "thumbnail_url": null,
                  "archived": false,
                  "youtube_id": null
                }
              ]
            }
          ],
          "media_type": "video"
        },
        "reach": {
          "impressions": null,
          "spend": null,
          "currency": null,
          "audience": null
        },
        "kind": "commercial",
        "media_type": "video",
        "countries": null,
        "variant_count": 4,
        "variant_group_id": "596215693307098",
        "days_running": 72,
        "winner_score": {
          "score": 88,
          "confidence": "high",
          "inputs": {
            "days_running": 72,
            "variants_added": 2,
            "snapshots": 6,
            "advertiser_ads": 14
          },
          "reason": null
        },
        "delivery": {
          "first_shown": "2026-08-01T00:00:00.000Z",
          "last_shown": null,
          "is_active": true,
          "days_running": 72,
          "countries": null,
          "placements": [
            "FACEBOOK",
            "INSTAGRAM"
          ]
        },
        "disclosure": {
          "impressions": null,
          "spend": null,
          "currency": null,
          "audience": null
        },
        "audience": null,
        "extras": {
          "meta": {
            "partner": null,
            "advertiser_likes": null,
            "advertiser_categories": null,
            "variant_count": 4,
            "variant_group_id": "596215693307098",
            "ai_generated": null,
            "gated": null,
            "winner_score": {
              "score": 88,
              "confidence": "high",
              "inputs": {
                "days_running": 72,
                "variants_added": 2,
                "snapshots": 6,
                "advertiser_ads": 14
              },
              "reason": null
            },
            "payer": null,
            "beneficiary": null
          }
        }
      },
      {
        "library": "meta",
        "id": "2233445566778899",
        "url": "https://www.facebook.com/ads/library/?id=2233445566778899",
        "advertiser": {
          "id": "100064000000001",
          "name": "Plunge"
        },
        "is_active": false,
        "first_shown": "2026-06-02T00:00:00.000Z",
        "last_shown": "2026-07-14T00:00:00.000Z",
        "placements": [
          "INSTAGRAM"
        ],
        "creative": {
          "title": "Three minutes. Every morning.",
          "body": "Our coldest tub yet, now in matte black.",
          "cta": "Learn More",
          "link_url": "https://plunge.example/black",
          "format": "IMAGE",
          "image_urls": [
            "https://scontent.xx.fbcdn.net/ads/plunge-black.jpg"
          ],
          "video_urls": [],
          "thumbnail_urls": [],
          "versions": [
            {
              "headline": "Three minutes. Every morning.",
              "body": "Our coldest tub yet, now in matte black.",
              "description": null,
              "cta": "Learn More",
              "cta_type": null,
              "link_url": "https://plunge.example/black",
              "display_url": null,
              "media": [
                {
                  "kind": "image",
                  "url": "https://scontent.xx.fbcdn.net/ads/plunge-black.jpg",
                  "thumbnail_url": null,
                  "archived": false,
                  "youtube_id": null
                }
              ]
            }
          ],
          "media_type": "image"
        },
        "reach": {
          "impressions": null,
          "spend": null,
          "currency": null,
          "audience": null
        },
        "kind": "commercial",
        "media_type": "image",
        "countries": null,
        "variant_count": null,
        "days_running": 42,
        "winner_score": {
          "score": 54,
          "confidence": "low",
          "inputs": {
            "days_running": 42,
            "variants_added": 0,
            "snapshots": 1,
            "advertiser_ads": 14
          },
          "reason": "single_snapshot"
        },
        "delivery": {
          "first_shown": "2026-06-02T00:00:00.000Z",
          "last_shown": "2026-07-14T00:00:00.000Z",
          "is_active": false,
          "days_running": 42,
          "countries": null,
          "placements": [
            "INSTAGRAM"
          ]
        },
        "disclosure": {
          "impressions": null,
          "spend": null,
          "currency": null,
          "audience": null
        },
        "audience": null,
        "extras": {
          "meta": {
            "partner": null,
            "advertiser_likes": null,
            "advertiser_categories": null,
            "variant_count": null,
            "variant_group_id": null,
            "ai_generated": null,
            "gated": null,
            "winner_score": {
              "score": 54,
              "confidence": "low",
              "inputs": {
                "days_running": 42,
                "variants_added": 0,
                "snapshots": 1,
                "advertiser_ads": 14
              },
              "reason": "single_snapshot"
            },
            "payer": null,
            "beneficiary": null
          }
        }
      }
    ],
    "next_cursor": "eyJjIjoiQVpVWiIsIm8iOjB9",
    "total": null
  }
}
```

200 · With `estimate=true`: the price, no Run, no charge.

```json
{
  "estimate_credits": 2,
  "cached": false,
  "per_ad_credits": 1,
  "max_ads": 2,
  "priced_per": "ad_delivered"
}
```

[Next Look up a Meta Ad by id](https://www.shortsintel.com/docs/reference/ads/get-meta-ad)
