# LinkedIn Ads Library - B2B Competitor Ads (`webdata_labs/linkedin-ads-library-scraper`) Actor

\[💵 $3.00 / 1K] Scrape public LinkedIn Ad Library ads by keyword, advertiser, payer, country, and date range. Built for B2B marketers who need competitor creatives, ad copy, CTA links, formats, and detail URLs in CSV/JSON.

- **URL**: https://apify.com/webdata\_labs/linkedin-ads-library-scraper.md
- **Developed by:** [Open Web Team](https://apify.com/webdata_labs) (community)
- **Categories:** Social media, Lead generation, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.40 / 1,000 ad rows

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 a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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 Ads Library Scraper - See What Competitors Are Running

**Export every B2B competitor's LinkedIn ads in one run - the creatives, copy, and CTAs they are actually testing, not what they claim in case studies.**

This Actor scrapes the public **LinkedIn Ad Library** by keyword, advertiser, payer, country, and date range, and returns clean ad rows (advertiser, format, headline, body, media URLs, detail URL) plus a per-search summary. Built for B2B marketers, growth teams, agencies, and sales researchers who would otherwise click through the Ad Library by hand.

### ✅ What you get / ❌ what this isn't

| ✅ This Actor gives you | ❌ This Actor is not |
|---|---|
| Live competitor ads: real creatives and copy | Not their marketing narrative or case-study claims |
| Search by keyword, advertiser, payer, country, date | Not a single-query tool you run over and over |
| Clean structured rows + a per-search summary | Not raw HTML you have to parse |
| Public Ad Library only - no login | Not private LinkedIn profile or account data |

### 🔎 Why use this Actor

- **See live competitor ads**, not their marketing narrative - real creatives and copy from the public Ad Library.
- **Search any angle:** keyword, advertiser/company, payer, country, and date range, in any combination.
- **Clean structured rows:** advertiser, creative type, ad format, headline, body, image/video thumbnail, and the LinkedIn detail URL.
- **One summary row per search** so you can see how many ads and advertisers a query returned at a glance.
- **No login.** Reads only the public Ad Library - no LinkedIn account, cookies, or credentials.
- **Export anywhere:** CSV, JSON, Excel, or the Apify API.

### 👥 Who it's for

B2B marketers, growth teams, agencies, and sales researchers. Common jobs:

- Monitor competitor LinkedIn ads by keyword or advertiser.
- Build B2B creative swipe files.
- Research SaaS positioning, offers, and hooks.
- Track agency or payer activity.
- Export LinkedIn ad examples for AI analysis or reporting.

### Example tasks

- [Research AI customer support ads on LinkedIn](https://apify.com/webdata_labs/linkedin-ads-library-scraper/examples/linkedin-ads-ai-customer-support-research)
- [Find LinkedIn competitor ads by company](https://apify.com/webdata_labs/linkedin-ads-library-scraper/examples/linkedin-competitor-ads-by-company)
- [Research B2B SaaS LinkedIn ad copy](https://apify.com/webdata_labs/linkedin-ads-library-scraper/examples/b2b-saas-linkedin-ad-copy-research)

### ⚙️ How to scrape the LinkedIn Ad Library

1. Open the Actor on Apify.
2. Enter `queries` (keywords), `accountOwners` (advertisers), or `payers` - any combination.
3. Narrow by `countries` and `dateOption` if you want.
4. Set `maxResults` (defaults low so the first run stays cheap).
5. Click **Start**.
6. Download CSV/JSON/Excel or pull from the Apify API.

### 📥 Input

```json
{
  "queries": ["ai customer support"],
  "accountOwners": ["Notion"],
  "payers": [],
  "countries": ["US"],
  "dateOption": "LAST_30_DAYS",
  "maxResults": 100,
  "includeDetailPages": true,
  "requestDelayMs": 750
}
````

Search by keyword, company/advertiser, payer, or any combination. `maxResults` defaults low so the first run stays cheap and predictable.

### 📤 Output

**Ad rows** - one per ad:

```json
{
  "recordType": "ad",
  "adId": "1460951094",
  "advertiser": "Parahelp",
  "creativeType": "SPONSORED_STATUS_UPDATE",
  "adFormat": "Single Image Ad",
  "headline": "AI customer support",
  "body": "Lots of other AI support solutions...",
  "ctaText": null,
  "detailUrl": "https://www.linkedin.com/ad-library/detail/1460951094",
  "imageUrl": "https://media.licdn.com/...",
  "searchKeyword": "ai customer support",
  "countries": ["US"]
}
```

The dataset also includes a `search_summary` row per search with the ad and advertiser counts.

### 💵 How much does it cost?

You pay per result row plus Apify platform usage. `maxResults` defaults low so the first run is cheap and predictable. Cost scales with `maxResults` and whether `includeDetailPages` is on (detail pages add requests per ad).

### 🔁 Run it on the Apify platform

Schedule recurring competitor monitoring, call it from the Apify API, export to CSV/JSON/Excel, or pipe ad copy into Make, Zapier, webhooks, or an AI analysis step.

### ⚠️ Limits and caveats

- Reads LinkedIn's public Ad Library only; it does not collect private profile data.
- Available fields depend on what LinkedIn exposes publicly for each ad format.
- LinkedIn can change its public HTML, so selectors may need maintenance.
- Some landing-page URLs sit behind LinkedIn redirects or are not shown on the public page.

### 🧩 Related Actors

Pair with the rest of the B2B research toolkit:

- **Website Contact Extractor** - turn advertiser domains into verified contacts.
- **Lead List Deduplicator & Normalizer** - clean the lists you build.

### ❓ FAQ

**Do I need a LinkedIn account?** No. It reads only the public Ad Library; no login, cookies, or credentials.

**Can I search by company?** Yes - use `accountOwners` for advertisers and `payers` for who paid, alone or combined with keywords.

**Does it scrape private data?** No. It collects only what LinkedIn exposes publicly for each ad.

### 🛠️ Support

If a run fails or a field is missing, open an Actor issue with the run URL, the input you used, and the field or behavior you expected.

# Actor input Schema

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

Keywords or phrases to search in LinkedIn's public Ad Library.

## `accountOwners` (type: `array`):

Optional company / advertiser names to search. Leave empty to search only by keyword.

## `payers` (type: `array`):

Optional payer names to search. Useful when ads are paid by an agency or parent company.

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

Optional ISO country codes. Use ALL or leave empty to search all countries.

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

LinkedIn Ad Library date filter.

## `maxResults` (type: `integer`):

Maximum ad rows to return across all searches. Low default keeps the first run cheap.

## `includeDetailPages` (type: `boolean`):

Fetch each ad detail page to enrich rows with fuller text and external destination hints when available. Slower but better output.

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

Polite delay between LinkedIn requests.

## Actor input object example

```json
{
  "queries": [
    "ai customer support",
    "data warehouse"
  ],
  "accountOwners": [
    "Notion",
    "HubSpot"
  ],
  "payers": [],
  "countries": [
    "US"
  ],
  "dateOption": "LAST_30_DAYS",
  "maxResults": 100,
  "includeDetailPages": true,
  "requestDelayMs": 750
}
```

# Actor output Schema

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

No description

## `summary` (type: `string`):

No description

## `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 = {
    "queries": [
        "ai customer support",
        "data warehouse"
    ],
    "accountOwners": [
        "Notion",
        "HubSpot"
    ],
    "countries": [
        "US"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("webdata_labs/linkedin-ads-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 = {
    "queries": [
        "ai customer support",
        "data warehouse",
    ],
    "accountOwners": [
        "Notion",
        "HubSpot",
    ],
    "countries": ["US"],
}

# Run the Actor and wait for it to finish
run = client.actor("webdata_labs/linkedin-ads-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 '{
  "queries": [
    "ai customer support",
    "data warehouse"
  ],
  "accountOwners": [
    "Notion",
    "HubSpot"
  ],
  "countries": [
    "US"
  ]
}' |
apify call webdata_labs/linkedin-ads-library-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "LinkedIn Ads Library - B2B Competitor Ads",
        "description": "[💵 $3.00 / 1K] Scrape public LinkedIn Ad Library ads by keyword, advertiser, payer, country, and date range. Built for B2B marketers who need competitor creatives, ad copy, CTA links, formats, and detail URLs in CSV/JSON.",
        "version": "0.1",
        "x-build-id": "ZofOTEOW1YlTcoXXc"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/webdata_labs~linkedin-ads-library-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-webdata_labs-linkedin-ads-library-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/webdata_labs~linkedin-ads-library-scraper/runs": {
            "post": {
                "operationId": "runs-sync-webdata_labs-linkedin-ads-library-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/webdata_labs~linkedin-ads-library-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-webdata_labs-linkedin-ads-library-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "queries": {
                        "title": "Keywords",
                        "type": "array",
                        "description": "Keywords or phrases to search in LinkedIn's public Ad Library.",
                        "default": [
                            "ai customer support"
                        ],
                        "items": {
                            "type": "string"
                        }
                    },
                    "accountOwners": {
                        "title": "Companies or advertisers",
                        "type": "array",
                        "description": "Optional company / advertiser names to search. Leave empty to search only by keyword.",
                        "default": [],
                        "items": {
                            "type": "string"
                        }
                    },
                    "payers": {
                        "title": "Payers",
                        "type": "array",
                        "description": "Optional payer names to search. Useful when ads are paid by an agency or parent company.",
                        "default": [],
                        "items": {
                            "type": "string"
                        }
                    },
                    "countries": {
                        "title": "Countries",
                        "type": "array",
                        "description": "Optional ISO country codes. Use ALL or leave empty to search all countries.",
                        "default": [
                            "US"
                        ],
                        "items": {
                            "type": "string"
                        }
                    },
                    "dateOption": {
                        "title": "Date range",
                        "enum": [
                            "ALL",
                            "LAST_30_DAYS",
                            "LAST_90_DAYS",
                            "LAST_YEAR"
                        ],
                        "type": "string",
                        "description": "LinkedIn Ad Library date filter.",
                        "default": "LAST_30_DAYS"
                    },
                    "maxResults": {
                        "title": "Max ads",
                        "minimum": 1,
                        "maximum": 1000,
                        "type": "integer",
                        "description": "Maximum ad rows to return across all searches. Low default keeps the first run cheap.",
                        "default": 100
                    },
                    "includeDetailPages": {
                        "title": "Fetch detail pages",
                        "type": "boolean",
                        "description": "Fetch each ad detail page to enrich rows with fuller text and external destination hints when available. Slower but better output.",
                        "default": true
                    },
                    "requestDelayMs": {
                        "title": "Delay between requests (ms)",
                        "minimum": 0,
                        "maximum": 5000,
                        "type": "integer",
                        "description": "Polite delay between LinkedIn requests.",
                        "default": 750
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
