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

\[$1.50–$1.20/1,000] Scrape LinkedIn Ad Library without login by advertiser, company ID, keyword, payer, combined search or URL. Get copy, media, CTAs, payer, run days, EU impressions & targeting, with monitoring and pre-billing filters. Details included.

- **URL**: https://apify.com/nexuscortex/linkedin-ad-library-scraper.md
- **Developed by:** [Nexus Cortex](https://apify.com/nexuscortex) (community)
- **Categories:** Marketing, Social media, Lead generation
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

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

Learn more: https://docs.apify.com/actors/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 Ads, EU Impressions & Targeting (No Login)

Scrape the public [LinkedIn Ad Library](https://www.linkedin.com/ad-library/search) without an account, cookies or headless browser: search by advertiser name, exact numeric **company ID**, keyword, payer, structured **combined search**, or pasted Ad Library / company URLs. Export every ad's copy, headline, all CTAs and Message reply buttons, creative media, Document manifest URL, landing page and — where LinkedIn publishes it — full EU DSA transparency data (`paidForBy`, `ranFrom`/`ranTo`, `daysRunning`, `totalImpressions` with integer bounds, `impressionsByCountry` and structured `targeting`).

**$1.50 per 1,000 ads** (details included at no extra charge, no monthly fee): Apify's Free plan ($5 monthly credit) covers about **3,333 ads with full details**.

Built for three jobs:

- **[Daily competitor ad monitoring](#monitor-competitor-ads-new-ads-only)**: track exact `companyIds` (or `accountOwners`) with a `monitorName` on a schedule — after the first run you receive and pay only for newly launched ads.
- **[EU ad-transparency & targeting analysis](#eu-transparency-impressions-and-targeting)**: filter by `countries`, `payers`, `minImpressions` / `maxImpressions` and `includedTargetingFacetCategories` / `excludedTargetingFacetCategories` to export impression buckets, country splits and targeted/excluded B2B facets.
- **[Creative & messaging intelligence](#quick-start-by-use-case)**: combine company + keyword + country inside `searches` (or sweep `keywords`), filter by `adFormats`, `includeKeywords`, `excludeKeywords` and `landingDomains` **before billing**, and export JSON, CSV or Excel.

#### Real dataset preview (Germany, last 30 days)

Measured on 30 November 2026 with the form prefill (`Salesforce`, `DE`, 20 ads, 72 s, 0 detail failures): **20/20** ads returned EU impressions and targeting, and **17/20 (85%)** exposed a landing page URL.

![LinkedIn Ad Library Scraper dataset output: advertiser, ad format, ad copy, payer, days running, EU impression bucket and landing domain for real Germany ads](https://api.apify.com/v2/key-value-stores/LdhYQ6wscDO8tCNUA/records/linkedin-ad-library-output-table.png)

| Advertiser (`advertiserCompanyId`) | Format | Headline / Ad Copy | Paid For By | Days | Impressions | Landing / Media |
| --- | --- | --- | --- | ---: | --- | --- |
| Salesforce (`3185`) | Single Image Ad | Get exclusive invitations, career tips, open... | Salesforce, Inc. | 18 | `200k-300k` | `careers.mail.salesforce.com` |
| Salesforce Data 360 (`104652760`) | Single Image Ad | Hear how Booking.com is using Data 360... | Salesforce, Inc. | 4 | `200k-300k` | `sforce.co` |
| Salesforce (`3185`) | Spotlight Ad | Join the Salesforce Talent Community | Salesforce, Inc. | 18 | `30k-50k` | `careers.mail.salesforce.com` |
| Salesforce (`3185`) | Event Ad | Meet Your New Coworker: Now, Your CRM... | Iprospect.com Inc. | 1 | `30k-50k` | `linkedin.com/events/...` |
| Salesforce (`3185`) | Carousel Ad | Nahtlose Customer Experience | Iprospect.com Inc. | 14 | `20k-30k` | `salesforce.com` |
| Salesforce (`3185`) | Message Ad | Hallo %FIRSTNAME%, KMU steigern ihre... | Iprospect.com Inc. | 29 | `10k-20k` | 2 reply buttons (`ctas`) |
| TechForce Services (`7789462`) | Document Ad | From Tool Sprawl to Exposure Control | TechForce Services Pty Ltd | 14 | `5k-10k` | PDF manifest + cover images |
| Ailo-IT | Partner (`13008823`) | Single Image Ad | Demo ohne SE für deine Deals in Financial... | Ailo-IT GmbH | 11 | `1k-5k` | `ailo-it.de` |

### Contents

- [What you can scrape](#what-you-can-scrape)
- [How to scrape LinkedIn Ad Library](#how-to-scrape-linkedin-ad-library)
- [Why use this LinkedIn Ad Library scraper](#why-use-this-linkedin-ad-library-scraper)
- [Quick start by use case](#quick-start-by-use-case)
- [Input](#input)
- [Output](#output)
- [Use it from code (API)](#use-it-from-code-api)
- [Use it with AI agents (MCP)](#use-it-with-ai-agents-mcp)
- [Scheduling, monitoring and webhooks](#scheduling-monitoring-and-webhooks)
- [Pricing](#pricing)
- [FAQ](#faq)
- [Limitations](#limitations)
- [Feedback](#feedback)
- [More scrapers from NexusCortex](#more-scrapers-from-nexuscortex)

### What you can scrape

- **Exact companies or broad keywords**: search by numeric `companyIds` (no fuzzy name collisions), `accountOwners`, `keywords`, `payers`, structured combined `searches`, or pasted `startUrls` (Ad Library search URLs, single ad detail URLs, and `/company/<id-or-slug>` pages).
- **All 11 LinkedIn ad formats**: `Single Image Ad`, `Video Ad`, `Carousel Ad`, `Document Ad` (including `documentUrl` manifest and slide covers), `Spotlight Ad`, `Text Ad`, `Message Ad` (including `messageSender` and every reply button in `ctas`), `Event Ad` (including `eventTime`), `Follower Ad`, `Job Ad` and `Article Ad`, plus Thought Leader `memberUrl` for personal `/in/` profiles.
- **Full EU DSA transparency**: `paidForBy`, `ranFrom` / `ranTo`, `daysRunning`, `totalImpressions`, integer `impressionsMin` / `impressionsMax`, per-country `impressionsByCountry`, and structured `targeting` (`targeted` and `excluded` per dimension, including hidden overflow location lists).
- **Pre-billing filtering**: filter by `adFormats`, `includeKeywords`, `excludeKeywords`, `landingDomains`, `minImpressions` / `maxImpressions`, and `includedTargetingFacetCategories` / `excludedTargetingFacetCategories` — rows that do not pass are never pushed, charged, or saved to monitoring memory.
- **New-ads-only monitoring**: pass a `monitorName` on scheduled runs so previously delivered `adId`s are skipped before detail fetches and before billing.

### How to scrape LinkedIn Ad Library

1. Click **Try for free** (or **Start**) and open the **Input** tab.
2. Keep the prefilled example (`Salesforce` in `DE`, `Max ads: 20`) to see live EU impressions and targeting on your first run, or enter your own **Company IDs**, **Companies / advertisers**, **Keywords**, or **Combined searches**.
3. Optional: narrow the **Date range**, **Countries**, **Minimum/Maximum impressions**, **Ad formats**, or **Pre-billing filters**.
4. Click **Start**. When the run finishes, open the **Output** tab (switch between **Ads overview** and **EU impressions & targeting** views) and export to JSON, CSV or Excel.

### Why use this LinkedIn Ad Library scraper

- **Exact `companyIds` eliminate name noise.** In our 30 November 2026 Germany test, searching `accountOwners: ["Salesforce"]` matched **103 ads** across 5 distinct advertisers (Salesforce plus partners and blogs mentioning "Salesforce"), whereas `companyIds: ["3185"]` returned **71 exact Salesforce ads**.
- **Details included at $1.50/1,000.** Competing scrapers charge up to $4.00/1,000 once detail pages are turned on or add a $0.005 per-run fee. Here detail pages are always included at $1.50/1,000 (down to $1.20/1,000 on Gold+).
- **Built not to time out.** Before reaching the run timeout, the Actor stops up to 45 seconds early, flushes what it collected, writes `SUMMARY` and monitor state, and ends `SUCCEEDED` with a clear status message instead of being killed mid-run.
- **Fast recovery on slow or rate-limited IPs.** Stalled requests hit a hard per-request deadline; consecutive slow proxy IPs rotate automatically; and automatic Apify Proxy sessions escalate to residential IPs after repeated 403/429/Cloudflare blocks.
- **No login, no cookies, no browser overhead.** Plain HTTP against LinkedIn's public Ad Library pages runs cleanly in 256 MB memory.

### Quick start by use case

#### Monitor competitor ads (new ads only)

Schedule this input daily to receive only newly launched ads from exact company IDs (`3185` = Salesforce, `68529` = HubSpot):

```json
{
    "companyIds": ["3185", "68529"],
    "countries": ["DE"],
    "dateOption": "last-30-days",
    "monitorName": "competitor-linkedin-ads",
    "maxItems": 100
}
```

#### Combined company + keyword search

Combine an exact company ID, a product keyword and a country in one native LinkedIn search without building a browser URL (tested on 30 November 2026: 19 matching ads, Event/Message/Single Image ads parsed with full details):

```json
{
    "searches": [
        {
            "companyId": "3185",
            "keyword": "AI",
            "countries": ["DE"],
            "dateOption": "last-30-days"
        }
    ],
    "includeDetails": true,
    "maxItems": 100
}
```

#### EU transparency, impressions and targeting

![EU ad transparency breakdown of 20 real Germany LinkedIn ads: total impression buckets and targeted vs excluded facets (location, job, language, company, audience)](https://api.apify.com/v2/key-value-stores/LdhYQ6wscDO8tCNUA/records/linkedin-ad-library-eu-targeting.png)

Pull EU ads with at least 10,000 impressions that actively target the `JOB` facet (verified against each ad's detail page before charging):

```json
{
    "accountOwners": ["Salesforce"],
    "countries": ["DE", "FR"],
    "dateOption": "last-30-days",
    "minImpressions": 10000,
    "includedTargetingFacetCategories": ["JOB"],
    "maxItems": 100
}
```

#### Creative & landing-domain research

Sweep a B2B keyword, keep only Single Image or Video creatives matching your terms and landing on specific domains, and pay nothing for skipped rows:

```json
{
    "keywords": ["ai crm"],
    "countries": ["US", "GB"],
    "adFormats": ["Single Image Ad", "Video Ad"],
    "includeKeywords": ["agent", "automation"],
    "excludeKeywords": ["hiring", "careers"],
    "landingDomains": ["salesforce.com", "hubspot.com"],
    "maxItems": 100
}
```

#### Payer transparency audit

Audit every ad paid for by a specific legal entity or agency within a custom date window:

```json
{
    "payers": ["Salesforce, Inc."],
    "countries": ["DE"],
    "startDate": "2026-11-01",
    "endDate": "2026-11-30",
    "maxItems": 100
}
```

#### Paste Ad Library search, detail or company URLs

Pass through any advanced LinkedIn Ad Library search URL, fetch individual ads by detail URL, or paste company pages:

```json
{
    "startUrls": [
        "https://www.linkedin.com/ad-library/search?accountOwner=Salesforce&keyword=AI&countries=DE&dateOption=last-30-days",
        "https://www.linkedin.com/company/68529",
        "https://www.linkedin.com/ad-library/detail/1689547946"
    ],
    "maxItems": 50
}
```

### How targeting works

Each entry of `accountOwners`, `companyIds`, `keywords` and `payers` runs as its **own independent search target** — they are never combined with each other. `countries`, `dateOption` (plus `startDate` / `endDate`), `minImpressions` / `maxImpressions` and targeting facet filters apply to all of these generated searches and to pasted `/company/` URLs. To combine multiple criteria in a single LinkedIn search, use `searches` (or paste a full `/ad-library/search?...` URL into `startUrls`). Pasted Ad Library search URLs are self-contained: `countries` and date fields do not modify them, though local pre-billing filters still apply when `includeDetails` is enabled.

### Input

| Field | Type | Description |
| --- | --- | --- |
| `accountOwners` | array | Advertiser names as typed in LinkedIn's advertiser box (prefilled with `["Salesforce"]`). Each entry is an independent target. |
| `companyIds` | array | Numeric LinkedIn company IDs (`"3185"`, `68529`) or numeric `/company/<id>` URLs. Each ID runs as an exact company search with no name collisions. |
| `keywords` | array | Keywords or phrases for LinkedIn's keyword search. Each entry is an independent target. |
| `payers` | array | Paying entity names ("Paid for by"), useful for political and EU transparency audits. Each entry is an independent target. |
| `startUrls` | array | `linkedin.com/ad-library/search?...` URLs (advanced parameters passed through), `linkedin.com/ad-library/detail/<id>` URLs (single ads), or `linkedin.com/company/<id-or-slug>` pages. |
| `searches` | array | Structured combined queries. Each object accepts `accountOwner`, `companyId`, `keyword`, `payer` (at least one required) plus optional per-entry overrides for `countries`, `dateOption`, `startDate`, `endDate`, `minImpressions`, `maxImpressions`, `includedTargetingFacetCategories` and `excludedTargetingFacetCategories`. |
| `countries` | array | Two-letter country codes (`US`, `DE`, `GB`…) or `ALL` (prefilled with `["DE"]`). Empty means no country restriction. Applies to generated searches and company URLs, not pasted Ad Library search URLs. |
| `dateOption` | enum | `last-30-days` (default), `current-month`, `current-year`, `last-year` or `custom-date-range`. |
| `startDate` / `endDate` | string | `YYYY-MM-DD`. Setting either one automatically switches `dateOption` to `custom-date-range`. |
| `adFormats` | array | Optional local pre-billing filter: `Single Image Ad`, `Video Ad`, `Carousel Ad`, `Document Ad`, `Spotlight Ad`, `Text Ad`, `Message Ad`, `Event Ad`, `Follower Ad`, `Job Ad`, `Article Ad`. Obvious mismatches skip detail requests too. |
| `minImpressions` / `maxImpressions` | integer | Optional non-negative total-impressions bounds (e.g. `10000`, `500000`). Sent to LinkedIn's native bilateral filter and verified against detail-page buckets before charging when `includeDetails` is on. |
| `includedTargetingFacetCategories` / `excludedTargetingFacetCategories` | array | Optional targeting-facet filters (`LANGUAGE`, `LOCATION`, `AUDIENCE`, `DEMOGRAPHIC`, `COMPANY`, `EDUCATION`, `JOB`, `INTERESTS_AND_TRAITS`), passed to LinkedIn and verified against detail-page EU targeting before charging when details are on. |
| `includeDetails` | boolean | Default `true`: fetch each ad's detail page for payer, exact format, fuller copy, landing link, Document manifest, Message reply buttons, Event time, and EU impressions/targeting. One extra request per ad, no extra charge. |
| `includeKeywords` | array | Deliver only ads whose body, headline, advertiser, CTAs, message sender, landing domain or payer matches at least one term. Applied before charging. |
| `excludeKeywords` | array | Drop ads matching any term. Obvious list-page matches skip detail requests and are never charged. |
| `landingDomains` | array | Deliver only ads landing on these domains or sub-domains (e.g. `example.com`). Non-EU ads without a public destination URL cannot pass. |
| `monitorName` | string | Deduplicate across runs with the same name: only ads not delivered before are pushed and charged. Any characters (including non-Latin scripts) are safely hashed into a store name. |
| `maxItems` | integer | Maximum delivered ads across all targets (default `200`, prefill `20`). One delivered ad = one charged result. |
| `maxAdsPerTarget` | integer | Maximum search-result cards scanned per target (default `200`), whether delivered, duplicate or filtered — keeps recurring monitors bounded. |
| `maxConcurrency` | integer | Targets scraped in parallel, `1`–`3` (default `2`). Request pacing applies inside each worker. |
| `proxyConfiguration` | object | Apify Proxy recommended (default `{"useApifyProxy": true}`). Automatic Apify Proxy escalates new sessions to residential IPs after 3 consecutive 403/429/Cloudflare blocks; user-specified proxy groups or URLs are respected without escalation. |

Filtered-out ads are counted in `SUMMARY.filteredOut` and are never pushed, charged, or added to the monitoring memory.

### Output

#### Sample output row (real run, trimmed)

```json
{
    "adId": "1689547836",
    "detailUrl": "https://www.linkedin.com/ad-library/detail/1689547836",
    "adFormat": "Single Image Ad",
    "creativeType": "SPONSORED_STATUS_UPDATE",
    "advertiserName": "Salesforce",
    "advertiserUrl": "https://www.linkedin.com/company/3185",
    "advertiserCompanyId": "3185",
    "memberUrl": null,
    "advertiserLogo": "https://media.licdn.com/dms/image/v2/.../salesforce_logo",
    "body": "At Salesforce, ambition meets action. Tech meets trust...",
    "headline": "Get exclusive invitations, career tips, open role alerts, & more!",
    "cta": "Join",
    "ctas": ["Join"],
    "destinationUrl": "https://careers.mail.salesforce.com/wtlv2/?...",
    "landingDomain": "careers.mail.salesforce.com",
    "mediaUrls": ["https://media.licdn.com/dms/image/v2/.../LinkedIn_TalentCommunity_1200x630-EMEApng"],
    "documentUrl": null,
    "hashtags": [],
    "commentaryLinks": [],
    "eventTime": null,
    "messageSender": null,
    "paidForBy": "Salesforce, Inc.",
    "ranFrom": "2026-11-13",
    "ranTo": "2026-11-30",
    "daysRunning": 18,
    "totalImpressions": "200k-300k",
    "impressionsMin": 200000,
    "impressionsMax": 300000,
    "impressionsByCountry": [
        { "country": "Israel", "percentage": "48%", "percentageValue": 48 },
        { "country": "United Arab Emirates", "percentage": "37%", "percentageValue": 37 },
        { "country": "South Africa", "percentage": "11%", "percentageValue": 11 }
    ],
    "targeting": {
        "location": { "targeted": ["Israel", "United Arab Emirates", "South Africa", "Germany"], "excluded": false },
        "language": { "targeted": ["English"], "excluded": false },
        "job": { "targeted": true, "excluded": false },
        "company": { "targeted": false, "excluded": true }
    },
    "searchType": "accountOwner",
    "searchQuery": "Salesforce",
    "hasDetails": true,
    "scrapedAt": "2026-11-30T03:46:42.118Z"
}
```

#### Output field reference

| Field | Type | Description |
| --- | --- | --- |
| `adId` | string | LinkedIn Ad Library ad ID. |
| `detailUrl` | string | null | Canonical public detail page URL. |
| `adFormat` | string | null | Readable format (`Single Image Ad`, `Video Ad`, `Carousel Ad`, `Document Ad`, `Spotlight Ad`, `Text Ad`, `Message Ad`, `Event Ad`, `Follower Ad`, `Job Ad`, `Article Ad`). Search rows may show `Single Image / Video Ad` until refined on the detail page. |
| `creativeType` | string | null | LinkedIn's raw creative type, e.g. `SPONSORED_STATUS_UPDATE`, `SPONSORED_MESSAGE`, `SPONSORED_UPDATE_NATIVE_DOCUMENT`. |
| `advertiserName` / `advertiserUrl` / `advertiserLogo` | string | null | Advertiser display name, public LinkedIn page URL and logo image URL. |
| `advertiserCompanyId` | string | null | Numeric LinkedIn company ID extracted from a company `advertiserUrl` (e.g. `"3185"`), or `null` for personal profiles. |
| `memberUrl` | string | null | Canonical `/in/<slug>` URL without tracking parameters when the advertiser is a personal Thought Leader profile, otherwise `null`. |
| `body` | string | null | Main ad copy (including Message Ad body paragraphs; detail pages often carry fuller text than search cards). |
| `headline` | string | null | Creative headline or Document Ad deck title when present. |
| `cta` | string | null | First CTA or Message Ad reply-button label when publicly shown. |
| `ctas` | array | Deduplicated list of all CTA and Message Ad reply-button labels in DOM order. |
| `destinationUrl` / `landingDomain` | string | null | Public destination URL (often omitted by LinkedIn on non-EU ads) and its lowercase hostname without `www.`. |
| `mediaUrls` | array | Deduplicated creative media URLs: images, video posters/sources, carousel images and Document Ad cover pages. |
| `documentUrl` | string | null | Document manifest URL from a Document Ad's embedded viewer config, or `null`. |
| `hashtags` / `commentaryLinks` | array | Deduplicated `#hashtags` and non-hashtag links (with `trk` stripped) from the ad commentary. |
| `eventTime` | string | null | Event date/time string shown on Event Ads (e.g. `November 4, 2026, 4:55 PM UTC`). |
| `messageSender` | string | null | Sender name shown above a Message Ad body. |
| `paidForBy` | string | null | Paying entity from the detail page ("Paid for by" prefix removed). |
| `ranFrom` / `ranTo` | string | null | First and last run dates (`YYYY-MM-DD`) when LinkedIn publishes them. |
| `daysRunning` | number | null | Inclusive run length in days when both dates are valid (same-day ad = `1`), otherwise `null`. |
| `totalImpressions` | string | null | Raw impression bucket (`200k-300k`, `< 1k`, `1M-2M`). |
| `impressionsMin` / `impressionsMax` | number | null | Integer bounds of `totalImpressions` (`0`/`1000` for `< 1k`). |
| `impressionsByCountry` | array | null | `[{country, percentage, percentageValue}]` per-country shares (`< 1%` uses `0.5`). Empty array when the detail page has no EU impressions section; `null` without details. |
| `targeting` | object | null | EU targeting transparency keyed by parameter (`location`, `language`, `audience`, `demographic`, `company`, `education`, `job`, `memberInterestsAndTraits`) with `targeted` and `excluded` booleans or value arrays. |
| `searchType` / `searchQuery` | string | null | Target kind (`accountOwner`, `companyId`, `keyword`, `payer`, `search`, `startUrl`, `detailUrl`) and its value. |
| `hasDetails` | boolean | `true` when merged with a successfully fetched detail page; `false` if details were disabled or that ad's detail fetch failed. If 5 detail pages in a row fail, the run stops and is marked failed (ads already delivered stay in the dataset), so a broken or blocked detail page costs you at most 4 list-only rows instead of a whole run of them. |
| `scrapedAt` | string | ISO-8601 timestamp of delivery. |

Each run also writes a `SUMMARY` JSON record to the default key-value store with `items`, `seconds`, `requests`, `failedRequests`, `rateLimited`, `sessions`, `residentialEscalations`, `detailFailures`, `filteredOut`, `requestLatency` (`count`, `p50Ms`, `p90Ms`, `maxMs`, `rotations`), `ignoredInputs`, `monitor`, `targets`, `errors`, `stoppedBeforeTimeout`, and `fatalError` (set when the run stopped because detail pages kept failing).

### Use it from code (API)

#### Node.js

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

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('nexuscortex/linkedin-ad-library-scraper').call({
    companyIds: ['3185'],
    countries: ['DE'],
    dateOption: 'last-30-days',
    maxItems: 100,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items[0].paidForBy, items[0].daysRunning, items[0].impressionsByCountry);
```

#### Python (with pandas analysis)

```python
import os
import pandas as pd
from apify_client import ApifyClient

client = ApifyClient(os.environ["APIFY_TOKEN"])
run = client.actor("nexuscortex/linkedin-ad-library-scraper").call(run_input={
    "searches": [
        {"companyId": "3185", "keyword": "AI", "countries": ["DE"], "dateOption": "last-30-days"}
    ],
    "includeDetails": True,
    "maxItems": 100,
})
df = pd.DataFrame(client.dataset(run["defaultDatasetId"]).list_items().items)
print(df[["advertiserName", "adFormat", "daysRunning", "totalImpressions", "landingDomain"]].head(10))
df.to_csv("linkedin-ads.csv", index=False)
```

#### cURL

```sh
curl -X POST "https://api.apify.com/v2/acts/nexuscortex~linkedin-ad-library-scraper/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"searches": [{"companyId": "3185", "keyword": "AI", "countries": ["DE"]}], "maxItems": 50}'
```

### Use it with AI agents (MCP)

This Actor works with the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp). Add `https://mcp.apify.com` to Claude, Cursor or your AI agent and ask:

> *"Use nexuscortex/linkedin-ad-library-scraper to pull the latest 50 LinkedIn ads from company ID 3185 in Germany, summarize the main ad formats, landing domains and EU impression ranges."*

### Scheduling, monitoring and webhooks

1. Create an Apify **Schedule** (daily or weekly) pointing to this Actor.
2. Set `companyIds` (or `searches`) and a stable `monitorName` such as `competitor-linkedin-ads`.
3. Attach an Apify **Webhook** (or Slack / Google Sheets / n8n / Make integration) triggered on `ACTOR.RUN.SUCCEEDED` so newly launched competitor ads land directly in your team's channel or sheet.

Already-delivered `adId`s are stored in a named key-value store, skipped before their detail page is fetched, and never billed twice.

### Pricing

Pay-per-event: **$1.50 per 1,000 results** (one `result` event per delivered ad — detail pages are free), plus Apify's fixed **$0.00005** `apify-actor-start` per run. Subscriber discounts apply automatically:

| Plan | Price per 1,000 ads | 1,000 ads | 10,000 ads |
| --- | --- | --- | --- |
| Free / regular | $1.50 | $1.50 | $15.00 |
| Bronze | $1.35 | $1.35 | $13.50 |
| Silver | $1.275 | $1.275 | $12.75 |
| Gold and above | $1.20 | $1.20 | $12.00 |

- **Free plan ($5/month credit)**: covers roughly **3,333 ads** with full EU details.
- **Daily competitor monitor example**: tracking 5 competitors that launch ~30 new ads/day costs `30 × 30 / 1,000 × $1.50` = **$1.35/month** (plus ~$0.0015 in start fees).
- **Hard budget cap**: set a **Maximum cost per run** in Apify Console or via API — the Actor stops cleanly at the last affordable ad. Filtered-out and previously monitored ads cost **$0**.

### FAQ

**What is the difference between `accountOwners` and `companyIds`?**
`accountOwners` matches LinkedIn's advertiser text box, which does fuzzy matching (e.g. searching `"Salesforce"` also returns partner companies and blogs with "Salesforce" in their name). `companyIds` (such as `"3185"`) queries LinkedIn's exact numeric organization ID so you get only that company's ads. You can read any company's ID from `advertiserCompanyId` in a previous run or from its LinkedIn URL.

**Can I combine an advertiser and a keyword in one search?**
Yes. Use `searches` (e.g. `[{"companyId": "3185", "keyword": "AI", "countries": ["DE"]}]`), or paste a `/ad-library/search?...` URL directly into `startUrls`.

**Why are `totalImpressions`, `impressionsByCountry` and `targeting` null on some ads?**
LinkedIn only publishes impression buckets, country shares and targeting disclosures for ads served in the European Union (under the EU Digital Services Act). Non-EU ads typically show `paidForBy` and creative content only. Set `countries` to an EU member state (e.g. `["DE"]`, `["FR"]`) to focus on EU-disclosed ads.

**Are filtered-out or duplicate ads charged?**
No. `adFormats`, `includeKeywords`, `excludeKeywords`, `landingDomains`, `minImpressions` / `maxImpressions`, targeting facet filters and `monitorName` deduplication all run before pushing to the dataset, so dropped or previously seen rows are never charged.

**What happens if a large run approaches its timeout?**
Up to 45 seconds before the platform timeout (or 20% of the budget on short runs), the Actor stops starting new pages/requests, flushes collected ads, saves `SUMMARY` (with `stoppedBeforeTimeout: true`) and monitor state, and ends `SUCCEEDED` so you keep all results collected so far.

**Do I need a LinkedIn account, cookies or API key?**
No. Everything collected is publicly visible on `linkedin.com/ad-library` without logging in.

### Limitations

- **EU transparency applies only where LinkedIn publishes it.** In our 30 November 2026 Germany test, 20/20 ads had impressions, country splits and targeting, and 17/20 (85%) exposed a destination URL. Ads targeting only non-EU countries usually have `null` for `totalImpressions`, `impressionsByCountry`, `targeting` and often `destinationUrl`.
- **Search cards vs detail copy.** LinkedIn sometimes truncates copy on search cards; keeping `includeDetails: true` (the default) fetches the fuller detail page at no extra charge.
- **Rolling archive.** LinkedIn Ad Library displays active and recently active ads (roughly the last 12 months), not a permanent historical archive.
- **Anonymous rate limits.** LinkedIn rate-limits anonymous traffic per IP. The Actor paces requests (~1.2 s per worker), rotates slow sessions, retries transient 403/429/Cloudflare blocks and escalates automatic Apify Proxy sessions to residential IPs when needed. Keep `maxItems` and `maxAdsPerTarget` bounded and prefer `monitorName` over repeating full scrapes.
- **Deduplication scope.** Ads are deduplicated by `adId` within every run; cross-run deduplication is active only when `monitorName` is set.

### Feedback

Found a layout change, missing format detail or feature request? Open an issue on the Actor's Store page — the fixture-driven test suite makes LinkedIn DOM updates quick to ship. If this Actor saved you time, a short review helps others discover it.

### More scrapers from NexusCortex

Explore our other pay-per-event Actors on the [NexusCortex profile](https://apify.com/nexuscortex): **Threads Search Scraper**, **TikTok Creative Center Top Ads Scraper**, **Facebook Ads Library Scraper**, **Google Ads Transparency Center Scraper**, **Google Play Scraper** and **App Store Scraper**.

# Actor input Schema

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

Advertiser names exactly as you would type them into LinkedIn Ad Library, e.g. Salesforce. Each entry is scraped as its own independent search target.

## `companyIds` (type: `array`):

Numeric LinkedIn company IDs such as "3185" or 68529. Company page URLs like https://www.linkedin.com/company/3185 are accepted too. Each ID is scraped as its own independent exact company search.

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

Words or phrases to search in ads, exactly as in LinkedIn's keyword box. Each entry is its own independent search target; use Combined searches to combine a keyword with an advertiser, company, payer or other filters.

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

Optional two-letter country codes such as US, GB or DE, or ALL. Empty means no country restriction. Applies to searches generated from the fields above, not to pasted search URLs.

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

Stop after this many delivered ads in total across all targets. Each delivered ad is one charged result.

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

Payer names exactly as in LinkedIn's payer search box (useful for political and EU transparency research). Each entry is its own independent search target.

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

Paste linkedin.com/ad-library/search?... URLs for combined searches, linkedin.com/ad-library/detail/<adId> URLs for individual ads, or linkedin.com/company/<id-or-slug> company pages. Ad Library search URLs are self-contained; company pages use the shared Countries, date, impressions and targeting fields.

## `searches` (type: `array`):

Structured combined queries. Each entry needs at least one of advertiser, company ID, keyword or payer; the conditions are combined in one LinkedIn search. Omitted filter fields inherit the top-level values and explicitly set fields override them.

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

Ads that ran in this period. Applies to generated searches, not to pasted search URLs. If startDate or endDate is set, this automatically becomes a custom date range.

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

Optional YYYY-MM-DD. Setting this or Custom end date automatically switches Date range to custom-date-range.

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

Optional YYYY-MM-DD. Must not be before Custom start date.

## `adFormats` (type: `array`):

Optional local filter. Deliver only these readable LinkedIn ad formats. Generic search-list formats are resolved on detail pages when Include ad details is on. Applied before charging.

## `minImpressions` (type: `integer`):

Optional non-negative lower total-impressions bound, e.g. 10000. Sent to LinkedIn as its native impressions filter and verified against detail-page buckets before charging when details are enabled.

## `maxImpressions` (type: `integer`):

Optional non-negative upper total-impressions bound, e.g. 500000. Must not be lower than Minimum impressions.

## `includedTargetingFacetCategories` (type: `array`):

Optional LinkedIn targeting-facet filter. Deliver ads whose EU transparency data marks these categories as targeted; detail-page verification happens before charging when details are enabled.

## `excludedTargetingFacetCategories` (type: `array`):

Optional LinkedIn targeting-facet filter. Deliver ads whose EU transparency data marks these categories as excluded; detail-page verification happens before charging when details are enabled.

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

Read each ad's public detail page and add payer, exact format, fuller copy, landing link where public, and EU impressions/targeting when shown. One extra request per ad, no extra charge. Detail URLs are always read as detail pages.

## `includeKeywords` (type: `array`):

Optional. Deliver only ads whose body, headline, advertiser, CTA, landing domain or payer matches at least one of these words or phrases. Applied before charging.

## `excludeKeywords` (type: `array`):

Optional. Drop ads whose body, headline, advertiser, CTA, landing domain or payer matches any of these words or phrases. Obvious matches skip the detail request and are never charged.

## `landingDomains` (type: `array`):

Optional. Deliver only ads whose public destination URL is on one of these domains or a sub-domain, e.g. example.com or https://www.example.com/shop. Many non-EU ads do not expose a destination and cannot pass this filter.

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

Optional. Runs with the same name deliver and charge only ads not delivered by earlier runs. Schedule the Actor daily with a stable name to build a new-ads feed. Names may contain Chinese or special characters; they are hashed into a valid store name.

## `maxAdsPerTarget` (type: `integer`):

Stop scanning each target after this many unique search-result cards, whether they are delivered, duplicates or filtered out. Keeps recurring monitors bounded.

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

How many targets to scrape at once, from 1 to 3. LinkedIn request pacing still applies inside every worker.

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

Apify Proxy is recommended. With automatic Apify Proxy, the Actor starts on the regular pool and switches new sessions to residential proxies after repeated 403/429/Cloudflare blocks. Choosing your own groups or URLs disables that escalation and is respected exactly.

## Actor input object example

```json
{
  "accountOwners": [
    "Salesforce"
  ],
  "countries": [
    "DE"
  ],
  "maxItems": 20,
  "dateOption": "last-30-days",
  "adFormats": [],
  "includedTargetingFacetCategories": [],
  "excludedTargetingFacetCategories": [],
  "includeDetails": true,
  "maxAdsPerTarget": 200,
  "maxConcurrency": 2,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

One item per public LinkedIn ad.

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

Delivered counts, requests, filters, proxy escalations, per-target results and errors.

# 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 = {
    "accountOwners": [
        "Salesforce"
    ],
    "countries": [
        "DE"
    ],
    "maxItems": 20,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("nexuscortex/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 = {
    "accountOwners": ["Salesforce"],
    "countries": ["DE"],
    "maxItems": 20,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("nexuscortex/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 '{
  "accountOwners": [
    "Salesforce"
  ],
  "countries": [
    "DE"
  ],
  "maxItems": 20,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call nexuscortex/linkedin-ad-library-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,nexuscortex/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/8Lk1SOg8pbDnES9qa/builds/3SJwajJYaPHNy1rIC/openapi.json
