# Ad Library Scraper: Google Ads Transparency & LinkedIn Ads (`gleanery_actors/ad-library-scraper`) Actor

Get a company's ads from the Google Ads Transparency Center and LinkedIn Ad Library in one run: ad copy, creatives, first/last shown dates, impressions by country, targeting and payer. Competitor ad monitoring. $3 per 1,000 ads.

- **URL**: https://apify.com/gleanery_actors/ad-library-scraper.md
- **Developed by:** [Martin Farias](https://apify.com/gleanery_actors) (community)
- **Categories:** Marketing, Lead generation, AI
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 ad results

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

## Ad Library Scraper: Google Ads Transparency Center & LinkedIn Ad Library

**Ad Library Scraper** pulls **every ad a company runs on Google and LinkedIn** in one run, from the public ad libraries both platforms publish: the [Google Ads Transparency Center](https://adstransparency.google.com) (Search, YouTube, Display, Maps, Play, Shopping) and the [LinkedIn Ad Library](https://www.linkedin.com/ad-library). Enter a company name or website. You get the ad copy, creatives, **first and last shown dates, impression ranges, impressions by country, targeting and who paid**, as JSON, CSV or Excel.

Built for **competitor ad research**, **agencies pitching new clients**, **creative inspiration** and **monitoring a market's campaigns**.

👉 **Try it now:** keep the prefilled input (HubSpot, 10 ads per platform) and click **Start**. That's 6 cents.

### 🤖 Quick reference for AI agents

- **Actor ID:** `gleanery_actors/ad-library-scraper`. MCP: `https://mcp.apify.com?tools=gleanery_actors/ad-library-scraper`
- **Use it when** the user asks what ads a company runs, its ad copy or creatives, where and how long its campaigns run, or for competitor ad research on Google or LinkedIn.
- **Minimal input:** `{"advertisers": ["hubspot.com"], "maxItems": 30}`. A website domain finds the most ads on Google; a company name works too.
- **Useful inputs:** `platforms` (`google`, `linkedin`), `countries` (ISO codes, e.g. `["DE","FR"]`), `activeWithinDays` (e.g. 30 = current campaigns), `keywords` (LinkedIn ad text search), `maxAdsPerAdvertiser`
- **Output:** one item per ad: `platform`, `advertiserName`, `format`, `headline`, `adText`, `imageUrl`, `firstShown`, `lastShown`, `impressionsMin`, `impressionsMax`, `countries`, `targeting`, `adUrl`
- **Save context tokens:** `"omitEmptyFields": true`, `"adTextMaxLength": 300`, or `"includeDetails": false` for a quick list
- **Cost:** $0.003 per ad, details included. No start fee.
- **No Apify account?** Agents can pay per use with x402 or MPP through [agi.apify.com](https://agi.apify.com).

### ✨ Why this ad library scraper

- 🔀 **Two ad libraries, one schema**: Google and LinkedIn ads in a single dataset, so you can compare a competitor's channels side by side
- 📈 **Reach data included at no extra cost**: impression ranges, impressions by country, first and last shown dates per country (Google), audience targeting and payer (LinkedIn)
- 🎯 **Company name or domain**: `hubspot` or `hubspot.com`. On Google, a domain returns every ad pointing to that website, including ads run by resellers and affiliates.
- 🧹 **No partner noise**: LinkedIn's search mixes in partners ("Agency X 🧡 HubSpot"). Exact matching keeps only the company's own ads, and you can switch it off.
- 🗓️ **Current campaigns only**: `activeWithinDays` keeps ads that are still running
- 🔁 **Monitoring mode**: schedule it weekly and get (and pay for) only **new ads** or ads whose reach changed
- 🇪🇺 **EU-ready**: under the Digital Services Act, EU-served ads disclose the most (targeting, impressions by country, payer). Filter with `countries`.
- 💵 **$3 per 1,000 ads, details included**, cheaper on paid Apify plans. No start fee.

### 📋 Data you get

| Field | Google | LinkedIn |
|---|---|---|
| `advertiserName`, `advertiserId`, `advertiserUrl` | ✅ verified advertiser | ✅ company page |
| `format` | TEXT / IMAGE / VIDEO | Single Image, Video, Carousel, Document, Text, Spotlight… |
| `adText`, `headline` | (in the creative image) | ✅ |
| `imageUrl` | ✅ ad snapshot | ✅ creative |
| `videoUrl`, `previewUrl` | preview script | ✅ when available |
| `firstShown`, `lastShown` | ✅ | ✅ |
| `impressionsMin`, `impressionsMax` | ✅ | ✅ (`impressionsRange`, e.g. "5k-10k") |
| `impressionsByCountry` | ✅ ranges and dates per country | ✅ share per country |
| `targeting` | | ✅ language, location, audience |
| `paidBy` | | ✅ |
| `landingDomain` | ✅ (domain searches) | |

### 🧾 Input examples

**A competitor's ads on both platforms in Germany, current campaigns only:**

```json
{
  "advertisers": ["salesforce.com"],
  "countries": ["DE"],
  "activeWithinDays": 30,
  "maxAdsPerAdvertiser": 100
}
```

**Compare three competitors on LinkedIn:**

```json
{
  "advertisers": ["HubSpot", "Pipedrive", "Salesforce"],
  "platforms": ["linkedin"],
  "maxAdsPerAdvertiser": 50
}
```

**Every LinkedIn ad mentioning a topic:**

```json
{
  "keywords": ["cybersecurity webinar"],
  "countries": ["FR", "DE", "NL"],
  "maxItems": 200
}
```

**Weekly monitoring of new competitor ads (schedule weekly):**

```json
{
  "advertisers": ["notion.so", "clickup.com", "monday.com"],
  "onlyNewOrUpdated": true,
  "maxItems": 500
}
```

### 📤 Output example

```json
{
  "platform": "linkedin",
  "adId": "1577956593",
  "adUrl": "https://www.linkedin.com/ad-library/detail/1577956593",
  "advertiserName": "HubSpot",
  "advertiserId": "68529",
  "advertiserUrl": "https://www.linkedin.com/company/68529",
  "paidBy": "HubSpot, Inc.",
  "format": "Single Image Ad",
  "adText": "Die KI-Investitionen deutscher Unternehmen sind inzwischen ungefähr so hoch wie der Berliner Fernsehturm…",
  "imageUrl": "https://media.licdn.com/dms/image/v2/…",
  "firstShown": "2026-10-13",
  "lastShown": "2026-10-20",
  "impressionsMin": 1000,
  "impressionsMax": 5000,
  "impressionsRange": "1k-5k",
  "impressionsByCountry": [{ "country": "Germany", "share": "71%" }, { "country": "Switzerland", "share": "24%" }],
  "targeting": { "Language": "Targeting includes English", "Location": "Targeting includes Germany" }
}
```

```json
{
  "platform": "google",
  "adId": "CR05015005953150418945",
  "adUrl": "https://adstransparency.google.com/advertiser/AR10072600183532683265/creative/CR05015005953150418945",
  "advertiserName": "Hubspot, Inc.",
  "format": "TEXT",
  "imageUrl": "https://tpc.googlesyndication.com/archive/simgad/2305887529562525008",
  "firstShown": "2024-04-08T15:29:10.000Z",
  "lastShown": "2026-10-20T19:32:48.000Z",
  "impressionsMin": 125000,
  "impressionsMax": 150000,
  "impressionsByCountry": [{ "country": "FR", "impressionsMin": 0, "impressionsMax": 1000, "firstShown": "2024-05-15", "lastShown": "2026-10-16" }]
}
```

The dataset has two views: **Ads** (creatives) and **Reach & targeting**.

### 💵 Pricing

| Apify plan | Price per 1,000 ads |
|---|---|
| Free | $3.00 |
| Bronze | $2.70 |
| Silver | $2.40 |
| Gold and above | $2.00 |

Details (impressions, dates, targeting) are included. No start fee. Ads removed by filters or skipped as unchanged are not charged. Apify's free plan includes $5 of monthly credit, about 1,600 ads.

### 💡 Use cases

- **Competitor research:** see which messages, offers and formats competitors push, in which countries, and for how long.
- **Agency new business:** show a prospect what their competitors are running before the pitch.
- **Creative inspiration:** collect high-reach ads in your category as a swipe file.
- **Market monitoring:** a weekly feed of new ads from every player in your market.
- **Research and journalism:** analyze advertising reach and targeting under the EU Digital Services Act.

### 🔌 API and integrations

```bash
curl -X POST "https://api.apify.com/v2/acts/gleanery_actors~ad-library-scraper/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"advertisers":["hubspot.com"],"activeWithinDays":30,"maxItems":50}'
```

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("gleanery_actors/ad-library-scraper").call(run_input={"advertisers": ["pipedrive"], "countries": ["DE"]})
for ad in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(ad["platform"], ad["format"], ad["lastShown"], ad["adUrl"])
```

Send results to Google Sheets, Slack, Airtable, Make, Zapier or n8n with Apify integrations.

### ❓ FAQ

**Which ads are included?**
Everything the platforms publish in their ad libraries. Google covers verified advertisers' ads on Search, YouTube, Display, Maps, Play and Shopping. LinkedIn covers sponsored content on LinkedIn.

**Why do Google ads have no text?**
Google publishes text ads as rendered images (`imageUrl`), not as text.

**Why do some ads have no impressions or targeting?**
The platforms only disclose reach and targeting for some ads, mostly those served in the EU under the Digital Services Act. Use `countries` with EU country codes to focus on those.

**Is it legal and GDPR-compliant?**
The ad libraries are public by law (EU Digital Services Act) and by platform policy. The actor returns ads and advertiser information only. Personal data such as the employee profile behind a LinkedIn "thought leader" ad is deliberately left out.

**What about Meta (Facebook/Instagram) and TikTok?**
They are on our roadmap. Tell us in the Issues tab if you need them.

### 🧰 More from us

- [Job Search API](https://apify.com/gleanery_actors/ats-job-search): open jobs across 10,000+ company career sites, a hiring signal that pairs well with ad activity
- [Career Site Jobs Scraper](https://apify.com/gleanery_actors/career-site-jobs-scraper): every job from specific companies' career sites
- [Europages Scraper](https://apify.com/gleanery_actors/europages-scraper): European suppliers and manufacturers with VAT IDs

### 💬 Support

Found a bug or need a field? Open an issue on the **Issues** tab. We reply within 24 hours.

# Actor input Schema

## `advertisers` (type: `array`):

Companies whose ads you want, as a name ("HubSpot") or website domain ("hubspot.com"). On Google, a name is matched to verified advertisers and a domain returns all ads pointing to that website. On LinkedIn, the name is searched in the Ad Library.

## `keywords` (type: `array`):

Find LinkedIn ads whose text mentions these words, from any advertiser, e.g. "crm", "cybersecurity webinar". Google doesn't offer keyword search.

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

Ad libraries to search.

## `countries` (type: `array`):

Only ads shown in these countries, as 2-letter codes, e.g. "DE", "FR", "US". Empty = anywhere. EU-served ads include the most detail (impressions by country and targeting) under the Digital Services Act.

## `activeWithinDays` (type: `integer`):

Keep only ads last shown within this many days. 0 = any time. Use 7 or 30 to see a competitor's current campaigns.

## `exactAdvertiserMatch` (type: `boolean`):

LinkedIn's advertiser search also returns partners and resellers whose name contains the company (e.g. "Agency X 🧡 HubSpot"). When on, only advertisers whose name starts with your input are kept.

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

Fetch each ad's detail: first and last shown dates, impression ranges, impressions by country, targeting and payer (LinkedIn). Slower but much richer. Included in the price.

## `adTextMaxLength` (type: `integer`):

Cut ad text to this many characters. 0 = full text.

## `omitEmptyFields` (type: `boolean`):

Leave out null and empty fields for compact output (useful for AI agents).

## `maxAdsPerAdvertiser` (type: `integer`):

Newest ads first. Big advertisers can have thousands of ads.

## `maxItems` (type: `integer`):

Stop after this many ads. Caps your cost.

## `onlyNewOrUpdated` (type: `boolean`):

For scheduled competitor monitoring: return (and charge for) only ads that are new, or whose impressions or last-shown date changed, since the previous run with the same input.

## `stateKey` (type: `string`):

Optional name for the monitoring memory. Runs with the same key share it.

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

Used for LinkedIn only (Google needs no proxy). LinkedIn blocks datacenter IPs, so residential proxy is the default. Its cost is included in the price.

## Actor input object example

```json
{
  "advertisers": [
    "hubspot"
  ],
  "platforms": [
    "google",
    "linkedin"
  ],
  "activeWithinDays": 0,
  "exactAdvertiserMatch": true,
  "includeDetails": true,
  "adTextMaxLength": 0,
  "omitEmptyFields": false,
  "maxAdsPerAdvertiser": 10,
  "maxItems": 20,
  "onlyNewOrUpdated": false,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `results` (type: `string`):

All scraped ads as dataset items (JSON, CSV, Excel).

# 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 = {
    "advertisers": [
        "hubspot"
    ],
    "maxAdsPerAdvertiser": 10,
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("gleanery_actors/ad-library-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 = {
    "advertisers": ["hubspot"],
    "maxAdsPerAdvertiser": 10,
    "maxItems": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("gleanery_actors/ad-library-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 '{
  "advertisers": [
    "hubspot"
  ],
  "maxAdsPerAdvertiser": 10,
  "maxItems": 20
}' |
apify call gleanery_actors/ad-library-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,gleanery_actors/ad-library-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/qEjaoyyitjHOnEri2/builds/GKjW03GqhAz0E9wo4/openapi.json
