# Google & YouTube Ads Scraper and Media Archive — Beta (`magenta_courser/google-youtube-ads-scraper`) Actor

Enter an advertiser website or ID to get Google and YouTube ads, stored media and observed changes. 10-day beta: no Actor fee; Apify usage applies.

- **URL**: https://apify.com/magenta_courser/google-youtube-ads-scraper.md
- **Developed by:** [SUNGHWAN CHO](https://apify.com/magenta_courser) (community)
- **Categories:** Social media, Marketing
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Google & YouTube Ads Scraper and Media Archive

Enter an advertiser website, advertiser name, Google advertiser ID, or a single creative URL to get Google Ads Transparency Center ads, available creative media, stored media links, and changes in previously observed ad IDs.

Google Search and YouTube ads are collected from the same Ads Transparency Center source. Use the platform filter to select YouTube, Search, Shopping, Maps or Play. Video format alone does not establish that an ad ran on YouTube. YouTube sponsorships and paid product placements are a different dataset and are outside this Actor's scope.

### 10-day beta test discount: pay only Apify usage

**November 25–December 4, 2026, inclusive (Asia/Seoul / KST). Actor fee: $0.** This beta uses **Pay per usage**: there is no developer fee per ad or run. Users pay Apify for actual compute, residential proxy traffic, data transfer and storage. Failed or partial runs can still consume paid resources. This is a usage-only offer, not a promise of free infrastructure.

Media records are stored in the executing account's named storage. Storage and later reads can incur continuing usage costs. No automatic price increase is scheduled for the end of the beta; any future pricing change must follow Apify's notice rules. No former price or percentage discount is claimed.

**Found an error? Please report it in a [review](https://apify.com/magenta_courser/google-youtube-ads-scraper/reviews).** Include the run ID, the input filters with sensitive information removed, and the expected versus actual result. The [Issues tab](https://apify.com/magenta_courser/google-youtube-ads-scraper/issues) is also available for troubleshooting. Do not include API tokens, proxy passwords, or account cookies.

### Start with one ad

Provide **exactly one** of `query`, `advertiserId`, or `adUrl`. The Console starts with a small example; remove `query` before entering one of the other two options.

```json
{
  "query": "nike.com",
  "country": "US",
  "adFormat": "video",
  "maxAds": 1,
  "maxCreativeVariants": 1,
  "pageSize": 1,
  "maxRequests": 24,
  "maxFileSizeMb": 10,
  "maxTotalMediaMb": 30
}
```

To select YouTube ads, add `"platform": "youtube"`. `query` searches advertiser names or websites; it is not a search of all words inside ad copy. A website URL is normalized to its hostname. A broad advertiser name can match more than one business, so inspect the returned advertiser identity.

Use an `AR` ID copied from an advertiser's Transparency Center URL for a specific account. `adUrl` accepts only a single creative page in this shape:

```text
https://adstransparency.google.com/advertiser/AR.../creative/CR...
```

The dots above are placeholders. Paste a real URL containing the full numeric IDs. **Single-ad lookup requires `country: "ALL"`, `platform: "all"`, and empty `dateFrom`/`dateTo`.** Change the Console's `US` country prefill to `ALL` when switching to `adUrl`. Other country, platform or date values are rejected because this detail endpoint cannot apply those search filters. URL query parameters are not imported. `adFormat` can still exclude a creative whose format does not match.

### Input reference

Defaults below are runtime defaults when an input is omitted. The Console prefill intentionally uses smaller limits for a first run.

| Input | Default | Meaning |
|---|---|---|
| `query` | — | Advertiser website or name, up to 500 characters. Use exactly one target input. |
| `advertiserId` | — | Google advertiser ID beginning with `AR`. Keep IDs as strings. |
| `adUrl` | — | HTTPS Ads Transparency Center URL for a single creative. Requires country `ALL`, platform `all`, and no date bounds. |
| `country` | `ALL` | Country where ads were shown, such as `US`, `KR`, `GB` or `DE`; not the advertiser's country. |
| `platform` | `all` | `all`, `google_search`, `youtube`, `google_play`, `google_maps`, or `google_shopping`. |
| `adFormat` | `all` | `all`, `text`, `image`, or `video`. |
| `dateFrom`, `dateTo` | — | Optional `YYYY-MM-DD` bounds for when ads were shown. These are not campaign creation or termination dates. |
| `maxAds` | `30` | Maximum unique ad results, 1–1,000. |
| `maxAdvertisers` | `5` | Maximum matching advertiser accounts followed for a name query, 1–20. |
| `maxCreativeVariants` | `3` | Maximum decoded creative variations per ad, 1–20. The first-run example uses 1. |
| `includeDetails` | `true` | Fetch available creative details and variations. Missing source values stay `null`. |
| `archiveMedia` | `true` | Download supported image and direct video files into named storage. |
| `includeYouTubeDetails` | `true` | Read available public video/channel details when a creative has a YouTube video ID. |
| `includeOcr` | `true` | Read one preview image for a text-format ad when structured copy is missing; returns separately labelled OCR text. |
| `ocrLanguage` | `eng` | `eng` or `kor+eng`. Other OCR languages are not bundled. |
| `trackChanges` | `true` | Compare observed ad IDs with the saved history for the same search scope. |
| `historyNamespace` | `default` | Separate independent monitoring histories; 1–64 letters, digits, underscores or hyphens. |
| `maxFileSizeMb` | `20` | Maximum media file size in MiB, 1–50. |
| `maxTotalMediaMb` | `100` | Shared downloaded-media budget in MiB, 1–1,000. Failed transfers also consume received bytes. |
| `maxRequests` | `200` | Shared HTTP request cap, 2–3,000, including details, media and YouTube requests. |
| `maxRunSeconds` | `240` | Budget for starting source requests, 30–480 seconds. Set the Actor timeout at least 60 seconds higher. |
| `pageSize` | `20` | Requested ads per source page, 1–100. |
| `requestDelayMs` | `1500` | Minimum request start interval, 1,000–10,000ms. |
| `proxyConfiguration` | US residential Apify proxy | Defaults to `{"useApifyProxy":true,"apifyProxyGroups":["RESIDENTIAL"],"apifyProxyCountry":"US"}`. Must be available to the executing account. |

Google excludes ads shown before September 4, 2023 when a platform filter is selected. Availability and detail differ by country and creative. Request and byte limits control work performed; they do not guarantee a fixed dollar cost. [Google platform filter notice](https://adstransparency.google.com/?platform=SEARCH\&region=US)

### Output and media storage

The default dataset contains one row per observed creative, identified by `ad_id` (`CR...`) and `advertiser_id` (`AR...`). Rows include available advertiser/creative details, Google first/last-shown dates, media in `snapshot.images`, `snapshot.videos` and `snapshot.cards`, YouTube details when available, and observed-ID comparison fields. IDs remain strings and missing values remain `null`.

Creative fields include `ad_format`, `title`, `body.text`, `cta_text`, `link_url` and `caption` when the source exposes them. Timing fields are `first_shown`, `last_shown` and `days_shown`. `publisher_platform` contains only source-reported platforms; the selected input filter is not substituted for missing output data. `creative_variant_count`, `creative_variants_processed` and `creative_variants_complete` show whether the variant limit left any variations unprocessed. The Actor does not promise every HD/SD rendition of every video.

When `archiveMedia` is enabled, `media_assets` records each attempted image or video with:

- `field_path` and `source_url` to identify its original creative field;
- `stored_url` and content-addressed `storage_key` when saved;
- `status`, `bytes`, `content_type`, and `error` for failures or skipped files.

Only successful cloud storage produces a public `stored_url`. The key includes the file's SHA-256 and allows identical files to be reused. Links do not use an expiring source CDN token, but remain valid only while their records, storage and account are retained. Deletion or account closure can remove access; this is not an unconditional lifetime hosting promise.

`video_archive_status` distinguishes a stored video from an unavailable direct file. A preview image, HTML preview, YouTube watch link and video file are different assets. This Actor archives supported image/video bytes, not arbitrary HTML pages. When no downloadable video file is exposed, it preserves the available source link and reports that limitation. It does not label a watch link or thumbnail as a stored video. Direct video URLs may be unavailable even when a YouTube page can be viewed normally.

### Screenshot-only text ads

Some Google Search ads are supplied as images, with no structured headline, body or destination URL. The Actor can read one preview with local Tesseract OCR. `creative_text` contains the recognized words and `creative_text_source: "ocr"` identifies that method. Directly provided creative text uses `source_fields`. OCR does not fill guessed `title`, `body.text` or `link_url` values.

`ocr_status` and `ocr_confidence` describe recognition. Confidence is the OCR engine score, not a measured accuracy percentage; low-confidence or unreadable results remain unavailable. English is the default; choose `kor+eng` for Korean. Recognition is limited to one PNG, JPEG or static WebP image, 5 million pixels and 15 seconds per ad. The image is reused from storage when already archived; otherwise its download uses the same request and byte budgets. OCR runs inside the Actor and uses no paid vision API.

### What changes mean

The first successful observation establishes a **baseline**. Later observations can mark a previously unseen retained ID as `new`, or a known ID as `unchanged`. Here, `unchanged` means that the same ad ID was observed again; it does not certify unchanged creative text, reach, subscriber count or delivery status.

The history scope includes the target, country, platform, format, explicit date bounds and namespace. Changing result or page limits does not establish a new scope. Failed observations must not erase the prior baseline; inspect the history status in `RUN_SUMMARY`.

**Google's last-shown date does not prove that an ad is now switched off.** This version does not infer current `is_active` from that date. Without a verified activity signal, `is_active` and `turned_off` remain `null`. Ads missing from the current bounded result set are reported as missing observations, not deactivated ads. The API rejects an `activeStatus` other than `all`; use date filters instead.

### YouTube channel information

When a creative exposes a YouTube video ID, the optional public watch-page lookup can return `youtube_video_id`, `youtube_url`, `youtube_channel_id`, `youtube_channel_name`, and a displayed `youtube_subscribers` count. `youtube_subscribers_raw` preserves the source text, while `youtube_subscribers_is_approximate` indicates a parsed abbreviated display such as “1.2M subscribers.”

Counts and channel details can be absent or unavailable. They stay `null` rather than becoming zero. The channel is taken from the video response, not guessed from the advertiser's name. A video may belong to an agency or another channel. `youtube_details_status` and `youtube_video_download_status` describe the lookup and direct-file availability separately. Instagram followers are not supplied by this Google source.

### Coverage and operating limits

Only one retry per run is allowed for a recognized transient RPC connection failure before any response or bytes arrive. It waits two seconds and can replace the anonymous proxy session while retaining the same request/time budgets. Media downloads, certificate failures, access denials, CAPTCHA and rate limits are not retried by this path. A successful ordinary run is not evidence of live recovery after blocking.

Read `RUN_SUMMARY` in the default key-value store for the stop reason, returned rows, source status, media results and history comparison. Reaching `maxAds`, a page limit, a request limit or a time limit is not evidence of complete advertiser coverage. Some details and regional reach data are only exposed for eligible locations. Ad spend, conversion results and private campaign settings are not returned.

This is an independent tool, not affiliated with Google or YouTube. It reads public, logged-out pages/endpoints and does not call another paid scraper. It does not require account cookies. Availability can change when Google changes its public responses or limits requests. No long-term success rate or live block-recovery result is claimed by this beta.

### 한국어 안내

광고주 **웹사이트·이름·AR ID·개별 광고 URL 중 하나**를 넣으면 Google Ads Transparency Center의 광고 소재와 가능한 이미지·영상 파일, 이전 실행에서 관측한 광고 ID의 변화를 반환합니다. 광고주 검색에서 유튜브 광고는 `platform: "youtube"`로 선택합니다. 개별 광고 URL(`adUrl`) 조회는 국가 `ALL`·플랫폼 `all`·날짜 조건 없음으로 설정해야 합니다. Console의 기본 예시 국가 `US`도 `ALL`로 바꾸세요. 협찬 영상·PPL 목록 수집은 별도입니다.

**10일 베타 테스트 할인가: 11월 25일~12월 4일(KST).** **액터 이용료는 $0이고, 사용자가 Apify에 실제 실행·프록시·전송·저장 사용료를 직접 냅니다.** 베타 기간 개발자가 받는 추가 요금은 없습니다. 베타 종료 후 자동 인상은 예약하지 않았습니다. 소량 수집은 검증했지만 장기 안정성과 실제 차단 후 복구 성공은 아직 보장하지 않습니다.

구글 검색 광고가 이미지로만 제공되면 로컬 OCR로 문구를 읽어 `creative_text`에 넣고 출처를 `ocr`로 표시합니다. 원본의 제목·본문·링크를 임의로 만들어 채우지는 않습니다. 한국어는 `ocrLanguage: "kor+eng"`를 선택하세요.

처음에는 광고 1건으로 실행하세요. 이미지·영상은 실제 파일을 저장한 경우에만 보관 URL을 반환합니다. 저장소·레코드·계정이 유지되는 동안 사용할 수 있고 보관·읽기 비용은 계속 발생할 수 있습니다. 광고 하나의 여러 소재는 `maxCreativeVariants` 한도까지 처리하며, 처리하지 못한 변형이 있으면 완료 여부에 표시합니다. 마지막 게재일이 오래됐거나 이번 결과에서 빠졌다는 이유로 “광고 종료”라고 표시하지 않습니다. 현재 활동 상태를 확인할 수 없으면 `null`입니다. 유튜브 구독자 수는 공개 영상에서 채널을 확인한 경우에만 가능한 표시값을 가져오며, 반올림된 값이거나 조회되지 않을 수 있습니다.

**오류가 발생하면 [리뷰로 제보해주세요](https://apify.com/magenta_courser/google-youtube-ads-scraper/reviews).** 실행ID, 민감한 정보를 지운 입력 조건, 예상 결과와 실제 오류를 적어주세요. [Issues](https://apify.com/magenta_courser/google-youtube-ads-scraper/issues)에서도 문의할 수 있습니다.

# Actor input Schema

## `query` (type: `string`):

Provide exactly one of query, advertiserId or adUrl. Searches advertiser names or websites, not all words inside ad copy. Website URLs are normalized to their hostname.

## `advertiserId` (type: `string`):

An AR-prefixed advertiser ID from Google Ads Transparency Center. Use this instead of query or adUrl.

## `adUrl` (type: `string`):

A full HTTPS URL such as https://adstransparency.google.com/advertiser/AR.../creative/CR.... Use this instead of query or advertiserId. For this single-ad lookup, set country to ALL, platform to all, and leave dateFrom/dateTo empty; other values are rejected. URL query parameters are not imported as filters. adFormat may still filter the returned creative.

## `country` (type: `string`):

Two-letter country code such as US, KR, GB or DE, or ALL. This is a serving-country filter, not the advertiser's registered country.

## `platform` (type: `string`):

YouTube and other Google ads come from the same Ads Transparency Center source. Google excludes ads shown before September 4, 2023 when a platform filter is selected.

## `adFormat` (type: `string`):

Google's ad creative format. Video format alone does not prove that an ad ran on YouTube; use the YouTube platform filter when needed.

## `dateFrom` (type: `string`):

Optional YYYY-MM-DD lower bound for when ads were shown. This is not an ad creation date or a current-active filter.

## `dateTo` (type: `string`):

Optional YYYY-MM-DD upper bound for when ads were shown. Must not be earlier than dateFrom.

## `maxAds` (type: `integer`):

Maximum unique ad results per run. A bounded result set does not prove that every matching ad was collected.

## `maxAdvertisers` (type: `integer`):

Maximum matching advertiser accounts to follow for an advertiser-name search. A bounded selection may omit other businesses with the same or a similar name.

## `maxCreativeVariants` (type: `integer`):

Limit decoded creative variations per ad. Compare creative_variant_count, creative_variants_processed and creative_variants_complete to see whether variants were left out. More variants can add media and requests.

## `includeDetails` (type: `boolean`):

Fetch available creative details and variations. Fields absent from Google's response remain null. Additional requests count toward the run limits.

## `archiveMedia` (type: `boolean`):

Download available image and direct video files into an Actor-specific named storage. Record URLs remain valid while the records and account are retained. Storage and later access can incur ongoing usage costs. A YouTube watch link is not a stored video file.

## `includeYouTubeDetails` (type: `boolean`):

When a creative contains a YouTube video ID, read its public watch page for the actual channel and displayed subscriber count. Counts can be rounded, unavailable or blocked; missing values stay null. This does not map every advertiser to a channel.

## `trackChanges` (type: `boolean`):

Remember previously observed ad IDs for the same filters and namespace. First observation is a baseline. Missing ads and old last-shown dates never establish that an ad has turned off.

## `historyNamespace` (type: `string`):

Use a different name for independent monitoring histories. Keep the same filters and namespace to compare repeated runs.

## `maxFileSizeMb` (type: `integer`):

Maximum bytes accepted for one media file, in MiB. Oversized or unsupported files are reported in the media manifest.

## `maxTotalMediaMb` (type: `integer`):

Shared media download budget across all results. Failed transfers can consume the budget; skipped assets remain visible.

## `maxRequests` (type: `integer`):

Shared cap covering source searches, details, creative decoding, YouTube details and media downloads. This is a request limit, not a guaranteed dollar spending limit.

## `maxRunSeconds` (type: `integer`):

Stop starting source requests after this many seconds. Set the Actor timeout at least 60 seconds higher to allow output and history to finish.

## `pageSize` (type: `integer`):

Requested source page size. This affects pagination and does not create a separate monitoring history.

## `requestDelayMs` (type: `integer`):

Minimum spacing between HTTP requests. Keep a small result limit while validating a new advertiser or filter.

## `proxyConfiguration` (type: `object`):

US Apify residential proxy by default. The selected proxy must be available to your account. Proxy traffic incurs usage costs.

## `includeOcr` (type: `boolean`):

When a text-format ad has no structured copy, read one preview image with local OCR. Returns separately labelled creative_text; does not invent title, body or destination fields. Uses additional compute, at most 15 seconds per image.

## `ocrLanguage` (type: `string`):

Language models for screenshot-only text ads. OCR can misread text; inspect the source image and ocr_status. Other languages are not supported by this OCR configuration.

## Actor input object example

```json
{
  "query": "nike.com",
  "country": "US",
  "platform": "all",
  "adFormat": "video",
  "maxAds": 1,
  "maxAdvertisers": 5,
  "maxCreativeVariants": 1,
  "includeDetails": true,
  "archiveMedia": true,
  "includeYouTubeDetails": true,
  "trackChanges": true,
  "historyNamespace": "default",
  "maxFileSizeMb": 10,
  "maxTotalMediaMb": 30,
  "maxRequests": 24,
  "maxRunSeconds": 240,
  "pageSize": 1,
  "requestDelayMs": 1500,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  },
  "includeOcr": true,
  "ocrLanguage": "eng"
}
```

# Actor output Schema

## `ads` (type: `string`):

No description

## `runSummary` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "query": "nike.com",
    "country": "US",
    "adFormat": "video",
    "maxAds": 1,
    "maxCreativeVariants": 1,
    "maxFileSizeMb": 10,
    "maxTotalMediaMb": 30,
    "maxRequests": 24,
    "pageSize": 1
};

// Run the Actor and wait for it to finish
const run = await client.actor("magenta_courser/google-youtube-ads-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "query": "nike.com",
    "country": "US",
    "adFormat": "video",
    "maxAds": 1,
    "maxCreativeVariants": 1,
    "maxFileSizeMb": 10,
    "maxTotalMediaMb": 30,
    "maxRequests": 24,
    "pageSize": 1,
}

# Run the Actor and wait for it to finish
run = client.actor("magenta_courser/google-youtube-ads-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "query": "nike.com",
  "country": "US",
  "adFormat": "video",
  "maxAds": 1,
  "maxCreativeVariants": 1,
  "maxFileSizeMb": 10,
  "maxTotalMediaMb": 30,
  "maxRequests": 24,
  "pageSize": 1
}' |
apify call magenta_courser/google-youtube-ads-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,magenta_courser/google-youtube-ads-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/TaAmILeT9zrnuJBQm/builds/2wiCMvqZEZc99yM2O/openapi.json
