# Ad Transparency Monitor (`hashem277/ad-transparency-monitor`) Actor

Track active competitor ads across Google Ads Transparency Center, LinkedIn Ad Library, Meta Ad Library, Microsoft Ad Library, TikTok Ad Library, and Pinterest Ads Repository into one flat, automation-ready JSON schema for n8n, Make, Clay, Google Sheets, and AI agents (MCP).

- **URL**: https://apify.com/hashem277/ad-transparency-monitor.md
- **Developed by:** [HASHEM ALSAGGAF](https://apify.com/hashem277) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.00 / 1,000 ad records

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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 Ad Transparency Monitor

Track active competitor ads across **Google Ads Transparency Center**, **LinkedIn Ad Library**, **Meta Ad Library**, **Microsoft Ad Library**, **TikTok Ad Library**, and **Pinterest Ads Repository** into one flat, automation-ready JSON schema for **n8n**, **Make**, **Clay**, **Google Sheets**, and **AI agents (MCP)**.

### Features

- **Multi-Platform Coverage:** Queries **Google Ads Transparency Center** (`google`), **LinkedIn Ad Library** (`linkedin`), **Meta Ad Library** (`meta`), **Microsoft Ad Library** (`microsoft`), **TikTok Ad Library** (`tiktok`), and **Pinterest Ads Repository** (`pinterest`) from a single input.
- **30+ Day Winner Detection:** Computes `activeDays` from each ad's `startDate` and flags `isLongRunningWinner: true` for ads running 30+ days (or filter directly with `minActiveDays`).
- **Delta Mode (`onlyNewAds`):** Persists seen ad IDs in Apify Key-Value Store (`ad-transparency-snapshots`) so scheduled daily/weekly runs emit **only newly launched ads**.
- **Flat, Automation-Ready Output:** One row per ad (`headline`, `adCopy`, `ctaText`, `landingPageUrl`, `mediaUrls`, `startDate`, `activeDays`, `adLibraryUrl`).
- **Pay-Per-Event (PPE) Ready:** Configured with `.actor/pay_per_event.json` (`actor-start` + `ad-record-extracted`).

### Example Input

```json
{
  "platforms": ["google", "linkedin"],
  "domains": ["hubspot.com", "stripe.com"],
  "queries": [],
  "country": "US",
  "maxAdsPerTarget": 25,
  "minActiveDays": 30,
  "onlyNewAds": true
}
```

### Sample Output

```json
{
  "platform": "google",
  "adId": "CR987654321",
  "advertiserName": "HubSpot Inc.",
  "advertiserId": "AR123456789",
  "domainOrQuery": "hubspot.com",
  "country": "US",
  "format": "image",
  "headline": "All-in-One CRM Platform",
  "adCopy": "Grow faster with HubSpot.",
  "ctaText": "Get Started",
  "landingPageUrl": "https://www.hubspot.com/crm",
  "mediaUrls": ["https://tpc.googlesyndication.com/simgad/123"],
  "startDate": "2026-10-01",
  "lastSeenDate": "2026-11-16",
  "activeDays": 47,
  "isLongRunningWinner": true,
  "isNewSinceLastRun": true,
  "adLibraryUrl": "https://adstransparency.google.com/advertiser/AR123456789/creative/CR987654321",
  "scrapedAt": "2026-11-16T22:40:00.000Z"
}
```

### Automation Quick-Start (n8n / Clay / Make)

1. Schedule this Actor daily or weekly on Apify with `onlyNewAds: true`.
2. Connect an **n8n Apify node** (or HTTP Request to `https://api.apify.com/v2/acts/<YOUR_ACTOR_ID>/run-sync-get-dataset-items?token=<APIFY_TOKEN>`).
3. Pipe `isNewSinceLastRun === true` items straight into **Slack**, **Google Sheets**, or **Notion**.

### Local Development

```bash
npm install
npm run typecheck
npm test
npm run build
```

### Publishing to Apify

```bash
apify login
apify push
```

# Actor input Schema

## `platforms` (type: `array`):

Which ad transparency libraries to query.

## `domains` (type: `array`):

Competitor domains to monitor (e.g. hubspot.com, stripe.com). Used directly on Google Ads Transparency and mapped to brand name on LinkedIn.

## `queries` (type: `array`):

Additional brand names or keyword queries (e.g. "HubSpot", "Notion").

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

2-letter ISO country code (e.g. US, CA, GB, DE) or ALL for worldwide.

## `maxAdsPerTarget` (type: `integer`):

Maximum number of ads to extract per domain/query per platform.

## `minActiveDays` (type: `integer`):

Only return ads that have been running for at least this many days (e.g. 30 to isolate proven winning ads). Set 0 to include all ads.

## `onlyNewAds` (type: `boolean`):

When enabled, stores seen ad IDs in Apify Key-Value Store and outputs only ads not seen in previous runs.

## `snapshotStoreName` (type: `string`):

Named Apify Key-Value Store used to persist seen ad IDs across scheduled runs.

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

Optional Apify Proxy settings (recommended for high-volume LinkedIn Ad Library runs).

## Actor input object example

```json
{
  "platforms": [
    "google",
    "linkedin"
  ],
  "domains": [
    "hubspot.com"
  ],
  "queries": [],
  "country": "US",
  "maxAdsPerTarget": 25,
  "minActiveDays": 0,
  "onlyNewAds": false,
  "snapshotStoreName": "ad-transparency-snapshots",
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `ads` (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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("hashem277/ad-transparency-monitor").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("hashem277/ad-transparency-monitor").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 '{}' |
apify call hashem277/ad-transparency-monitor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,hashem277/ad-transparency-monitor"
        }
    }
}
```

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/aIC5KmTsxOTA63H4h/builds/s6qZo20oHtM3GhICR/openapi.json
