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

\[from $1.44/1K ads] Scrape LinkedIn ads from the LinkedIn Ad Library by keyword, advertiser, payer or company ID: ad copy, headline, format, image, video, CTA, landing page, who paid, run dates, impressions by country and targeting. Only-new-ads mode for monitoring. No login.

- **URL**: https://apify.com/lergassy/linkedin-ad-library-scraper.md
- **Developed by:** [Matvey](https://apify.com/lergassy) (community)
- **Categories:** Lead generation, AI
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.44 / 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/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** turns the public [LinkedIn Ad Library](https://www.linkedin.com/ad-library) into a table of ads: **advertiser, format, ad copy, headline, image or video, carousel cards, document and event details** — and, with one switch, **who paid for the ad, when it ran, total impressions, impressions by country, targeted languages and locations, which targeting criteria were used, the call-to-action button and the landing page with its UTM parameters**. One row per ad.

Search by **keyword, advertiser name, payer or LinkedIn company ID**, or paste any Ad Library link. Filter by country and date. No LinkedIn account, no login, no cookies — it reads the same public pages anyone can open, so no account of yours is ever at risk.

**From $1.44 per 1,000 ads on paid plans. Impressions, targeting and landing page: from +$0.96 per 1,000.** On the Apify Free plan: $1.60 and +$1.60 per 1,000. No start fee. Searches that find nothing and errors are free.

### Tested head-to-head — 15 October 2026

Same job for this Actor and the five most-used LinkedIn ad library Actors in the Store: HubSpot's ads shown in the US, 20 ads, with ad details.

| | This Actor | Other LinkedIn ad library Actors |
|---|---|---|
| Ads delivered (asked for 20) | **20** | 0–20 (one returned an empty table with a green status, one stopped at 10 on the Free plan) |
| Columns per ad | **47** | 17–30 |
| Headline filled | **19 of 20** | 1 of 20 at the most-used Actor |
| Image or video cover filled | **20 of 20** | 13 of 20 at the most-used Actor |
| Time | 27 s | 5–56 s (53 s at the most-used Actor) |
| Price per 1,000 ads with details, Free plan | **$3.20, no start fee** | $4.00 + start fee at the most-used Actor |

Impressions, run dates and targeting exist only for ads LinkedIn reports under the EU Digital Services Act — for a US-only search every Actor gets them for the same one ad in 20.

### What is LinkedIn Ad Library Scraper?

A **LinkedIn ads scraper** and unofficial **LinkedIn Ads API** for competitor research on B2B advertising. LinkedIn has to publish every ad that runs on its platform in the Ad Library; this Actor reads that library for you and returns clean, flat rows you can sort, filter and load into a spreadsheet, a BI tool, a CRM or an AI agent.

Typical questions it answers: *Which ads is my competitor running on LinkedIn right now? Which formats and offers do they test? Which countries see their ads and how many impressions do they get? Who do they target — by job, company or audience? Which landing pages and UTM campaigns do they send people to?*

It runs from the Apify Console, the API, a schedule, n8n, Make, Zapier or an MCP client, and it works without a browser, so even large exports finish in seconds.

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

Every ad row carries these fields:

| Field | Example | Meaning |
|---|---|---|
| `advertiserName` | `HubSpot` | Company or person shown as the advertiser |
| `advertiserType` | `company` | `company` or `person` |
| `format` | `Single Image Ad` | LinkedIn's own format name |
| `text` | `Your CRM bill grows every time you hire…` | Ad copy (shortened preview on search results; full text with details) |
| `headline` | `Live-Webinar am 14.10.2026 um 11 Uhr` | Headline of the creative |
| `imageUrl` | `https://media.licdn.com/…` | Ad image, video cover, article cover, document first page or first carousel card |
| `url`, `adId` | `https://www.linkedin.com/ad-library/detail/1558746953` | The ad's page in the Ad Library |
| `isThoughtLeaderAd`, `memberName` | `true`, `Charlotte Davies` | A company promoting a member's post, and whose post it is |
| `carouselCards` | `[{title, imageUrl}]` | Carousel ads: every card |
| `documentTitle`, `documentTotalPages` | `How AI Is Changing Commerce…`, `13` | Document ads |
| `eventName`, `eventTime`, `eventLocation` | `CIO Summit…`, `February 3, 2026…`, `Basel, CH` | Event ads |
| `senderName` | `Isla Sutherland` | Message ads: who the message comes from |
| `searchTerm`, `position` | `crm`, `1` | Which search found the ad and its rank |

#### 📊 Impressions, targeting and landing page (details option)

Turn on **Add impressions, countries, targeting and landing page to every ad ($)** and the Actor opens each ad's page in the Ad Library and adds:

| Field | Example |
|---|---|
| `paidBy` | `IXTENSA GmbH & Co. KG` |
| `ranFrom`, `ranTo`, `runDays` | `2026-09-24`, `2026-09-30`, `7` |
| `impressions`, `impressionsMin`, `impressionsMax` | `1k-5k`, `1000`, `5000` |
| `impressionsByCountry`, `topCountry` | `[{country: "Germany", share: "100%", percent: 100}]`, `Germany` |
| `targetingLanguages`, `targetingLocations` | `["English"]`, `["Germany"]` |
| `targetedParameters`, `excludedParameters`, `targetingCriteria` | `["Audience", "Company", "Job"]` |
| `ctaText` | `Sign Up` |
| `landingUrl`, `landingDomain`, `utmParameters` | `https://lp.ixtensa.de/webinar…`, `lp.ixtensa.de`, `{utm_campaign: …, hsa_cam: …}` |
| `advertiserUrl`, `advertiserCompanyId` | `https://www.linkedin.com/company/7267658`, `7267658` |
| `videoUrl` | MP4 file of a video ad |
| `text` | the full ad copy instead of the shortened preview |

**Where impressions and targeting come from.** LinkedIn publishes run dates, impressions by country and targeting for ads it reports under the EU Digital Services Act — ads that reached people in the EU. For an ad shown only outside the EU, LinkedIn's page carries the advertiser, payer and creative but no impressions or targeting, and those fields stay empty in your row. In our tests every ad found with a German or French country filter had impressions and targeting (64 of 64); with a US and UK filter, 3 of 10 did. The Actor never estimates numbers LinkedIn does not show.

### 💰 How much does it cost to scrape the LinkedIn Ad Library?

Pay per result, nothing else:

| Event | Free plan | Starter (Bronze) | Scale (Silver) | Business (Gold) |
|---|---|---|---|---|
| Ad (from search results) | $0.0016 ($1.60 / 1K) | **$0.00144 ($1.44 / 1K)** | $0.0008 ($0.80 / 1K) | $0.00044 ($0.44 / 1K) |
| Ad details — impressions, countries, targeting, landing page | +$0.0016 (+$1.60 / 1K) | **+$0.00096 (+$0.96 / 1K)** | +$0.0004 (+$0.40 / 1K) | +$0.00036 (+$0.36 / 1K) |
| Searches with no ads, error rows, start of a run | free | free | free | free |

So 1,000 ads with all details cost **$2.40** on Starter, $1.20 on Scale, $0.80 on Business and $3.20 on the Free plan. Platinum and Diamond plans pay the Business price.

On the Apify free plan the monthly $5 credit buys about **3,100 ads** without details or **1,550 with details**. For comparison, the most-used LinkedIn ad library Actor in the Store charges $2 per 1,000 ads without details and $4 with details on the Free plan, $1.80 and $3.00 on Starter, $1.00 and $1.50 on Scale, $0.55 and $1.00 on Business, plus a start fee per run (Store prices on 15 October 2026). This Actor is 20% cheaper on every plan and has no start fee.

**Monitoring is cheaper still:** with *Only new ads* on, a daily run pays only for ads you have not received before — see below.

### How to scrape LinkedIn ads

1. Open the Actor in the Apify Console and press **Try for free** (an Apify account is free).
2. In **Search terms** type what you are looking for, one per line — a keyword (`crm`), an advertiser (`hubspot`) or a company ID (`1337`).
3. Pick **Search by**: keyword, advertiser name, payer or LinkedIn company ID.
4. Optionally add **Countries** (`US`, `GB`, `DE`…) and a **Date range**.
5. Turn on **Add impressions, countries, targeting and landing page** if you need them.
6. Press **Start**. The default search — 24 ads about CRM shown in the US — finishes in under 20 seconds.
7. Download the table as Excel, CSV or JSON, or open it in Google Sheets.

### ⬇️ Input

```json
{
    "searchTerms": ["hubspot"],
    "searchType": "advertiser",
    "countries": ["DE", "FR"],
    "maxAdsPerSearch": 100,
    "includeDetails": true,
    "dateRange": "last-30-days"
}
```

| Field | What it does |
|---|---|
| `searchTerms` | One search per line |
| `searchType` | `keyword`, `advertiser`, `payer` or `companyId` |
| `countries` | Two-letter country codes; empty = all countries |
| `maxAdsPerSearch` | Ads per search line, 1–5,000 (default 24) |
| `includeDetails` | Impressions, targeting, landing page ($) |
| `dateRange` | `any`, `last-30-days`, `current-year`, `last-year` |
| `startDate`, `endDate` | Exact range, `YYYY-MM-DD` |
| `sortOrder` | `newest` (default) or `oldest` |
| `startUrls` | LinkedIn Ad Library links instead of search terms |
| `onlyNewRowsStore` | Memory name for only-new-ads monitoring |

#### Search LinkedIn ads by keyword

`"searchType": "keyword"` finds ads whose copy contains the word — the way to map a whole category (`crm`, `cybersecurity`, `webinar`).

#### Search LinkedIn ads by advertiser or company

`"searchType": "advertiser"` matches the advertiser's name. Matching is partial: `hubspot` returns HubSpot's own ads and those of HubSpot partners. For exactly one company use `"searchType": "companyId"` with the number from its LinkedIn URL — `linkedin.com/company/1337` is LinkedIn itself; you can paste the whole URL. `"searchType": "payer"` matches the *Paid for by* entity, which often differs from the advertiser (agencies, legal entities).

#### Paste LinkedIn Ad Library URLs

Set up any search on linkedin.com/ad-library and paste the address into **Ad Library URLs** — every filter of the page is kept. A single ad's link (`/ad-library/detail/<id>`) returns that ad with full details.

### ⬆️ Output

One JSON object per ad. A shortened example with details on:

```json
{
    "type": "ad",
    "adId": "1558746953",
    "url": "https://www.linkedin.com/ad-library/detail/1558746953",
    "advertiserName": "IXTENSA 🧡 HubSpot",
    "advertiserType": "company",
    "format": "Single Image Ad",
    "text": "Viele HubSpot-Kunden kämpfen mit denselben Problemen …",
    "headline": "Live-Webinar am 14.10.2026 um 11 Uhr",
    "imageUrl": "https://media.licdn.com/dms/image/v2/…",
    "isThoughtLeaderAd": false,
    "searchType": "advertiser",
    "searchTerm": "hubspot",
    "position": 1,
    "detailsScraped": true,
    "advertiserUrl": "https://www.linkedin.com/company/7267658",
    "advertiserCompanyId": "7267658",
    "paidBy": "IXTENSA GmbH & Co. KG",
    "ranFrom": "2026-09-24",
    "ranTo": "2026-09-30",
    "runDays": 7,
    "impressions": "1k-5k",
    "impressionsMin": 1000,
    "impressionsMax": 5000,
    "topCountry": "Germany",
    "impressionsByCountry": [{ "country": "Germany", "share": "100%", "percent": 100 }],
    "targetingLanguages": ["English"],
    "targetingLocations": ["Germany"],
    "targetedParameters": ["Audience", "Company", "Job"],
    "ctaText": "Sign Up",
    "landingUrl": "https://lp.ixtensa.de/webinar-hubspot-probleme?utm_campaign=…",
    "landingDomain": "lp.ixtensa.de",
    "utmParameters": { "utm_campaign": "Webinar HubSpot Probleme", "hsa_cam": "775147223" },
    "scrapedAt": "2026-10-01T08:13:39+00:00"
}
```

The Console shows four tabs: **Ads** (the overview), **Impressions & targeting**, **Creative** and **Errors & notes**.

#### Error rows

Explanations come after the ads, never above them, and are never charged:

- `type: "notice"`, `kind: "no-results"` — a search that found no ads, with a hint what to change (`error` holds the text). A search with no ads is a valid answer, not a failure.
- `type: "notice"`, `kind: "input"` — something in the input was corrected or ignored (an unknown country, Start date after End date — the two are swapped); the text is in `notice`. Country names such as `Germany` or `USA` are understood and need no correction.
- `type: "error"` — a line that could not be searched (a company name typed as an ID, a link that is not from the Ad Library, a search term without letters) or an ad page LinkedIn refused several times; the text is in `error`.

### 🔁 Get only new LinkedIn ads — schedule it

A one-off export is useful once; a feed of competitors' **new** ads is useful every day. Fill **Only new ads — memory name** (for example `my-ads-watch`) and the Actor remembers every ad it delivered under that name. Every later run with the same name writes — and charges — **only ads you have not received before**. Ads delivered earlier are skipped before their page is even opened, so details are not paid twice either.

1. Run once with the memory name to load the current ads.
2. Open the run → **Actions → Schedule** (or [Schedules](https://console.apify.com/schedules)) and set daily or weekly.
3. Read the new ads from each run's dataset, or connect a webhook, Slack, n8n, Make or Zapier.

Each memory name is separate: one per competitor list or market. To start over, use a new name.

### Use cases for LinkedIn ads data

#### Competitor B2B ads monitoring

Track every ad a competitor launches, the offers and formats they test and how long each ad runs. `runDays` and the order of `ranFrom` show which creatives they keep paying for.

#### Ad impressions by country and market sizing

`impressionsByCountry` shows where a campaign actually reached people. Compare competitors' footprint across European markets before you enter one.

#### Targeting research

`targetedParameters` and `targetingLocations` tell you whether a competitor targets by job title, company list, audience or demographics — and where.

#### Creative inspiration and copywriting

Pull hundreds of ads in your category with headlines, copy, CTAs and images, and feed them to an LLM to find patterns in hooks and offers.

#### Agency pitches and sales prospecting

Find companies that advertise on LinkedIn in a category (they have budget), then enrich them with our [LinkedIn Company Scraper](https://apify.com/lergassy/linkedin-company-scraper).

#### Landing page and UTM analysis

`landingUrl` and `utmParameters` reveal campaign names, LinkedIn campaign IDs (`hsa_cam`) and funnel pages.

### Integrations

#### Apify API

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_API_TOKEN>")
run = client.actor("lergassy/linkedin-ad-library-scraper").call(run_input={
    "searchTerms": ["1337"],
    "searchType": "companyId",
    "maxAdsPerSearch": 50,
    "includeDetails": True,
})
for ad in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(ad["advertiserName"], ad["format"], ad.get("impressions"))
```

```javascript
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: '<YOUR_API_TOKEN>' });
const run = await client.actor('lergassy/linkedin-ad-library-scraper').call({
    searchTerms: ['crm'], countries: ['US'], maxAdsPerSearch: 100,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
```

#### No-code: n8n, Make, Zapier, Google Sheets

Use the Apify app in n8n, Make or Zapier: *Run Actor* → *Get dataset items*. For Sheets, use the Google Sheets integration on the Actor's Integrations tab.

#### MCP server for AI agents

Connect `https://mcp.apify.com/?actors=lergassy/linkedin-ad-library-scraper` to Claude, ChatGPT, Cursor or any MCP client, then ask: *"Which ads did HubSpot run in Germany in the last 30 days, and which countries got the most impressions?"*

### 🤖 For AI Agents & LLM Apps

Actor `lergassy/linkedin-ad-library-scraper`. **Purpose:** one row per LinkedIn ad from the public LinkedIn Ad Library; answers which ads an advertiser runs, in which formats, with which copy, and — with `includeDetails` — who paid, run dates, impressions by country, targeting and landing page.

**Minimal input:** `{"searchTerms": ["hubspot"], "searchType": "advertiser"}`

**Output fields:** type, adId, url, advertiserName, advertiserType, format, creativeType, text, textTruncated, headline, imageUrl, isThoughtLeaderAd, searchType, searchTerm, position, searchUrl, detailsScraped, scrapedAt; optional advertiserHeadline, advertiserLogoUrl, memberName, memberHeadline, memberPhotoUrl, description, carouselCards, documentTitle, documentPages, documentTotalPages, eventName, eventTime, eventLocation, senderName, senderPhotoUrl; with details advertiserUrl, advertiserCompanyId, paidBy, ranFrom, ranTo, runDays, impressions, impressionsMin, impressionsMax, topCountry, impressionsByCountry, targetingLanguages, targetingLocations, targetingExcludedLocations, targetedParameters, excludedParameters, targetingCriteria, ctaText, landingUrl, landingDomain, utmParameters, videoUrl, variantCount.

**Behaviors an agent should know:**

- `startUrls` overrides `searchTerms`. `startDate`/`endDate` override `dateRange`.
- `maxAdsPerSearch` defaults to 24 per search line.
- `text` is a ~120-character preview (`textTruncated: true`) unless `includeDetails` is on.
- Impressions and targeting exist only for ads LinkedIn reports under the EU DSA; empty means LinkedIn does not show them, not zero.
- `advertiser` matches names partially; use `companyId` for one exact company.
- Billed per ad row (`ad`) and per detailed ad (`ad-details`); error rows are free.

### ❓ FAQ

#### Is it legal to scrape the LinkedIn Ad Library?

The Ad Library is a public transparency tool that LinkedIn publishes for anyone to search without logging in, and this Actor reads only those public pages. It does not log in or touch private profiles. Ads can contain names of people (Thought Leader ads, message senders); if you store or process them, the GDPR and similar laws apply to you. Check LinkedIn's terms and consult a lawyer for your specific use.

#### Does it need a LinkedIn account or cookies?

No. Nothing is logged in, so there is no account to get restricted.

#### Can I use LinkedIn Ad Library Scraper with the Apify API?

Yes — every run can be started and read over the REST API or the Python and JavaScript clients above. It works as a LinkedIn Ads API for ad intelligence.

#### Can I use it through an MCP server?

Yes, through the Apify MCP server; see Integrations. The input fields are designed so an agent can call the Actor correctly without reading this page.

#### Can I integrate it with other apps?

Yes: n8n, Make, Zapier, Google Sheets, Slack, webhooks, and anything that can call an HTTP API.

#### How much does a typical run cost?

On the Starter plan: 24 ads without details about $0.035, 1,000 ads with all details $2.40. On the Free plan: about $0.04 and $3.20. You see the cost of each run in the Console.

#### How many ads can I get per search?

Up to 5,000 per search line per run. LinkedIn serves 24 per page; 300 ads took 37 seconds in our test.

#### Why are impressions empty for some ads?

LinkedIn shows impressions, run dates and targeting only for ads it reports under the EU Digital Services Act. Ads that never reached the EU have no such data on LinkedIn's page.

#### Is it one row per ad?

Yes. The same ad found by two search lines in one run appears once.

### Your feedback

Something missing or wrong? Open an issue on the Issues tab — we answer quickly and fix what we can. If the Actor saves you time, a review helps other buyers find it.

### You might also like

Our **ad intelligence trio** covers the three big ad libraries:

| Actor | What it does |
|---|---|
| [Google Ads Transparency Scraper](https://apify.com/lergassy/google-ads-transparency-scraper) | Every ad an advertiser runs on Google Search, YouTube and Display |
| [Meta Ad Library Scraper](https://apify.com/lergassy/meta-ad-library-scraper) | Facebook and Instagram ads from the Meta Ad Library |
| [LinkedIn Company Scraper](https://apify.com/lergassy/linkedin-company-scraper) | Size, industry, followers and HQ of the advertisers you find here |
| [LinkedIn Jobs Scraper](https://apify.com/lergassy/linkedin-jobs-scraper) | Who the advertiser is hiring |
| [LinkedIn Posts Scraper](https://apify.com/lergassy/linkedin-posts-scraper) | A company's organic posts next to its paid ads |

**Also known as:** LinkedIn ads scraper, LinkedIn Ads API, LinkedIn ad library API, LinkedIn ad spy tool, LinkedIn competitor ads, scrape LinkedIn ads, LinkedIn sponsored content scraper, B2B ad intelligence, LinkedIn ad impressions by country.

# Actor input Schema

## `searchTerms` (type: `array`):

One search per line. What a line means depends on <b>Search by</b>: a keyword from the ad copy (<code>crm</code>), an advertiser name (<code>hubspot</code>), a payer name, or a LinkedIn company ID (<code>1337</code> or <code>linkedin.com/company/1337</code>). Each line is billed only for the ads it returns.

## `searchType` (type: `string`):

How to read the search terms. <b>Keyword</b> finds ads whose copy contains the word; <b>Advertiser</b> matches the company or person shown on the ad (partial names match: <code>hubspot</code> also returns HubSpot partners); <b>Payer</b> matches the "Paid for by" entity; <b>Company ID</b> returns exactly one company's ads.

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

Keep only ads shown in these countries — two-letter codes: <code>US</code>, <code>GB</code>, <code>DE</code>, <code>FR</code>… (common country names like <code>Germany</code> work too). Empty = all countries.

## `maxAdsPerSearch` (type: `integer`):

How many ads to take from each search line, newest first. LinkedIn serves 24 per page; up to 5,000 per search per run.

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

Opens each ad's page in the Ad Library: full ad text, who paid, run dates, total impressions and impressions by country, targeted languages and locations, which targeting criteria were used (audience, company, job, demographic…), call-to-action button, landing page URL with its UTM parameters, video file. Impressions and targeting exist only for ads LinkedIn reports under the EU Digital Services Act; for other ads those fields stay empty. Billed as a separate event per ad.

## `dateRange` (type: `string`):

Keep only ads that ran in this period. For exact dates use Start date / End date below instead.

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

Custom range start, YYYY-MM-DD (for example <code>2026-01-01</code>). Overrides Date range.

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

Custom range end, YYYY-MM-DD (for example <code>2026-03-31</code>). Overrides Date range.

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

Newest ads first (LinkedIn's default) or oldest first.

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

Instead of search terms: paste LinkedIn Ad Library links as you see them in the browser — a search (<code>https://www.linkedin.com/ad-library/search?keyword=crm\&countries=US,GB</code>, every filter of the page kept) or a single ad (<code>https://www.linkedin.com/ad-library/detail/1578841044</code>, always returned with details). When URLs are given, Search terms are ignored.

## `onlyNewRowsStore` (type: `string`):

Give this run a name — <code>my-ads-watch</code> — and the Actor remembers every ad it delivered under that name. Every later run with the same name writes and charges <b>only ads you have not received before</b>. Schedule the Actor daily to get a feed of competitors' new LinkedIn ads instead of the whole list each time. Leave empty to get everything found, every time.

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

How many ad pages to open at once when details are on. 4 is safe; higher is faster but gets more refusals.

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

Apify datacenter proxy by default — LinkedIn's Cloudflare refuses Apify server addresses without a proxy. Residential is not needed; one residential attempt is made automatically only after repeated refusals.

## Actor input object example

```json
{
  "searchTerms": [
    "crm"
  ],
  "searchType": "keyword",
  "countries": [
    "US"
  ],
  "maxAdsPerSearch": 24,
  "includeDetails": false,
  "dateRange": "any",
  "sortOrder": "newest",
  "maxConcurrency": 4,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

One row per ad from the LinkedIn Ad Library: advertiser, format, ad copy, headline, image or video, carousel cards, document and event details; with details on also who paid, run dates, total impressions, impressions by country, targeting, call to action and landing page.

# 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 = {
    "searchTerms": [
        "crm"
    ],
    "countries": [
        "US"
    ],
    "maxAdsPerSearch": 24,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("lergassy/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 = {
    "searchTerms": ["crm"],
    "countries": ["US"],
    "maxAdsPerSearch": 24,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("lergassy/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 '{
  "searchTerms": [
    "crm"
  ],
  "countries": [
    "US"
  ],
  "maxAdsPerSearch": 24,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call lergassy/linkedin-ad-library-scraper --silent --output-dataset

```

## MCP server setup

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