# LinkedIn Ad Library Scraper — Competitor B2B Ads & Spend (`madeingermany/linkedin-ads-scraper`) Actor

Scrape LinkedIn Ad Library by keyword, company, payer, or country. Extract ad copy, creatives, destination URLs, impressions, target countries, and payer details.

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

## Pricing

from $0.40 / 1,000 ad scraped (full details included)s

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

## 🚀 LinkedIn Ad Library Scraper — Competitor B2B Ads & Spend

The most reliable, high-performance **LinkedIn Ad Library Scraper** on the Apify Store. Search and monitor ads from any company, keyword, or payer worldwide or in specific countries. Extract full creative copy, headlines, media links (images, videos, documents), advertiser metadata, CTA destination URLs, and EU transparency targeting.

***

### 💡 Why Choose This Scraper Over Alternatives?

- **⚡ Pure HTTP-First Fast Architecture**: Powered by Crawlee `CheerioCrawler` and `got-scraping`. Bypasses heavy Chromium/Playwright browser overhead, running **10x faster** at a fraction of the compute cost.
- **🛡️ Bulletproof Anti-Bot Protection**: Employs real Chrome TLS fingerprinting, HTTP/2 framing, and rotating Residential Proxy support to clear Cloudflare without blocks.
- **🔄 Intelligent Pagination**: Seamlessly traverses cursor and pagination tokens (`paginationToken`) to extract thousands of ads effortlessly.
- **🎯 Full Ad Copy & Creative Assets**: Extracts complete text commentary, headline, ad format (Single Image, Video, Carousel, Document), raw media links, and CTA destinations.
- **💰 Transparent Pay-Per-Event (PPE) Pricing**: Pay only for what you extract with zero subscription lock-in.

***

### 💰 Pricing (Pay-Per-Event)

This actor operates on a pay-as-you-go **Pay-Per-Event (PPE)** pricing model. You only pay for what you extract:

| Event Name | Purpose | Price (USD) | Description |
|---|---|---|---|
| **`apify-default-dataset-item`** | Ad scraped (full details included) | `$0.0015` | Charged for saving ad in dataset with full details |
| **`apify-actor-start`** | Actor Start | `$0.00005` | Charged when the Actor starts running. Number of events charged depends on Actor memory (one event per GB, minimum one event). |

***

### 📌 Use Cases

- **Competitor Ad Intelligence**: Track your competitors' active campaigns, creative angles, offers, and value propositions in real time.
- **Growth & Performance Marketing**: Mine proven hooks, ad copy variations, and high-converting CTAs across any industry.
- **Agency Pitch & Audit Decks**: Perform instant advertising audits for prospective clients with actual live ad creatives.
- **Brand Protection & Trademark Monitoring**: Detect unauthorized entities or affiliates advertising on your brand name and find out who paid for them.
- **B2B Market Research**: Analyze spend pressure and messaging shifts across tech, SaaS, enterprise, and consulting leaders.

***

### ⚙️ Input Parameters

| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| `searchQuery` | String | No | `"Anthropic"` | Keyword, brand name, or company to search for. |
| `startUrls` | Array | No | `[{"url": "https://www.linkedin.com/ad-library/search?keywords=Anthropic"}]` | Direct LinkedIn Ad Library search or detail URLs. |
| `maxItems` | Integer | No | `50` | Maximum number of ads to extract. |
| `countries` | Array | No | `[]` | 2-letter ISO country codes (e.g. `["US", "GB", "DE"]`). Leave empty for worldwide. |
| `dateOption` | String | No | `"all-time"` | Date filter: `"all-time"`, `"last-30-days"`, `"current-month"`, `"current-year"`, or `"last-year"`. |
| `proxy` | Object | No | Residential Proxy | Proxy configuration settings. |

#### Sample Input JSON

```json
{
  "searchQuery": "Anthropic",
  "maxItems": 5,
  "countries": [],
  "dateOption": "all-time",
  "proxy": {
    "useApifyProxy": true,
    "apifyProxyGroups": ["RESIDENTIAL"]
  }
}
```

***

### 📊 Output Data Structure

Each ad record pushed to the dataset includes rich, structured fields:

