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

Scrape public LinkedIn Ad Library ads by keyword, advertiser, country, and official search URLs.

- **URL**: https://apify.com/fetch\_cat/linkedin-ad-library-scraper.md
- **Developed by:** [Hanna Nosova](https://apify.com/fetch_cat) (community)
- **Categories:** Marketing, Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.20 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## LinkedIn Ad Library Scraper

Scrape public LinkedIn Ad Library search results and ad detail pages for competitive advertising research. Export LinkedIn ad creatives, advertiser names, payer names, ad URLs, creative text, CTA/headline signals, media URLs, run-date text, impression ranges, targeting text, and monitoring metadata.

### Who is it for

This Actor is for B2B marketers, agencies, ad operations teams, founders, and competitive-intelligence analysts who need repeatable exports from the public LinkedIn Ad Library.

### What you can use it for

- Monitor competitor LinkedIn campaigns weekly.
- Collect new ad creative and messaging for B2B competitive intelligence.
- Export public LinkedIn ad transparency data for agency reporting.
- Track paid-by entities and advertiser pages from official LinkedIn Ad Library URLs.
- Build a lightweight LinkedIn Ad Library API workflow by running saved inputs on a schedule and reading the dataset through the Apify API.
- Compare LinkedIn ads library results across multiple keywords and countries to collect LinkedIn ad examples for creative research.

This Actor uses public anonymous LinkedIn Ad Library pages only. It does not log in, access Campaign Manager, scrape private profiles, or collect member-only data.

### Ready-to-run Store examples

Use these public Apify Store examples when you want a saved task with safe, bounded inputs and a preview dataset:

- [B2B SaaS LinkedIn ads research](https://apify.com/fetch_cat/linkedin-ad-library-scraper/examples/b2b-saas-linkedin-ads-research) — export recent US LinkedIn Ad Library creatives for B2B SaaS messaging research.
- [LinkedIn fintech ads in the UK](https://apify.com/fetch_cat/linkedin-ad-library-scraper/examples/linkedin-fintech-ads-uk) — compare UK fintech advertisers, creative types, public ad-library URLs, and copy themes.
- [LinkedIn CRM ads research](https://apify.com/fetch_cat/linkedin-ad-library-scraper/examples/linkedin-crm-ads-research) — monitor CRM competitors and capture advertiser names, ad URLs, creative text, and media signals.
- [LinkedIn AI startup ads](https://apify.com/fetch_cat/linkedin-ad-library-scraper/examples/linkedin-ai-startup-ads) — collect public AI startup ad examples for positioning and campaign research.
- [LinkedIn cybersecurity ads](https://apify.com/fetch_cat/linkedin-ad-library-scraper/examples/linkedin-cybersecurity-ads) — review cybersecurity campaign messages and advertiser transparency fields.

Each example is intentionally capped for quick validation and points to LinkedIn Ad Library ad URLs rather than unavailable destination landing-page URLs.

### Input recipes from verified Store examples

These are the same bounded inputs used by the public Store examples above. QA verified each example task with 20 unique ad records and matching item charge events.

#### B2B SaaS LinkedIn ads research

```json
{
  "keyword": "b2b saas",
  "countries": ["US"],
  "dateOption": "last-30-days",
  "maxAds": 20
}
```

#### LinkedIn fintech ads in the UK

```json
{
  "keyword": "fintech",
  "countries": ["GB"],
  "dateOption": "last-30-days",
  "maxAds": 20
}
```

#### LinkedIn CRM ads research

```json
{
  "keyword": "crm",
  "countries": ["US"],
  "dateOption": "last-30-days",
  "maxAds": 20
}
```

#### LinkedIn AI startup ads

```json
{
  "keyword": "AI startup",
  "countries": ["US"],
  "dateOption": "last-30-days",
  "maxAds": 20
}
```

#### LinkedIn cybersecurity ads

```json
{
  "keyword": "cybersecurity",
  "countries": ["US"],
  "dateOption": "last-30-days",
  "maxAds": 20
}
```

### Input fields

- `startUrls` - Official LinkedIn Ad Library search URLs to process.
- `keyword` - Keyword for the public Ad Library search builder.
- `advertiser` - Optional account owner filter.
- `payer` - Optional paid-by filter.
- `countries` - ISO country codes, for example `US`, `GB`, `CA`, `AU`.
- `dateOption` - `last-30-days`, `last-6-months`, `last-year`, or `any-time`.
- `changedSince` - Optional ISO timestamp for incremental monitoring labels.
- `maxAds` - Maximum unique ad detail records to save.
- `requestDelayMs` - Delay between detail requests to reduce rate limiting.
- `proxyConfiguration` - Apify Proxy settings. Proxy use is recommended for larger runs.

### Output

Each dataset item represents one public LinkedIn ad and can include:

- `adId`
- `adUrl`
- `searchUrl`
- `advertiserName`
- `advertiserUrl`
- `payerName`
- `creativeText`
- `headline`
- `callToAction`
- `creativeType`
- `mediaUrls`
- `activeDatesText`
- `impressionsText`
- `targetingText`
- `firstSeenAt`
- `lastSeenAt`
- `changeType`

The Actor also writes a `RUN-SUMMARY` key-value-store record with saved counts and processed search URLs.

### Pricing and limits

The Actor is designed for pay-per-event pricing: a small start event plus one item event for each saved ad record. `maxAds` caps the run size, and `requestDelayMs` lets you trade speed for lower rate-limit risk. The Actor saves available public metadata and media URLs; it does not download media files.

### API Usage

Use scheduled Apify tasks for weekly monitoring, then export the dataset as JSON, CSV, Excel, or through the Apify API. The `RUN-SUMMARY` key-value-store record is useful for automations that need saved counts and processed source URLs.

#### Node.js

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

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('fetch_cat/linkedin-ad-library-scraper').call({
  keyword: 'crm',
  countries: ['US'],
  dateOption: 'last-30-days',
  maxAds: 20
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

#### Python

```python
from apify_client import ApifyClient
import os

client = ApifyClient(os.environ['APIFY_TOKEN'])
run = client.actor('fetch_cat/linkedin-ad-library-scraper').call(run_input={
    'keyword': 'crm',
    'countries': ['US'],
    'dateOption': 'last-30-days',
    'maxAds': 20,
})
items = client.dataset(run['defaultDatasetId']).list_items().items
print(items)
```

#### cURL

```bash
curl -X POST "https://api.apify.com/v2/acts/fetch_cat~linkedin-ad-library-scraper/runs?token=$APIFY_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"keyword":"crm","countries":["US"],"dateOption":"last-30-days","maxAds":20}'
```

### MCP

You can use this Actor from MCP-capable tools through Apify's Actor integration. Pass the same JSON input you would use in Console and read the default dataset items after the run succeeds.

Add the Apify MCP server to Claude Desktop or Claude Code:

```bash
claude mcp add apify -- npx -y @apify/actors-mcp-server --actors fetch_cat/linkedin-ad-library-scraper
```

Example MCP server JSON configuration:

```json
{
  "mcpServers": {
    "apify": {
      "command": "npx",
      "args": ["-y", "@apify/actors-mcp-server", "--actors", "fetch_cat/linkedin-ad-library-scraper"],
      "env": {
        "APIFY_TOKEN": "your-apify-token"
      }
    }
  }
}
```

Example prompts:

- "Run the LinkedIn Ad Library Scraper for keyword crm in the US and return the first 20 ad records."
- "Scrape this LinkedIn Ad Library search URL and summarize repeated CTA themes from the output dataset."

### Legality and responsible use

This Actor collects information from public LinkedIn Ad Library pages. Use the results for lawful competitive research, transparency analysis, and reporting. Do not use the output to identify private individuals, bypass access controls, or violate LinkedIn terms that apply to your use case.

### Related actors

For broader social advertising workflows, combine this Actor with other public ad transparency or social media monitoring actors in your Apify account. Keep LinkedIn Ad Library monitoring separate from member-profile or feed scraping because the data source and compliance boundary are different.

### FAQ

#### How can I scrape LinkedIn Ad Library ads by keyword?

Set `keyword`, choose one or more `countries`, select `dateOption`, and set `maxAds`. You can also paste official LinkedIn Ad Library search URLs into `startUrls` for exact searches.

#### Can I export competitor LinkedIn ad creatives and payer data?

Yes. Each output row includes the public ad URL, advertiser fields, payer name when LinkedIn exposes it, creative text, media URLs, creative type, and available transparency text.

### Support

If a run returns fewer ads than expected, try a broader keyword, a longer date range, or official search URLs copied from LinkedIn. For persistent failures, open an Apify issue with the run ID and input so the scraper can be adjusted to LinkedIn's current public HTML.

### Notes and limits

LinkedIn may rate-limit or change public Ad Library HTML. The Actor retries transient 429/5xx responses, skips failed detail pages while preserving successful ads, and logs warnings for empty searches. For large monitoring jobs, use multiple specific search URLs and keep a moderate request delay.

# Actor input Schema

## `startUrls` (type: `array`):

Optional LinkedIn Ad Library search URLs to scrape. Use this for exact searches copied from LinkedIn.

## `keyword` (type: `string`):

Keyword to search in the public LinkedIn Ad Library.

## `advertiser` (type: `string`):

Optional advertiser/account owner name for LinkedIn's accountOwner filter.

## `payer` (type: `string`):

Optional payer name for LinkedIn's paidBy filter.

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

ISO country codes to include, such as US, GB, CA, AU.

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

LinkedIn Ad Library date filter.

## `changedSince` (type: `string`):

Optional ISO date. Items first seen before this date are marked unchanged; newer items are marked new.

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

Maximum number of unique ads to save.

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

Throttle detail requests to reduce LinkedIn rate limits. Increase this for larger monitoring runs.

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

Optional proxy configuration. Apify Proxy is recommended for larger runs.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.linkedin.com/ad-library/search?keyword=crm&countries=US&dateOption=last-30-days"
    }
  ],
  "keyword": "crm",
  "countries": [
    "US"
  ],
  "dateOption": "last-30-days",
  "maxAds": 20,
  "requestDelayMs": 750,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `overview` (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 = {
    "startUrls": [
        {
            "url": "https://www.linkedin.com/ad-library/search?keyword=crm&countries=US&dateOption=last-30-days"
        }
    ],
    "keyword": "crm",
    "countries": [
        "US"
    ],
    "maxAds": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("fetch_cat/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 = {
    "startUrls": [{ "url": "https://www.linkedin.com/ad-library/search?keyword=crm&countries=US&dateOption=last-30-days" }],
    "keyword": "crm",
    "countries": ["US"],
    "maxAds": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("fetch_cat/linkedin-ad-library-scraper").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "startUrls": [
    {
      "url": "https://www.linkedin.com/ad-library/search?keyword=crm&countries=US&dateOption=last-30-days"
    }
  ],
  "keyword": "crm",
  "countries": [
    "US"
  ],
  "maxAds": 20
}' |
apify call fetch_cat/linkedin-ad-library-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=fetch_cat/linkedin-ad-library-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/grF62vOnZIMiSU7wL/builds/oFuY2kYNDmr05LbZT/openapi.json
