# LinkedIn Ad Library Scraper (`wakeful_outhouse/linkedin-ad-library-scraper`) Actor

Scrape LinkedIn Ad Library ads by keyword, advertiser company or Ad Library URL: ad text, headline, CTA, landing page, images, videos, documents, run dates, impressions, impressions by country and targeting. Monitor mode returns only new ads.

- **URL**: https://apify.com/wakeful_outhouse/linkedin-ad-library-scraper.md
- **Developed by:** [Roman](https://apify.com/wakeful_outhouse) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.50 / 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.

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

## LinkedIn Ad Library Scraper

Scrape ads from the **LinkedIn Ad Library** by **keyword**, **advertiser company** or any **Ad Library URL**, and get clean, structured data: ad text, headline, CTA, landing page, images, videos, carousel cards, documents, who paid, run dates, impressions, impressions by country and targeting.

No login, no cookies, no browser. It reads the same public pages the Ad Library website shows, so it is fast and cheap: about 1,000 ads with full details in a few minutes. Pair it with the [Facebook Ads Library Scraper](https://apify.com/wakeful_outhouse/facebook-ads-library-scraper) and the [Google Ads Transparency Scraper](https://apify.com/wakeful_outhouse/google-ads-transparency-scraper) to see a competitor's B2B ads on LinkedIn, Meta and Google side by side.

What you get for every ad:

- ✍️ **Ad copy**: full introductory text, headline, call-to-action text, Message Ad (InMail) body and sender.
- 🔗 **Landing page URL**: where the ad sends people, with UTM parameters, so you can see campaign names.
- 🖼️ **Media**: image URLs, video files (all qualities) and thumbnails, carousel cards, Document Ad title, page count and page previews.
- 🏷️ **Format**: Single Image, Video, Carousel, Document, Message, Event, Article, Thought Leader and other LinkedIn formats.
- 🏢 **Advertiser**: name, LinkedIn company ID, page URL, logo, and **Paid for by** (often the agency that bought the ad).
- 📅 **Run dates**: first and last day the ad ran and days running.
- 📊 **Impressions**: total impressions range (for example `10k-20k`) and the **share of impressions per country**.
- 🎯 **Targeting**: targeted languages and locations (with exclusions), and whether the advertiser used Audience, Company, Job, Education, Demographic or Member Interests targeting.
- 🔔 **Monitoring**: give a search a name and schedule it. Each run returns only ads you have not seen yet, so you pay only for new ones.

### Use cases

- **B2B competitor research**: see every ad a competitor runs on LinkedIn, which formats they use and how long each ad has been running.
- **Ad copy swipe files**: export hundreds of B2B hooks, headlines, CTAs and offers (webinars, reports, demos) into a spreadsheet.
- **Campaign intelligence**: read UTM parameters in landing URLs to learn campaign names, regions and funnels.
- **Targeting insights**: find out which countries a competitor targets and whether they target by job title, company or audience lists.
- **Agency pitches and audits**: show a prospect what their competitors run and which agency pays for it.
- **Market monitoring**: get a daily feed of new ads for a keyword or a list of competitors.

### Input

| Field | Description |
|---|---|
| `keywords` | One search per line, for example `CRM` or `cybersecurity` |
| `companies` | One advertiser per line: a company name (`HubSpot`), a numeric LinkedIn company ID (`1879`) or a company page URL (`https://www.linkedin.com/company/1035`) |
| `adLibraryUrls` | Any `https://www.linkedin.com/ad-library/search?...` URL copied from your browser (its filters are used), or ad pages `https://www.linkedin.com/ad-library/detail/<id>` |
| `countries` | Two-letter codes of the countries where the ads were shown (`US`, `DE`, `GB`…). Empty = all |
| `dateOption` | All time, last 30 days, this month, this year or last year |
| `startDate` / `endDate` | Custom date range (LinkedIn allows the last 12 months) |
| `includeAdDetails` | Open each ad page to add full text, CTA, landing page, all media, Paid by, run dates, impressions and targeting (on by default) |
| `monitorName` | Name a search to get only new ads on each run (see Monitoring new ads) |
| `maxAdsPerQuery` | Limit per input line (0 = everything) |
| `maxConcurrency` | How many queries run in parallel |

```json
{
  "keywords": ["CRM"],
  "companies": ["HubSpot", "https://www.linkedin.com/company/1035"],
  "countries": ["US", "GB"],
  "dateOption": "last-30-days",
  "maxAdsPerQuery": 200
}
```

Every line of `keywords`, `companies` and `adLibraryUrls` is a separate search; `countries` and dates apply to all of them. When you paste an Ad Library search URL, its own filters (keyword, advertiser, payer, countries, dates, impressions) are used as they are, so you can set up a search on the website and copy the address bar.

A company name matches the advertiser the way the LinkedIn website does, so it also returns **Thought Leader ads** that the company's employees promote. Use the numeric company ID for an exact match: it is the number in the advertiser link of any ad (`linkedin.com/company/1879`).

### Output example

```json
{
  "query": "HubSpot",
  "queryType": "company",
  "adId": "1578081813",
  "adLibraryUrl": "https://www.linkedin.com/ad-library/detail/1578081813",
  "adFormat": "SPONSORED_STATUS_UPDATE",
  "adFormatLabel": "Single Image Ad",
  "advertiserName": "HubSpot",
  "advertiserCompanyId": "68529",
  "advertiserUrl": "https://www.linkedin.com/company/68529",
  "text": "Alison Hammond on making people feel seen, and why she never walks in with an agenda. For anyone who sells or presents. GROW Europe, 17 November.",
  "textTruncated": false,
  "headline": "GROW Europe 2026 · London · Register Today",
  "ctaText": "Register",
  "landingUrl": "https://www.hubspot.com/grow-europe?utm_source=linkedin&utm_medium=paid&utm_campaign=Marketing_Registrations_EN_EMEA_VARIOUS_GROW-Europe-2026_prospecting...",
  "imageUrls": ["https://media.licdn.com/dms/image/v2/D4D10AQFlO348Uk5PcA/image-shrink_1280/..."],
  "videoUrls": [],
  "carouselCards": [],
  "adVersions": 1,
  "paidBy": "HubSpot, Inc.",
  "startDate": "2026-10-13",
  "endDate": "2026-10-16",
  "daysRunning": 4,
  "totalImpressions": "< 1k",
  "impressionsMin": 0,
  "impressionsMax": 1000,
  "impressionsByCountry": [{"country": "United Kingdom", "share": 100, "shareLabel": "100%"}],
  "targetingLanguages": ["English"],
  "targetingLocations": ["Ireland", "United Kingdom"],
  "targetingLocationsExcluded": [],
  "targetingParameters": {
    "Audience": {"targeted": false, "excluded": true},
    "Company": {"targeted": true, "excluded": true},
    "Job": {"targeted": true, "excluded": false},
    "Demographic": {"targeted": false, "excluded": false},
    "Education": {"targeted": false, "excluded": false},
    "Member Interests and Traits": {"targeted": false, "excluded": false}
  },
  "targetedCategories": ["Company", "Job"],
  "excludedCategories": ["Audience", "Company"]
}
```

Video ads add `videoUrls` (highest quality first) and `videoThumbnailUrl`; carousel ads add `carouselCards` with a title and image per card; Document Ads add `documentTitle`, `documentPageCount` and `documentPageImageUrls`; Message Ads add `messageSender`.

#### Run dates, impressions and targeting

LinkedIn publishes run dates, impressions and targeting for ads shown in the **EU** (Digital Services Act). Ads that ran only outside the EU have the ad itself and **Paid for by**, but no dates, impressions or targeting, and you are **not charged** the detail fee for them. With `includeAdDetails` off you get the list of ads from the search results only: the text is cut after about 150 characters (`textTruncated: true`) and there is no landing page, but it is the cheapest option.

### Monitoring new ads

Track competitors without paying twice for the same ads:

1. Fill in keywords, companies and filters as usual and set `monitorName`, for example `competitors-us`.
2. Save the input as a Task and add an Apify **Schedule** (daily or weekly).
3. The first run returns every matching ad. Each later run with the same `monitorName` returns only ads that earlier runs have not returned. Old ads are skipped and **not charged**.

Connect a webhook or the Slack / email integration to the Task to get new ads delivered. The list of seen ads is stored in the `linkedin-ads-monitor` key-value store in your account. To start over, use a new `monitorName` or delete its record from that store.

### Pricing

Pay per result: **$1.50 per 1,000 ads**. No extra fee per run beyond the Apify default.

Run dates, impressions and targeting (`includeAdDetails`): **+$1.50 per 1,000 ads that have them**. Ads without this data are not charged the fee, so a full ad record costs at most **$3.00 per 1,000**.

Set a maximum cost per run in the Apify Console, and the scraper stops cleanly when it is reached.

### Tips

- Keep Apify Proxy with the **Residential** group, which is the default. Traffic is small, about 20 MB per 1,000 ads with details.
- LinkedIn returns 24 ads per page. Big advertisers have thousands of ads: narrow with `countries` and dates, or set `maxAdsPerQuery`.
- Custom dates work only within the last 12 months. For older ads use `dateOption` "Last year" or leave the dates empty (all time).
- In monitor mode `maxAdsPerQuery` counts all ads checked, new and old. Leave it at 0 or set it above the advertiser's total so new ads are not missed.
- To get a single ad, paste its link: `https://www.linkedin.com/ad-library/detail/<ad ID>`.

### Integrations, API and MCP

**REST API.** Run the Actor and get the results in one call (replace `YOUR_APIFY_TOKEN`; it's in Console → Settings → API & Integrations):

```bash
curl -X POST "https://api.apify.com/v2/acts/wakeful_outhouse~linkedin-ad-library-scraper/run-sync-get-dataset-items" \
  -H "Authorization: Bearer YOUR_APIFY_TOKEN" -H "Content-Type: application/json" \
  -d '{"companies": ["HubSpot"], "countries": ["US"], "maxAdsPerQuery": 50}'
```

**Python** (`pip install apify-client`):

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("wakeful_outhouse/linkedin-ad-library-scraper").call(run_input={"companies": ["HubSpot"], "countries": ["US"], "maxAdsPerQuery": 50})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)
```

**AI agents (MCP).** Give Claude, Cursor or any MCP client this Actor as a tool through the Apify MCP server:

- hosted: `https://mcp.apify.com?tools=wakeful_outhouse/linkedin-ad-library-scraper`
- local: `npx -y @apify/actors-mcp-server --actors wakeful_outhouse/linkedin-ad-library-scraper` (set `APIFY_TOKEN`)

**No-code.** Use the Apify integrations for **Make, Zapier, n8n, Google Sheets, Slack** and **webhooks**: for example, run the Actor on a Schedule and send each new competitor ad to a Slack channel or append the ad copy to a Google Sheet. All formats are available as JSON, CSV, Excel and HTML from the dataset.

### More ad-intelligence tools

Same author, same data format, same pay-per-result pricing:

- [Facebook Ads Library Scraper](https://apify.com/wakeful_outhouse/facebook-ads-library-scraper) — ad text, media, landing pages, run dates and platforms from the Meta Ad Library, plus EU reach, demographics and targeting.
- [Google Ads Transparency Scraper](https://apify.com/wakeful_outhouse/google-ads-transparency-scraper) — ad copy, YouTube IDs, impressions and regions from the Google Ads Transparency Center.
- [Google Trends Scraper](https://apify.com/wakeful_outhouse/google-trends-scraper) — interest over time, interest by region, related queries and today's trending searches by country, to see which keywords are rising.

All tools: https://apify.com/wakeful_outhouse

### FAQ

**Is it legal?** The LinkedIn Ad Library is a public database LinkedIn publishes so anyone can inspect ads. The scraper collects only what the website shows publicly without logging in. You are responsible for how you use the data.

**Why are dates, impressions and targeting empty for some ads?** LinkedIn publishes them only for ads shown in the EU. Message Ads and Document Ads often have none either. You are not charged the detail fee for such ads.

**Why does a company name return ads from other advertisers?** LinkedIn matches the advertiser name and also shows Thought Leader ads promoted by the company's employees. Use the numeric company ID for an exact match.

**Why does the landing page URL contain UTM parameters?** That is the real URL the ad links to. Only LinkedIn's own `trk` tracking parameter is removed.

**Something broke?** Open an issue on the Issues tab with the run link. Fixes usually ship within a day.

# Actor input Schema

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

One search per line. Finds ads whose text contains the keyword (<code>CRM</code>, <code>cybersecurity</code>).

## `companies` (type: `array`):

One advertiser per line: a company name (<code>HubSpot</code>), a numeric LinkedIn company ID (<code>1879</code>) or a company page URL (<code>https://www.linkedin.com/company/1035</code>). Numeric IDs give exact matches; names match the advertiser name as LinkedIn does.

## `adLibraryUrls` (type: `array`):

Any <code>https://www.linkedin.com/ad-library/search?...</code> URL copied from your browser (its filters are used as they are), or ad pages <code>https://www.linkedin.com/ad-library/detail/123</code>.

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

Two-letter codes of the countries where the ads were shown (<code>US</code>, <code>DE</code>, <code>GB</code>…). Empty means all countries.

## `dateOption` (type: `string`):

Only ads that ran in this period. Ignored when you set a start or end date below.

## `startDate` (type: `string`):

Only ads that ran on or after this date. LinkedIn accepts custom dates within the last 12 months.

## `endDate` (type: `string`):

Only ads that ran on or before this date.

## `includeAdDetails` (type: `boolean`):

Open each ad page to add the full ad text, CTA, landing page, all media, Paid by, start and end date, total impressions, impressions by country and targeting (languages, locations, audience, company, job, demographic). LinkedIn publishes run dates, impressions and targeting only for ads shown in the EU; the detail fee is charged only for ads that have them. Turn off for the cheapest list of ads from search results only.

## `monitorName` (type: `string`):

Turn on monitoring: give this search any name, for example <code>competitors-us</code>. Each run then saves only ads that earlier runs with the same name have not returned, so you pay only for new ads. Use it with an Apify Schedule. The first run returns everything. The list of seen ads is kept in the <code>linkedin-ads-monitor</code> key-value store of your account. Leave empty for a normal run.

## `maxAdsPerQuery` (type: `integer`):

Stop after this many ads for each input line. 0 means no limit. In monitor mode this counts all ads checked, new and already seen.

## `maxConcurrency` (type: `integer`):

How many queries run in parallel.

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

Residential proxy is recommended.

## Actor input object example

```json
{
  "keywords": [
    "CRM"
  ],
  "companies": [
    "HubSpot"
  ],
  "adLibraryUrls": [],
  "countries": [],
  "dateOption": "all-time",
  "includeAdDetails": true,
  "maxAdsPerQuery": 24,
  "maxConcurrency": 5,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

All scraped ads with text, media, landing pages, run dates, impressions and targeting

# 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 = {
    "keywords": [
        "CRM"
    ],
    "companies": [
        "HubSpot"
    ],
    "maxAdsPerQuery": 24,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("wakeful_outhouse/linkedin-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 = {
    "keywords": ["CRM"],
    "companies": ["HubSpot"],
    "maxAdsPerQuery": 24,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("wakeful_outhouse/linkedin-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 '{
  "keywords": [
    "CRM"
  ],
  "companies": [
    "HubSpot"
  ],
  "maxAdsPerQuery": 24,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call wakeful_outhouse/linkedin-ad-library-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,wakeful_outhouse/linkedin-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/N53Os9ygd2wvMoj2f/builds/zOmLDm1Ga4sjDwKvl/openapi.json
