# Competitor Ads Spy – Meta & Google Ads (`badr_xba/competitor-ads-spy`) Actor

Type a brand or website domain and get its ads from the Meta Ad Library (Facebook, Instagram) and the Google Ads Transparency Center in one dataset: text, images, videos, dates, countries, landing page, library link. No account, no login. Not affiliated with Meta or Google.

- **URL**: https://apify.com/badr_xba/competitor-ads-spy.md
- **Developed by:** [Badr Bouargan](https://apify.com/badr_xba) (community)
- **Categories:** Social media, Lead generation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.72 / 1,000 ads

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## 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

## Competitor Ads Spy – Meta & Google Ads

See the ads a brand runs on **Meta (Facebook, Instagram, Messenger, Threads)** and **Google (Search, YouTube, Display)** in **one dataset**. Type a brand name or a website domain; the Actor reads the public **Meta Ad Library** and the **Google Ads Transparency Center** the way a logged-out visitor can and returns one row per ad, with a `platform` column (`meta` or `google`).

![See every ad your competitor runs](https://api.apify.com/v2/key-value-stores/R1P4OnWyoV0LnGBin/records/adspy-01-cover.png)

> **Not affiliated with Meta or Google.** This Actor only reads the ad transparency libraries these companies publish for the public. No account, no login, no cookies, no CAPTCHA solving: if a library refuses logged-out access, it is reported as unavailable, never bypassed.

### What you get

| Field | Meta | Google |
|---|---|---|
| Advertiser name and id | yes | yes |
| Ad text, headline, call to action | yes | no (only inside Google's preview) |
| Images / videos | yes | preview image or preview script |
| First seen / last seen | yes | yes |
| Countries | yes (EU and some others) | the country you filter on |
| Shown on | Facebook, Instagram, Messenger, Threads... | – |
| Landing page | yes | no |
| Impressions range | when Meta publishes it | no |
| Library link | yes | yes |

Platform-specific extras (page info, CTA type, Google preview script...) are in the nested `platformData` object.

![One dataset, Meta and Google side by side](https://api.apify.com/v2/key-value-stores/R1P4OnWyoV0LnGBin/records/adspy-02-one-dataset.png)

### How to use it

1. Type the **brand** (for example `Patagonia`) and, better, its **website domain** (`patagonia.com`).
2. Optional: a **country** code (`US`, `FR`, `GB`...) to keep ads shown in that country.
3. Keep Meta and Google on (or switch one off) and set **Max ads per platform** (this also caps the cost).
4. Run. Download the dataset as JSON, CSV or Excel, or open the **Ads** view.

Example input:

```json
{
  "brand": "Patagonia",
  "domain": "patagonia.com",
  "country": "US",
  "maxAdsPerPlatform": 100
}
```

Example row (shortened):

```json
{
  "platform": "meta",
  "advertiserName": "Northwind Outdoor",
  "adId": "1029384756",
  "adText": "Built for the trail & the city.",
  "callToAction": "Shop now",
  "landingUrl": "https://northwind.example/winter",
  "mediaType": "video",
  "firstSeen": "2026-11-02",
  "lastSeen": "2026-11-14",
  "countries": ["DE", "FR"],
  "shownOn": ["facebook", "instagram"],
  "adLibraryUrl": "https://www.facebook.com/ads/library/?id=1029384756",
  "platformData": {"pageId": "...", "displayFormat": "VIDEO"}
}
```

![What each ad row contains](https://api.apify.com/v2/key-value-stores/R1P4OnWyoV0LnGBin/records/adspy-04-ad-fields.png)

### A blocked library never breaks your run

Meta and Google run side by side. If one is unavailable (login wall, bot check, rate limit, change on the platform's side), the other continues and the run still ends **SUCCEEDED**. The status message names the missing platform, and the `RUN_SUMMARY` record gives the status of each one:

| Status | Meaning |
|---|---|
| `OK` | ads delivered |
| `NO_ADS` | advertiser found, no ad matching your settings |
| `NOT_FOUND` | no advertiser with that name on this platform (add the domain, or switch off "Only this advertiser's own ads") |
| `UNAVAILABLE` | the platform refused logged-out access; nothing was bypassed and nothing was charged for it |
| `ERROR` / `TIMEOUT` | unexpected problem / stopped before the time limit; ads already saved are kept |
| `BUDGET` | your "Maximum cost per run" was reached; the run stopped cleanly |

`RUN_SUMMARY.status` is `SUCCEEDED` when both platforms answered, `PARTIAL` when one was missing, `CUSTOMER_ERROR` for an input problem (the run still ends SUCCEEDED and costs nothing). Want a FAILED run when a platform is missing (for monitoring)? Switch on **Fail the run if a platform is unavailable**.

![A blocked library never breaks your run](https://api.apify.com/v2/key-value-stores/R1P4OnWyoV0LnGBin/records/adspy-03-platform-status.png)

### How it works

![How it works](https://api.apify.com/v2/key-value-stores/R1P4OnWyoV0LnGBin/records/adspy-05-how-it-works.png)

- **Meta**: finds the brand's Facebook page in the Meta Ad Library, then reads its ads (all statuses, or only active ones).
- **Google**: with a domain, every ad leading to that website (Ads Transparency Center "website" search); with a name only, the advertisers whose name matches the brand.
- Polite pace, direct connection first; Apify Proxy only when a platform slows the reading down, never to pass a login page or a CAPTCHA.

### Pricing

![Pay only for the ads you get](https://api.apify.com/v2/key-value-stores/R1P4OnWyoV0LnGBin/records/adspy-06-pricing.png)

Pay per event: you pay for each **unique ad delivered** (the price is on the Pricing tab). No start fee. Duplicates, unavailable platforms, input errors and the run summary are never charged. "Max ads per platform" and "Maximum cost per run" are respected: the run stops cleanly and keeps every ad already delivered.

### Good to know

- Ad libraries show what each platform chooses to publish: Meta shows all ads for some regions (EU, UK, Brazil...) and more details for EU ads; Google does not publish the text or landing page outside its preview.
- Brand names are matched on whole words: "Nike" matches "NIKE SRL" and "Nike, Inc." but not "Nikesh". Use the domain on Google for the most precise result.
- Use the data responsibly and within each platform's terms and your local law. Ads can contain names of people who appear in them; do not use this Actor to collect personal data.

### FAQ

**Do I need an account or an API key?** No.

**Why did a platform return nothing?** Look at `RUN_SUMMARY.platforms`: `NOT_FOUND` usually means the advertiser has a different name on that platform; `UNAVAILABLE` means the platform refused logged-out access at that moment.

**Can I scrape many brands?** Run the Actor once per brand (for example from a scheduled task or the API), so each run has its own clear summary.

# Actor input Schema

## `brand` (type: `string`):

Name of the advertiser as people know it, for example "Patagonia". Used to find the Facebook page and the Google advertiser. Leave empty if you give a domain.

## `domain` (type: `string`):

The brand's website, for example "patagonia.com" (a full URL also works). On Google it finds every ad that leads to this website, the most precise search there.

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

2-letter country code (US, GB, FR, DE...) to keep ads shown in that country on Meta and Google. Leave empty for all countries.

## `maxAdsPerPlatform` (type: `integer`):

Maximum number of ads saved from Meta and from Google (each). You pay per ad saved, so this also caps the cost.

## `includeMeta` (type: `boolean`):

Read the Meta Ad Library: text, images, videos, start and end dates, platforms, landing page.

## `includeGoogle` (type: `boolean`):

Read the Google Ads Transparency Center: advertiser, format, first and last shown dates, preview image. Google does not list the ad text or landing page outside its preview.

## `onlyActiveAds` (type: `boolean`):

Keep only ads still active (Meta) or shown in the last 2 days (Google).

## `strictAdvertiserMatch` (type: `boolean`):

On: keep only ads whose advertiser name matches the brand (partners or resellers mentioning the brand are left out). Off: keep the closest matches too.

## `failRunOnError` (type: `boolean`):

Off (default): the run always ends SUCCEEDED with the ads of the platform(s) that answered, and names the missing one. On: the run ends FAILED when Meta or Google could not be read (useful for monitoring).

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

Optional. Leave empty: the Actor reads each library directly and switches to Apify Proxy only when a platform slows it down. A proxy is never used to get around a login page or a CAPTCHA.

## Actor input object example

```json
{
  "brand": "Patagonia",
  "domain": "patagonia.com",
  "maxAdsPerPlatform": 10,
  "includeMeta": true,
  "includeGoogle": true,
  "onlyActiveAds": false,
  "strictAdvertiserMatch": true,
  "failRunOnError": false
}
```

# Actor output Schema

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

Preview, platform, advertiser, text, dates, countries, landing page, library link.

## `media` (type: `string`):

Image and video links of each ad.

## `allFields` (type: `string`):

Every field of every row, including platformData (JSON, CSV, Excel export).

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

Status per platform (OK, NO_ADS, NOT_FOUND, UNAVAILABLE...), ads per platform, billing, stop reason.

# 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 = {
    "brand": "Patagonia",
    "domain": "patagonia.com",
    "maxAdsPerPlatform": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("badr_xba/competitor-ads-spy").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 = {
    "brand": "Patagonia",
    "domain": "patagonia.com",
    "maxAdsPerPlatform": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("badr_xba/competitor-ads-spy").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 '{
  "brand": "Patagonia",
  "domain": "patagonia.com",
  "maxAdsPerPlatform": 10
}' |
apify call badr_xba/competitor-ads-spy --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,badr_xba/competitor-ads-spy"
        }
    }
}
```

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/eSknOQk4wxHX2Qa9Q/builds/3a0Fstf4WUOzESZhV/openapi.json
