# LinkedIn Ad Library Scraper — Full Ad Details, No Login (`valev-lab/linkedin-ad-library-scraper`) Actor

Scrape public LinkedIn Ad Library ads with no login or cookies. Search by company, keyword, or payer. Export ad copy, CTAs, EU impressions, targeting, and the paying entity to JSON or CSV. From $0.55/1,000 ads.

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

## Pricing

from $0.55 / 1,000 ad with details

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

Scrape the public [LinkedIn Ad Library](https://www.linkedin.com/ad-library/) without a login. Full ad details, EU impressions, and targeting, **from $0.55 / 1,000 ads**.

This Actor reads only the public Ad Library. It does not log in, does not use cookies, and does not open member profiles, the feed, or company pages except for the company id already linked from an ad. It is not affiliated with, endorsed by, or sponsored by LinkedIn or Microsoft.

### Who it is for

- **Competitive intelligence** teams comparing one brand's live ads in a single country.
- **Agencies** pulling EU impression ranges and targeting before a pitch.
- **B2B marketers** collecting advertisers around a keyword such as a product category.

### What data you get

| Always, for every delivered ad | EU ads only | Never published here |
| --- | --- | --- |
| Ad id, library URL, advertiser, format, headline, body, CTA, image URLs, and the MP4 URL of a video ad | Total impressions as a range | Spend, budgets, or bids |
| Paying entity, when the page prints it | Impressions by country | The values inside a targeting category |
| Click URL with `utm_*` kept and `trk` removed | Targeting sentences, including the hidden "N others" list | A downloaded image, video file, or landing page |
| | First shown, last shown, days running, active flag. LinkedIn prints run dates mostly for EU ads; otherwise these are empty | |

The detail page is what makes an ad "with details". For every ad it adds the paying entity, the full ad text, the company id, CTA buttons, the click URL, and the video MP4 when the ad has them. For ads shown in the EU it also adds run dates, impressions, and targeting. LinkedIn does not publish those three for ads shown only outside the EU, so a search without an EU country often returns many ads without them.

A listing-only run (`scrapeAdDetails: false`) keeps the card fields and skips the detail page. That run is billed at the lower listing rate.

An empty run is the health check: HubSpot, Germany, 5 ads, details on.

### Input

| Field | Default | What it does |
| --- | --- | --- |
| `companies` | — | Name, `/company/{id}` URL, or numeric company id. A name stays an exact advertiser match. |
| `keywords` | — | Ad-text keyword. |
| `payers` | — | Paying entity, such as `HubSpot, Inc.` |
| `countries` | — | ISO-2 or an English name. `Germany` becomes `DE`. |
| `dateOption` | `all-time` | Preset window. The library keeps about 12 months. |
| `startDate`, `endDate` | — | `YYYY-MM-DD` or `30 days`. Setting either one forces a custom range, because LinkedIn ignores the dates otherwise. The end is never today. |
| `impressionsMinValue`, `impressionsMaxValue` | — | EU impressions bounds. One side is filled when the other is missing. |
| `includedTargetingFacetCategories` | — | Targeting facet filter. Combined with a country, LinkedIn may ignore the country. |
| `searches` | — | Extra searches. Omitted filters are copied from the top level. `company`, `keyword`, and `payer` are accepted too. |
| `adTypes` | all | Client-side format filter. A non-empty list reads extra pages. |
| `startUrls` | — | An Ad Library search URL is replayed. A detail URL is one ad. |
| `adIds` | — | Numeric ids, fetched as detail pages. |
| `maxItems` | `100` | Delivered ads. The empty-input health check uses 5. The form prefill is 25. |
| `maxItemsPerSearch` | — | Second cap on each search. |
| `scrapeAdDetails` | `true` | Turn off for the cheaper listing. |
| `includeRelatedAdvertisers` | `false` | Also keep other advertisers that appear on a name search. |
| `includeAdvertiserSummary` | `false` | Also add one uncharged summary row per advertiser to the dataset. The summary is always saved as `ADVERTISER_SUMMARY` in the key-value store. |
| `proxy` | Apify datacenter | The first datacenter block moves the rest of the run to residential, unless you set groups or your own URLs. |
| `maxConcurrency` | `3` | Detail pages at once. Each session waits at least 2.5 seconds. |

### Quick starts

HubSpot in Germany, 25 ads:

```json
{ "companies": ["HubSpot"], "countries": ["DE"], "maxItems": 25 }
```

Keyword, last 30 days, listing only:

```json
{ "keywords": ["Smart CRM"], "countries": ["DE"], "dateOption": "last-30-days", "scrapeAdDetails": false, "maxItems": 25 }
```

One ad:

```json
{ "adIds": ["1585176223"] }
```

### Output

One dataset row per delivered ad. Info, error, and advertiser-summary rows are not charged.

```json
{
  "rowType": "ad",
  "adId": "1585176223",
  "advertiserName": "HubSpot",
  "advertiserCompanyId": "68529",
  "format": "Single Image",
  "headline": "Bereit für den Wechsel?",
  "paidBy": "HubSpot, Inc.",
  "firstShownAt": "2026-10-20",
  "lastShownAt": "2026-11-03",
  "daysRunning": 14,
  "totalImpressionsRaw": "100k-150k",
  "totalImpressionsMin": 100000,
  "totalImpressionsMax": 150000,
  "detailStatus": "ok",
  "matchType": "exact"
}
```

`RUN_SUMMARY` and `ADVERTISER_SUMMARY` are always written to the key-value store. Impression sums on the summary are EU-only.

A failed detail page is still delivered, with `detailStatus: "failed"` and `detailsPartial: true`, and it is billed at the listing rate. A detail page that returns 404 uses `not_found` and the same listing rate.

### Pricing

Pay per delivered ad, plus one start event. These are the live Console rates. Platform usage is included in the event price.

| Event | Free | Bronze | Silver | Gold | What it covers |
| --- | ---: | ---: | ---: | ---: | --- |
| Actor start | $0.00005 | $0.00005 | $0.00005 | $0.00005 | Once per run |
| Ad with details | $0.00140 | $0.00083 | $0.00065 | $0.00055 | `detailStatus: ok`: the detail page loaded. EU impressions, targeting, and dates are included only when LinkedIn publishes them |
| Ad | $0.00070 | $0.000415 | $0.000325 | $0.000275 | Listing, failed detail, or not found |

**Free, 1,000 detailed ads:** `$0.00005 + 1000 × $0.00140 = $1.40005`.

**Free, 1,000 listing ads:** `$0.00005 + 1000 × $0.00070 = $0.70005`.

**Free, health check (5 detailed ads):** `$0.00005 + 5 × $0.00140 = $0.00705`.

You pay only for delivered ads. A failed detail page is billed at the listing rate. Duplicate ads, related ads you excluded, format-filtered cards, info rows, error rows, and advertiser summaries are free. Company-id lookups are free.

Remove the default dataset event in Console. Otherwise a free row can be charged.

### How it works

The Actor requests the public HTML with a browser-like HTTP client. It does not open a browser. Search pages are followed with the library's own pagination token. The token is copied as published. The last page still includes that token and is detected with `isLastPage`.

A company name is resolved from up to two detail pages. When both pages show the same company id, the search switches to that id. The lookup is not billed.

### Limits

- The library keeps about 12 months. Older start dates are moved forward. A range that ends today is moved to yesterday.
- Impressions and targeting are published for EU delivery. US-only ads often have those fields empty.
- Announced totals and delivered rows can differ. A shortfall is not a failed run.
- Targeting categories say whether a parameter was used. The values inside the category are not on the page.
- Images are not downloaded and landing pages are not followed.

### FAQ

**Do I need a LinkedIn account?** No.

**Why is the country filter ignored?** LinkedIn has ignored `countries` when a targeting facet is also set. The run logs that combination.

**Why did dates return the unfiltered total?** Dates are ignored unless the request uses a custom range. This Actor sets that range whenever you pass a start or end date.

**What happens when the proxy is blocked?** The first datacenter block switches to residential for the rest of the run. If you set your own proxy groups or URLs, the run keeps your setting and says so when every search is blocked.

### For AI agents

Call the Actor with `companies`, `keywords`, or `adIds`. Read the default dataset. Use `detailStatus` before trusting impressions. `rowType: "advertiserSummary"` rows are rollups, not ads. `RUN_SUMMARY` is the run report.

### Integrations

The dataset exports as JSON, CSV, Excel, or XML. Schedule a run in the Apify Console, call it from the Apify API, or connect it through Zapier, Make, or n8n. Saved tasks for HubSpot in Germany, a keyword search, and a single ad are in `docs/STORE_CONSOLE.md`.

### Disclaimer

LinkedIn, the LinkedIn logo, and Microsoft are trademarks of their owners. This Actor is an independent tool that reads the public Ad Library.

# Changelog

This Actor's version history is a separate document: https://apify.com/valev-lab/linkedin-ad-library-scraper/changelog.md

# Actor input Schema

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

Advertiser names, company page URLs, or numeric company ids. A name is matched exactly. A numeric id uses companyIds.

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

Words matched against the ad text.

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

The legal entity that paid for the ad, such as HubSpot, Inc.

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

ISO-2 codes or English country names. DE is Germany. Leave empty for every country.

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

A preset window. If you set a start or end date, the run switches to a custom range so LinkedIn honors the dates.

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

YYYY-MM-DD, or a relative value such as 30 days. Dates before the 12-month window are moved forward.

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

YYYY-MM-DD, or a relative value. A window that ends today is moved to yesterday, because today returns no ads.

## `impressionsMinValue` (type: `integer`):

Lower bound of the EU impressions range. If you set only one side, the other side is filled so LinkedIn accepts the filter.

## `impressionsMinUnit` (type: `string`):

none is the exact number, thousand multiplies by 1,000, million by 1,000,000.

## `impressionsMaxValue` (type: `integer`):

Upper bound of the EU impressions range.

## `impressionsMaxUnit` (type: `string`):

none is the exact number, thousand multiplies by 1,000, million by 1,000,000.

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

Ads that include one of these targeting categories. Combined with a country, LinkedIn may ignore the country.

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

Ads that exclude one of these targeting categories.

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

Each entry is another search. Omitted filters are copied from the fields above. Use company, keyword, or payer (singular or plural).

## `adTypes` (type: `array`):

Keep these formats. Empty keeps every format. The library has no server-side format filter, so a non-empty list reads extra pages.

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

Ad Library search URLs are replayed. Ad detail URLs are fetched as single ads. Other URLs are rejected.

## `adIds` (type: `array`):

Numeric Ad Library ids. Each one is fetched as a detail page.

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

Stop after this many delivered ads. The default run with no search uses 5.

## `maxItemsPerSearch` (type: `integer`):

A second cap applied to each company, keyword, payer, or start URL.

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

Open each ad. Details add the paying entity, full text, CTA, click URL, and video file for every ad, plus impressions, targeting, and run dates when LinkedIn publishes them (EU ads). Turn this off for a cheaper listing.

## `includeEmployerBranding` (type: `boolean`):

Employer-brand tiles have no ad id. They are included only when the page contains both a company id and a channel id.

## `includeRelatedAdvertisers` (type: `boolean`):

A company name search otherwise keeps only the exact advertiser. Turn this on to also keep partners shown on the same name search.

## `includeAdvertiserSummary` (type: `boolean`):

Also add one uncharged summary row per advertiser to the dataset. Off keeps the dataset to ads only. The same summary is always saved in the key-value store and linked in the Output tab.

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

Datacenter by default. The first datacenter block switches to residential unless you set proxy groups or your own proxy URLs.

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

How many ad pages to open at once. Each session waits at least 2.5 seconds between its own requests.

## `minDelay` (type: `integer`):

Extra wait between requests on one session. The run never goes below 2.5 seconds.

## `maxDelay` (type: `integer`):

Upper bound of the random wait on one session.

## `debug` (type: `boolean`):

Reserved for extra request logging.

## Actor input object example

```json
{
  "companies": [
    "HubSpot"
  ],
  "countries": [
    "DE"
  ],
  "dateOption": "all-time",
  "impressionsMinUnit": "thousand",
  "impressionsMaxUnit": "thousand",
  "maxItems": 25,
  "scrapeAdDetails": true,
  "includeEmployerBranding": false,
  "includeRelatedAdvertisers": false,
  "includeAdvertiserSummary": false,
  "proxy": {
    "useApifyProxy": true
  },
  "maxConcurrency": 3,
  "minDelay": 1,
  "maxDelay": 3,
  "debug": false
}
```

# Actor output Schema

## `dataset` (type: `string`):

Delivered ads, plus uncharged info or error rows. Advertiser summary rows are added only when includeAdvertiserSummary is on.

## `runSummary` (type: `string`):

Searches, proxy tiers, and advertiser totals for this run.

## `advertiserSummary` (type: `string`):

One object per advertiser. Impression sums cover EU transparency ads only.

# 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 = {
    "companies": [
        "HubSpot"
    ],
    "countries": [
        "DE"
    ],
    "maxItems": 25
};

// Run the Actor and wait for it to finish
const run = await client.actor("valev-lab/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 = {
    "companies": ["HubSpot"],
    "countries": ["DE"],
    "maxItems": 25,
}

# Run the Actor and wait for it to finish
run = client.actor("valev-lab/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 '{
  "companies": [
    "HubSpot"
  ],
  "countries": [
    "DE"
  ],
  "maxItems": 25
}' |
apify call valev-lab/linkedin-ad-library-scraper --silent --output-dataset

```

## MCP server setup

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