> ## Documentation Index
> Fetch the complete documentation index at: https://docs.querying.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Ad watch

> Watch an advertiser in an ad library every day, list the ads that are new and the ads that stopped, receive signed webhooks, and keep a copy of each creative.

An ad watch searches one advertiser or keyword in an ad library once a day and keeps what it finds. Each ad has a first-seen date, a last-seen date and a stop date, so you can answer "what did this competitor launch this week" and "which ads did it stop" from one API. The search is the [ADS](https://docs.querying.ai/engines/ad-libraries.md) search of the platform you choose, billed at the ordinary ADS price.

A watch records four things for every ad:

* **new**: the ad appeared after the baseline run.
* **stopped**: the ad ended, by the [rules below](#how-stopped-is-decided).
* **changed**: the title, text, button, link, format or media of a running ad changed.
* **restarted**: a stopped ad came back.

The creatives are copied into your account when an ad is first seen, so the images and videos stay available after the library's links expire.

## Quick start

**1. Create the watch**

The first run starts within about a minute. That run is the baseline: it records the ads that are running now and sends no events.

```bash theme={"theme":"css-variables"}
curl -X POST https://api.querying.ai/v1/ad-watches \
  -H "Authorization: Bearer $QUERYING_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Northwind on Meta",
    "platform": "meta_ad_library",
    "search": { "pageId": "123456789012345", "country": "US" },
    "maxAds": 200,
    "stopAfterRuns": 2,
    "webhookUrl": "https://hooks.example.com/querying/ad-watches"
  }'
```

The response is `201` with the stored watch. Keep `data.watch.id`.

**2. List the new ads**

From the second daily run on, ads that the library did not list before appear as new:

```bash theme={"theme":"css-variables"}
curl "https://api.querying.ai/v1/ad-watches/$WATCH_ID/ads?status=new&since=2026-11-16T00:00:00Z" \
  -H "Authorization: Bearer $QUERYING_API_KEY"
```

**3. List the stopped ads**

```bash theme={"theme":"css-variables"}
curl "https://api.querying.ai/v1/ad-watches/$WATCH_ID/ads?status=stopped&since=2026-11-16T00:00:00Z" \
  -H "Authorization: Bearer $QUERYING_API_KEY"
```

With `since`, `status=stopped` returns the ads that stopped at or after that time, newest stop first.

**4. Read the events**

```bash theme={"theme":"css-variables"}
curl "https://api.querying.ai/v1/ad-watches/$WATCH_ID/events?type=stopped&limit=20" \
  -H "Authorization: Bearer $QUERYING_API_KEY"
```

To run before the next daily run, call [`POST /v1/ad-watches/{id}/run`](#run-a-watch-now).

## Create a watch

`POST /v1/ad-watches` ([reference](https://docs.querying.ai/api-reference/ad-watches/create-ad-watch.md)) validates the definition, checks your account's limit, stores the watch and schedules the first run. Creating a watch costs nothing; each run is billed when it searches.

For example, the quick start request returns:

```json theme={"theme":"css-variables"}
{
  "success": true,
  "data": {
    "watch": {
      "id": "0192f0c5-7a3e-7b1a-9c1e-5d6f2a4b8c10",
      "name": "Northwind on Meta",
      "platform": "meta_ad_library",
      "search": { "pageId": "123456789012345", "country": "US" },
      "maxAds": 200,
      "intervalHours": 24,
      "stopAfterRuns": 2,
      "archiveMedia": true,
      "enabled": true,
      "disabledReason": null,
      "webhookUrl": "https://hooks.example.com/querying/ad-watches",
      "nextRunAt": "2026-11-23T09:01:10.000Z",
      "lastRunAt": null,
      "lastRunStatus": null,
      "runCount": 0,
      "activeAdCount": 0,
      "stoppedAdCount": 0,
      "estimatedCreditsPerRun": 3.5,
      "createdAt": "2026-11-23T09:00:12.000Z",
      "updatedAt": "2026-11-23T09:00:12.000Z"
    }
  }
}
```

### Request fields

| Field | Required | Description |
| - | - | - |
| `name` | yes | A label for the watch. |
| `platform` | yes | `meta_ad_library`, `google_ads_transparency`, `linkedin_ad_library` or `tiktok_ad_library`. Fixed for the life of the watch. |
| `search` | yes | The search to repeat: the ADS search fields of the platform, such as `pageId`, `pageIds`, `advertiserId`, `advertiserIds`, `domain`, `query`, `advertiserName`, `payer`, `country`, `mediaType`, `publisherPlatforms` and `startDate`, and `details: true` to read each ad's detail. Fixed for the life of the watch. The watch sets `action`, `limit` and `cursor` itself, and sets `activeStatus` to `active` on Meta and TikTok. |
| `maxAds` | no | The most ads one run reads. 1–1,000, default 200. |
| `intervalHours` | no | Hours between runs. `24` is the only value. |
| `stopAfterRuns` | no | Meta and LinkedIn: how many complete runs in a row must miss an ad before it counts as stopped. 1–10, default 2. |
| `archiveMedia` | no | `true` (default) copies each ad's images and videos. |
| `webhookUrl` | no | An HTTPS URL on a public host that receives [events](#events-and-webhooks), or `null`. Set it with an API key: events are signed with the key that sets it. |

The per-platform search fields, such as which ones a platform requires, are described on the [Meta](https://docs.querying.ai/engines/meta-ad-library.md), [Google](https://docs.querying.ai/engines/google-ads-transparency.md), [LinkedIn](https://docs.querying.ai/engines/linkedin-ad-library.md) and [TikTok](https://docs.querying.ai/engines/tiktok-ads.md) pages. `tiktok_creative_center` is a ranked sample of top ads and returns `400 VALIDATION_ERROR` as a watch platform; watch `tiktok_ad_library` for an advertiser's full set.

A watch's search, platform and interval stay fixed. To change the search, create a new watch and delete the old one.

## How a run works

Every 24 hours the watch runs its search with the largest page the platform allows and follows `nextCursor` until the library has no more ads or the run has read `maxAds` ads. Each run has a status:

| Status | Meaning |
| - | - |
| `COMPLETE` | The library listed every ad of the search. |
| `PARTIAL` | The run stopped at `maxAds` while the library listed more (`truncated: true`). Ads are recorded as seen. |
| `SUSPECT` | A complete run that would stop more than half of 10 or more active ads, or that returned nothing while ads were active. The run counts toward neither stops nor misses, and the next healthy run resumes. |
| `FAILED` | A search page failed after retries. |
| `RUNNING` | The run is in progress. |

Only `COMPLETE` runs can stop an ad on the disappearance rule. Five failed runs in a row disable the watch: `enabled` turns `false`, `disabledReason` names the cause and a `watch_paused` event is recorded. Re-enable it with `PATCH` once the cause is fixed.

Read the last 30 runs with [`GET /v1/ad-watches/{id}/runs`](https://docs.querying.ai/api-reference/ad-watches/list-ad-watch-runs). Each run has `runNumber`, `window`, `status`, `adsSeen`, `totalCount`, `truncated`, `newCount`, `stoppedCount`, `changedCount`, `startedAt`, `finishedAt` and `error`.

## How stopped is decided

| Platform | An ad is stopped when |
| - | - |
| `meta_ad_library` | It is missing from `stopAfterRuns` consecutive `COMPLETE` runs. The search lists running ads. |
| `linkedin_ad_library` | It is missing from `stopAfterRuns` consecutive `COMPLETE` runs. The library publishes no active flag. |
| `google_ads_transparency` | The library marks it inactive (`isActive: false`) or gives it an `endDate` in the past. The stop is recorded as soon as a run reads that flag. |
| `tiktok_ad_library` | The library marks it inactive or gives it an `endDate` in the past, as on Google. |

`FAILED`, `PARTIAL` and `SUSPECT` runs never stop an ad. An ad that is listed again after it stopped becomes `active` and records a `restarted` event.

## Read the ads

[`GET /v1/ad-watches/{id}/ads`](https://docs.querying.ai/api-reference/ad-watches/list-ad-watch-ads) lists a watch's ads.

| Parameter | Description |
| - | - |
| `status` | `new`, `active`, `stopped` or `all` (default). |
| `since` | An ISO 8601 time. With `new`, ads first seen at or after it (default: the last 7 days). With `stopped`, ads stopped at or after it. |
| `format` | Only ads of this format, as in the ad's `format` field, such as `IMAGE` or `VIDEO`. |
| `limit` | 1–200, default 50. |
| `cursor` | The previous page's `nextCursor`. |

`new` lists ads that were first seen after the baseline run, so the first run's ads are in `active` with `baseline: true`. `new` and `active` are ordered by `firstSeenAt`, newest first; `stopped` by `stoppedAt`, newest first.

Each ad has:

| Field | Meaning |
| - | - |
| `adKey`, `libraryId` | The ad's id in the library. Open one ad with [`GET /v1/ad-watches/{id}/ads/{adKey}`](https://docs.querying.ai/api-reference/ad-watches/get-ad-watch-ad). |
| `platform`, `advertiserId`, `advertiserName`, `format` | Who runs it and in which format. |
| `status`, `baseline` | `active` or `stopped`, and whether the first run recorded it. |
| `firstSeenAt`, `lastSeenAt`, `stoppedAt` | When the watch first saw it, last saw it, and recorded its stop (`null` while active). |
| `startDate`, `endDate` | The library's own dates, when it publishes them. |
| `ad` | The ADS search ad as it stood when its content last changed, with the fields of the platform's [search response](https://docs.querying.ai/engines/ad-libraries.md). |
| `media` | The creatives, see [Archived creatives](#archived-creatives). |

## Events and webhooks

Every change is stored as an event. List them with [`GET /v1/ad-watches/{id}/events`](https://docs.querying.ai/api-reference/ad-watches/list-ad-watch-events), newest first, filtered by `type` and `since`, with `limit` and `cursor`.

| Event type | Recorded when | `data` |
| - | - | - |
| `new` | An ad appears after the baseline run. | `libraryId`, `advertiserName`, `format`, `startDate` |
| `stopped` | An ad stops. | `reason` (`not_seen` or `library_inactive`), `lastSeenAt` |
| `changed` | A running ad's content hash differs: title, text, button, link, format or media paths. | `fields` (the changed field names), and `before` and `after` for the text fields `title`, `body`, `ctaText`, `linkUrl` and `format` |
| `restarted` | A stopped ad is listed again. | `stoppedAt` |
| `watch_paused` | Five runs in a row failed and the watch was disabled. | `reason` |

Each event has `id`, `type`, `adKey`, `data`, `createdAt` and `webhook` with `deliveredAt`, `attempts` and `error`.

With a `webhookUrl`, every event is also sent as a `POST`:

```json theme={"theme":"css-variables"}
{
  "id": "0192f1e2-33b0-7c4e-8a52-1f9c3b7d4e55",
  "type": "ad_watch.stopped",
  "watchId": "0192f0c5-7a3e-7b1a-9c1e-5d6f2a4b8c10",
  "watchName": "Northwind on Meta",
  "adKey": "1184920375529104",
  "createdAt": "2026-11-26T09:02:41.000Z",
  "data": { "reason": "not_seen", "lastSeenAt": "2026-11-24T09:01:58.000Z" }
}
```

Deliveries are signed and retried like [monitor events](https://docs.querying.ai/monitors/events-and-alerts.md#signature-and-retries): the same `querying-webhook-*` headers, HMAC-SHA256 scheme and retry schedule, with `querying-webhook-id` set to the event `id` for deduplication, and the SHA-256 digest of the API key that set `webhookUrl` as the HMAC key. Verify them with the code in [Webhooks](https://docs.querying.ai/concepts/webhooks.md#verify-the-signature).

## Archived creatives

With `archiveMedia: true`, the watch copies an ad's images, videos and video posters when it first sees the ad, and again when a changed ad carries new media. Library links expire after a few hours on TikTok and a few days on Meta, so the copy is the durable version.

Each entry of an ad's `media` array has:

| Field | Meaning |
| - | - |
| `id` | The media id. |
| `kind` | `image`, `video` or `poster` (a video's preview image). |
| `status` | `pending` (queued), `archived`, `failed` or `skipped`. |
| `reason` | Why a file is `failed` or `skipped`, such as `too_large` or `quota`; `null` otherwise. |
| `archivedUrl` | The address that serves the file once `status` is `archived`. |
| `contentType`, `bytes` | The stored file's type and size. |

Download an archived file with your API key. The response carries the stored `Content-Type`, an `ETag` equal to the file's SHA-256, and a private cache header:

```bash theme={"theme":"css-variables"}
curl -L "https://api.querying.ai/v1/ad-watches/$WATCH_ID/media/$MEDIA_ID" \
  -H "Authorization: Bearer $QUERYING_API_KEY" \
  -o creative.mp4
```

A file that is not archived returns `404 NOT_FOUND`. Archiving is free, with these caps per file and per account:

| Cap | Value |
| - | - |
| Image | 10 MB |
| Video | 40 MB |
| Storage per account | 2 GB |

A file over its cap or over the account's storage is marked `skipped` with a `reason`. The ad and its run are recorded in full. A file that its source refuses to serve is marked `failed` with a `reason`. Deleting a watch removes its archived files within minutes.

## What each library keeps

A watch sees what its library lists, so the library's retention sets how far back the first run reaches. After that, the watch holds the history for as long as it runs.

| Platform | What the library lists | What the watch adds |
| - | - | - |
| `meta_ad_library` | Running ads. | Stop dates the library does not publish for ads outside the EU and UK, and every creative. |
| `google_ads_transparency` | Ads shown in the last 12 months, with the last day each was shown. | Change history and creative copies. |
| `linkedin_ad_library` | Ads of the last 12 months, with no active flag. | Stop dates and creative copies. |
| `tiktok_ad_library` | Ads of the last 13 months in 34 European regions and Brazil. | Change history and creative copies, before TikTok's links expire. |

The countries and EU-only fields of each library are compared in [Ad libraries compared](https://docs.querying.ai/engines/ad-libraries.md).

## Manage watches

| Method and path | What it does |
| - | - |
| [`GET /v1/ad-watches`](https://docs.querying.ai/api-reference/ad-watches/list-ad-watches) | Your watches, newest first, with `limit` and `cursor`. |
| [`GET /v1/ad-watches/{id}`](https://docs.querying.ai/api-reference/ad-watches/get-ad-watch) | One watch, with its `lastRun` summary. |
| [`PATCH /v1/ad-watches/{id}`](https://docs.querying.ai/api-reference/ad-watches/update-ad-watch) | Update `name`, `enabled`, `maxAds`, `stopAfterRuns`, `archiveMedia` and `webhookUrl` (`null` turns events off). |
| [`DELETE /v1/ad-watches/{id}`](https://docs.querying.ai/api-reference/ad-watches/delete-ad-watch) | Delete the watch and its ads, events, runs and archived files. Returns `data.deleted: true`. |
| [`POST /v1/ad-watches/{id}/run`](https://docs.querying.ai/api-reference/ad-watches/run-ad-watch) | Bring the next run forward. |

A watch that belongs to another account returns `404 NOT_FOUND`.

### Run a watch now

`POST /v1/ad-watches/{id}/run` makes the next run due immediately; it starts within about a minute and returns `data.queued: true`. The run is billed like a daily run. Each watch accepts one manual run per hour; another returns `429 RATE_LIMITED` with `details.retryAfterSec`. When your balance is below the run's price, the call returns `402 INSUFFICIENT_CREDITS` with `details.needed` and `details.available`.

## Cost and limits

A run costs the ordinary ADS search price: **0.5 credits for every 30 ads the run returns**, charged to the watch's account when the run searches. The watch's `estimatedCreditsPerRun` is the upper bound for `maxAds`:

```text theme={"theme":"css-variables"}
credits per run  = ceil(maxAds / 30) × 0.5
credits / month  ≈ credits per run × 30
```

| `maxAds` | Credits per run | Credits per month |
| - | - | - |
| 100 | 2 | 60 |
| 200 | 3.5 | 105 |
| 1,000 | 17 | 510 |

With `details: true`, each page also costs 0.5 credits for every 5 ads read in detail, and `estimatedCreditsPerRun` includes it: a run of 100 Google ads costs 12 credits, 2 for the ads and 10 for the details. Pages are smaller with details (Google 100, LinkedIn 50, TikTok 60 ads) and the run reads more of them, so any `maxAds` up to 1,000 works. Meta does not take `details`: `search.details` is rejected with `400 VALIDATION_ERROR`.

Archiving, reading ads, events and runs, and downloading files cost nothing. A run that your balance cannot pay for fails on its own and records no stops. The daily schedule repeats until you pause or delete the watch.

| Limit | Standard | Contract |
| - | - | - |
| Watches per account | 5 | 200 |
| Ads per run (`maxAds`) | 1,000 | 1,000 |
| Runs | 1 per 24 hours | 1 per 24 hours |
| Manual runs | 1 per hour per watch | 1 per hour per watch |

A contract account is one with a negotiated concurrency limit.

## Errors

The error envelope is the same as everywhere else (see [Errors](https://docs.querying.ai/concepts/errors.md)). Codes specific to ad watches:

| Status | Code | When |
| - | - | - |
| 400 | `VALIDATION_ERROR` | An invalid definition (unknown platform, `tiktok_creative_center`, a search the platform rejects, `maxAds` or `stopAfterRuns` out of range, `intervalHours` other than 24, a change to `search` or `platform`), `webhookUrl` set without an API key, or invalid query parameters. `details` names the field. |
| 401 | `MISSING_API_KEY`, `UNAUTHORIZED` | No key, or an invalid or revoked key. |
| 402 | `INSUFFICIENT_CREDITS` | `POST /run` when your balance does not cover the run. |
| 403 | `KEY_SCOPE_DENIED` | The key's allowed engines do not include ADS. |
| 404 | `NOT_FOUND` | No such watch, ad, event or archived file for this account. |
| 409 | `AD_WATCH_LIMIT` | The account already holds the maximum number of watches. |
| 429 | `RATE_LIMITED` | A second manual run within an hour. |

## Next steps

> [card] [Ad libraries compared](https://docs.querying.ai/engines/ad-libraries.md)
>
> Countries, retention and EU-only fields of each library.

> [card] [Webhooks](https://docs.querying.ai/concepts/webhooks.md)
>
> Signing, retries and safe handlers.

> [card] [Credits and limits](https://docs.querying.ai/concepts/credits-and-limits.md)
>
> How credits are held and charged.

> [card] [Meta Ad Library](https://docs.querying.ai/engines/meta-ad-library.md)
>
> The search fields a Meta watch repeats.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.