# LinkedIn Ad Library Scraper - Ads, Creatives & Targeting (`spectre_scrape/linkedin-ad-library-scraper`) Actor

Scrape LinkedIn Ad Library ads by advertiser, keyword or payer. Get creative copy, images, CTA, destination, payer, run dates, impressions by country and targeting as JSON.

- **URL**: https://apify.com/spectre_scrape/linkedin-ad-library-scraper.md
- **Developed by:** [Spectre](https://apify.com/spectre_scrape) (community)
- **Categories:** 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

Pay per event

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

### What does LinkedIn Ad Library Scraper do?

**LinkedIn Ad Library Scraper** turns public [LinkedIn Ad Library](https://www.linkedin.com/ad-library/) results into clean, structured data. Search by **company, keyword or payer**, or paste any Ad Library URL, and get one row per ad with its **advertiser, payer, headline, copy, images, video, CTA, destination, run dates, impressions by country and targeting** — ready to export as JSON, CSV or Excel.

It is a lightweight **LinkedIn Ad Library API alternative** for competitor ad research, creative monitoring and ad-spend intelligence. No LinkedIn account, login or API key is required. The Actor runs on Apify, so you also get **scheduling, programmatic API access, webhooks and integrations** with tools such as n8n, Make and Zapier.

### Why use LinkedIn Ad Library Scraper?

The Ad Library is the official place to see which ads a company runs, but it is built for browsing, not for data work. This Actor handles the whole pipeline:

- Search by **advertiser, keyword, payer and country**, with date, impressions, targeting and sort filters.
- **Paginate automatically** and de-duplicate ads across pages.
- Optionally open every ad to add the **full detail payload**: payer, run dates, total impressions, impressions by country, targeting parameters, CTA and landing page.
- Capture **image, carousel and video creatives**, including the highest-bitrate MP4 for video ads.
- Works for the **US and every other market**, and returns the extra **EU and Brazil fields** (run dates, impressions, targeting) when LinkedIn publishes them.
- Returns clean, typed JSON — no HTML parsing, browser automation or maintenance on your side.

Use it for:

- Competitor ad-creative monitoring and swipe files.
- Ad-copy and landing-page research.
- Share-of-voice and creative-volume analysis.
- Payer and agency mapping.
- EU ad-transparency and targeting research.
- Building dashboards and datasets of LinkedIn ads.

### What data can LinkedIn Ad Library Scraper extract?

Search fields are always present. Detail fields are added when **Fetch ad details** is enabled. Run dates, impressions and targeting are only published by LinkedIn for ads in the **EU and Brazil**; elsewhere those fields are `null`.

| Field | Type | Description |
|---|---|---|
| `adId` | string | LinkedIn Ad Library ad ID |
| `detailUrl` | string | Public ad detail URL |
| `advertiserName` | string | Advertiser shown on the ad |
| `advertiserProfileUrl` | string | LinkedIn company page of the advertiser |
| `payer` | string | Entity that paid for the ad |
| `format` | string | Single Image Ad, Video Ad, Carousel Ad, Message Ad, Document Ad, etc. |
| `creativeType` | string | Raw LinkedIn creative type |
| `headline` | string | Creative headline |
| `description` | string | Supporting description under the headline |
| `copy` | string | Main ad copy |
| `ctaText` | string | CTA button text, for example Learn more |
| `destinationUrl` | string | Landing page with LinkedIn tracking removed |
| `imageUrl` | string | Primary creative image |
| `images` | array | All creative images (carousel slides included) |
| `videoUrl` | string | Highest-bitrate MP4 for video ads |
| `logoUrl` | string | Advertiser logo |
| `promoted` | boolean | Whether the ad is labelled Promoted |
| `runStartDate` | string | First run day, YYYY-MM-DD (EU/Brazil) |
| `runEndDate` | string | Last run day, YYYY-MM-DD (EU/Brazil) |
| `runDurationText` | string | Original run-date text |
| `impressionsTotal` | string | Estimated impressions bucket, e.g. `< 1k` (EU/Brazil) |
| `impressionsByCountry` | array | Country and share in percent (EU/Brazil) |
| `targeting` | array | Category, included/excluded values, targeted/excluded flags (EU/Brazil) |
| `variantsCount` | number | Number of creative variants |
| `searchCountries` | array | Country codes used in the search |
| `sourceUrl` | string | Search URL the ad was found on |
| `page` | number | Search result page |
| `position` | number | Position on the search page |
| `scrapedAt` | string | ISO timestamp of the search page |
| `detailScrapedAt` | string | ISO timestamp of the detail page |
| `hasDetails` | boolean | Whether the detail page was fetched |
| `detailError` | string | Error code when a detail page failed |

### How much does it cost to scrape LinkedIn ads?

This Actor is **pay-per-result**. Two events are charged:

- `listing-only` — one ad from a search page, without opening the detail page.
- `with-details` — one ad with the detail page opened (payer, dates, impressions, targeting, CTA, destination).

See the **Pricing** tab for the current rate. A typical ad costs well under one cent, and opening details costs roughly one extra HTTP request per ad. Apify proxy is used when your account can access it; the Actor falls back to no proxy otherwise. Switching to residential proxy raises proxy cost but not compute.

### How to use LinkedIn Ad Library Scraper

1. Enter a **Company / advertiser**, a **Keyword** or a **Payer**. At least one is required.
2. Pick one or more **Countries** (ISO codes such as `US`, `GB`, `DE`, `FR`, `BR`).
3. Optionally set **Date range**, **Impressions**, **Targeting** and **Sort order**.
4. Set **Maximum ads** and **Pages per search**. LinkedIn shows about 24 ads per page.
5. Leave **Fetch ad details** on for the full payload, or turn it off for a faster, cheaper listing-only run.
6. Run the Actor and export the dataset.

You can also paste **Start URLs** to use every filter LinkedIn supports, or to fetch specific ad detail pages.

#### Example input

```json
{
    "company": "Microsoft",
    "countries": ["US", "DE"],
    "dateOption": "last-30-days",
    "maxItems": 200,
    "maxPages": 10,
    "includeDetails": true,
    "delayBetweenRequestsMs": 2000,
    "proxyConfiguration": { "useApifyProxy": true }
}
```

#### Example output

```json
{
    "adId": "1646797314",
    "detailUrl": "https://www.linkedin.com/ad-library/detail/1646797314",
    "advertiserName": "Microsoft",
    "advertiserProfileUrl": "https://www.linkedin.com/company/1035",
    "payer": "ZENITH UK (MEDIA) LIMITED",
    "format": "Single Image Ad",
    "headline": "NIS2-Anforderungen in die Tat umsetzen",
    "copy": "NIS2 ist keine Zukunftsaufgabe mehr, sondern bereits eine operative Priorität. Im aktuellen IDC-Report finden Sie ...",
    "ctaText": "Mehr erfahren",
    "destinationUrl": "https://info.microsoft.com/...",
    "imageUrl": "https://media.licdn.com/dms/image/...",
    "runStartDate": "2026-11-24",
    "runEndDate": "2026-12-01",
    "impressionsTotal": "< 1k",
    "impressionsByCountry": [
        { "country": "Germany", "share": 71 },
        { "country": "Austria", "share": 29 }
    ],
    "targeting": [
        { "category": "Language", "includes": ["Deutsch"], "excludes": [], "targeted": null, "excluded": null }
    ],
    "hasDetails": true
}
```

### Input reference

| Input | Description |
|---|---|
| Start URLs | Ad Library search or detail URLs. Override the filters below. |
| Company / advertiser | `accountOwner` search, for example Microsoft. |
| Keyword | Word or phrase in ad copy. |
| Payer | Payer name shown in the Ad Library. |
| Countries | ISO alpha-2 codes, comma-combined in the request. |
| Date range | All time, last 30 days, current month, current year, last year or a custom range. |
| Impressions | Minimum and maximum, in thousands or millions. |
| Targeting included / excluded | Filter by language, location, audience, demographic, company, education, job or interests. EU/Brazil only. |
| Sort order | Newest to oldest or oldest to newest. |
| Maximum ads | Cap the run. 0 means no limit, up to 5,000. |
| Pages per search | About 24 ads per page. |
| Fetch ad details | Open each ad for payer, dates, impressions, targeting, CTA and destination. |
| Concurrency | Parallel detail requests, with the global delay still applied. |
| Delay between requests | Recommended 2,000 ms. Lower values can trigger HTTP 999. |
| Retries | Attempts per page, each with a new proxy IP. |
| Proxy configuration | Apify proxy when available, otherwise no proxy. If you see verification pages, set a group your account can access (for example RESIDENTIAL). |

### Limitations

- **Run dates, impressions and targeting are EU/Brazil only.** LinkedIn does not publish them for US and most other markets; the fields are `null` there.
- **Destination URLs can be missing.** Some ads, especially in the US, show a disabled CTA with no landing-page link. The Actor returns `null` rather than guessing.
- **Signed media URLs expire.** `imageUrl`, `images` and `videoUrl` carry LinkedIn expiry parameters; re-scrape to refresh them.
- **Pagination tokens are short-lived.** The Actor re-reads the token from each page and stops cleanly if LinkedIn expires it.
- **Heavy use can trigger HTTP 999.** Keep the 2,000 ms delay and retries on; if it persists, set a proxy group your account can access (for example RESIDENTIAL).
- The Actor reads only public Ad Library pages. It does not log in, bypass paywalls or access private data.

### FAQ

**Do I need a LinkedIn account?** No. The Ad Library is public and the Actor fetches it with plain HTTP.

**Can I search by advertiser and keyword at the same time?** Yes. Combine Company, Keyword and Payer; LinkedIn applies them together.

**Why are impressions empty for US ads?** LinkedIn only publishes impressions, run dates and targeting for ads shown in the EU and Brazil.

**Can I get the video file?** Yes. `videoUrl` is the highest-bitrate MP4 LinkedIn exposes for video ads.

**Can I schedule it?** Yes. Use Apify schedules, the API, webhooks or an integration such as n8n, Make or Zapier.

# Actor input Schema

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

Optional. Paste LinkedIn Ad Library search URLs (https://www.linkedin.com/ad-library/search?accountOwner=microsoft\&countries=US) or ad detail URLs (https://www.linkedin.com/ad-library/detail/1702623866). Search URLs keep every filter LinkedIn supports and override the fields below. Detail URLs return one ad each.

## `company` (type: `string`):

Advertiser name as it appears in the Ad Library, for example Microsoft, Nike or HubSpot. Matches the accountOwner search box.

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

Word or phrase to find in ad copy, for example AI, sustainability or Black Friday.

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

Payer name shown in the Ad Library, for example Starcom or a media agency. Payer is the entity that paid for the ad.

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

ISO 3166-1 alpha-2 country codes to search, for example US, GB, DE, FR, BR. Use EU countries or Brazil to get the extra EU fields: run dates, impressions and targeting.

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

How far back to search. Choose Custom date range to use the two date fields below.

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

First day of the custom range in YYYY-MM-DD format. Only used when Date range is Custom date range.

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

Last day of the custom range in YYYY-MM-DD format. Only used when Date range is Custom date range.

## `impressionsMin` (type: `integer`):

Only return ads with at least this many impressions. Combine with the unit below. Leave empty for no minimum.

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

Unit for the minimum impressions value.

## `impressionsMax` (type: `integer`):

Only return ads with at most this many impressions. Combine with the unit below. Leave empty for no maximum.

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

Unit for the maximum impressions value.

## `includedTargeting` (type: `array`):

Only return ads that target these parameter categories. Leave empty for any. This filter is available for ads in the EU and Brazil.

## `excludedTargeting` (type: `array`):

Only return ads that exclude these parameter categories. Leave empty for any. This filter is available for ads in the EU and Brazil.

## `sortOrder` (type: `string`):

Order of the search results.

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

Maximum ads to save across the run. 0 means no limit (up to 5,000).

## `maxPages` (type: `integer`):

Search result pages to load for each search target. LinkedIn shows about 24 ads per page.

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

Open each ad to add the payer, run dates, impressions, impressions by country, targeting, CTA and destination URL. Adds one request per ad. Run dates, impressions and targeting are only shown for ads in the EU and Brazil.

## `concurrency` (type: `integer`):

How many detail requests to run at once. Higher is faster and lowers compute cost; the minimum delay below still applies to every request.

## `delayBetweenRequestsMs` (type: `integer`):

Global pause between any two requests. 2,000 ms is the recommended minimum; lowering it can cause HTTP 999 or challenge pages.

## `retriesPerRequest` (type: `integer`):

Attempts per page before giving up. Each retry uses a new proxy IP.

## `requestTimeoutSecs` (type: `integer`):

How long to wait for a single page before retrying.

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

The Ad Library is public and works without a login. Apify proxy is used when your account can access it; otherwise the actor runs without a proxy. If you see HTTP 999 or verification pages, set a proxy group your account can access (for example RESIDENTIAL) or disable the proxy.

## `feedback` (type: `string`):

Optional: tell the maintainer what you needed or what was missing.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.linkedin.com/ad-library/search?accountOwner=microsoft&countries=US"
    }
  ],
  "company": "Microsoft",
  "keyword": "AI",
  "payer": "Starcom",
  "countries": [
    "US",
    "GB",
    "DE"
  ],
  "dateOption": "ALL",
  "startDate": "2026-01-01",
  "endDate": "2026-06-30",
  "impressionsMin": 1000,
  "impressionsMinUnit": "thousand",
  "impressionsMax": 100,
  "impressionsMaxUnit": "thousand",
  "sortOrder": "DESCENDING",
  "maxItems": 100,
  "maxPages": 5,
  "includeDetails": true,
  "concurrency": 3,
  "delayBetweenRequestsMs": 2000,
  "retriesPerRequest": 4,
  "requestTimeoutSecs": 60,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

Dataset with one row per LinkedIn ad.

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

Pages, ads, detail failures and proxy/block diagnostics.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("spectre_scrape/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 = {}

# Run the Actor and wait for it to finish
run = client.actor("spectre_scrape/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 '{}' |
apify call spectre_scrape/linkedin-ad-library-scraper --silent --output-dataset

```

## MCP server setup

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