| Field | Type | Description |
|---|---|---|
| `adId` | String | Unique identifier of the ad. |
| `advertiserName` | String | Name of the advertiser or organization. |
| `creativeText` | String | Full ad copy / commentary text. |
| `ctaDestinationUrl` | String | Click-through destination URL or detail link. |
| `impressions` | String | Disclosed impression count or range (EU transparency). |
| `targetCountries` | Array | Target countries where the ad is served. |
| `headline` | String | Ad headline or preview title. |
| `creativeType` | String | Format: `IMAGE`, `VIDEO`, `DOCUMENT`, `CAROUSEL`, etc. |
| `mediaUrls` | Array | Direct URLs to creative media assets (images, document previews). |
| `advertiserUrl` | String | LinkedIn company profile page link. |
| `advertiserLogoUrl` | String | Advertiser profile / logo image URL. |
| `ctaText` | String | Call-to-action button text (e.g. "View details", "Learn more"). |
| `detailUrl` | String | Direct LinkedIn Ad Library permalink. |
| `payer` | String | Disclosed paying entity (when available). |
| `scrapedAt` | String | ISO 8601 timestamp of extraction. |

#### Sample Output Record

```json
{
  "adId": "1558880843",
  "advertiserName": "Anthropic",
  "creativeText": "Introducing Claude 3.5 Sonnet: our most intelligent model yet, raising the industry bar for intelligence.",
  "ctaDestinationUrl": "https://www.linkedin.com/ad-library/detail/1558880843",
  "impressions": "Not disclosed",
  "targetCountries": ["Worldwide"],
  "headline": "Claude 3.5 Sonnet Announcement",
  "creativeType": "IMAGE",
  "mediaUrls": [
    "https://media.licdn.com/dms/image/v2/D4D10AQ.../0/1790251695470?e=2147483647&v=beta"
  ],
  "advertiserUrl": "https://www.linkedin.com/company/anthropicresearch",
  "advertiserLogoUrl": "https://media.licdn.com/dms/image/v2/D560BAQ.../company-logo_100_100/...",
  "ctaText": "View details",
  "detailUrl": "https://www.linkedin.com/ad-library/detail/1558880843",
  "searchQuery": "Anthropic",
  "scrapedAt": "2026-09-28T02:30:00.000Z"
}
```

***

### 🏷️ Tags & Keywords

`linkedin` `linkedin-ads` `ad-library` `ad-spy` `competitor-analysis` `b2b-marketing` `lead-generation` `ad-creative` `crawlee` `apify`

# Actor input Schema

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

LinkedIn Ad Library URLs (e.g., https://www.linkedin.com/ad-library/search?keyword=Anthropic or ad detail URLs).

## `searchQuery` (type: `string`):

Keyword, phrase, or company name to search for in LinkedIn Ad Library.

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

Maximum number of ads to extract.

## `scrapeAdDetails` (type: `boolean`):

Fetch the full ad detail page for each ad to extract complete transparency data, payer info, and full targeting parameters.

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

Filter by 2-letter ISO country codes (e.g., \['US', 'GB', 'DE']). Leave empty for all countries.

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

Filter ads by date range.

## `proxy` (type: `object`):

Apify Proxy configuration. Residential proxies are recommended for scraping LinkedIn without rate limits or blocks.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.linkedin.com/ad-library/search?keywords=Anthropic"
    }
  ],
  "searchQuery": "Anthropic",
  "maxItems": 50,
  "scrapeAdDetails": true,
  "countries": [],
  "dateOption": "all-time",
  "proxy": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `results` (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?keywords=Anthropic"
        }
    ],
    "searchQuery": "Anthropic",
    "maxItems": 50,
    "proxy": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("madeingermany/linkedin-ads-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?keywords=Anthropic" }],
    "searchQuery": "Anthropic",
    "maxItems": 50,
    "proxy": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("madeingermany/linkedin-ads-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 '{
  "startUrls": [
    {
      "url": "https://www.linkedin.com/ad-library/search?keywords=Anthropic"
    }
  ],
  "searchQuery": "Anthropic",
  "maxItems": 50,
  "proxy": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call madeingermany/linkedin-ads-scraper --silent --output-dataset

```

## MCP server setup

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