# LinkedIn Ad Library Scraper: Ads, Impressions & Targeting (`automatic/linkedin-ad-library-scraper`) Actor

Get any company's LinkedIn ads from the Ad Library: ad copy, images, videos, carousels, documents, call to action and landing page, who paid, run dates, impressions by country and targeting. Search by company, keyword or payer; schedule it to get only new ads.

- **URL**: https://apify.com/automatic/linkedin-ad-library-scraper.md
- **Developed by:** [Philip Kirkbride](https://apify.com/automatic) (community)
- **Categories:** Social media, Lead generation
- **Features:** Limited permissions, Multi-tenant, Server interface
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.70 / 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: Ads, Impressions & Targeting

See **every ad a company runs on LinkedIn**, straight from LinkedIn's public
Ad Library. Type a competitor's name, a keyword or a payer, and get each ad
as a clean row: the full ad copy, headline, images, video, carousel cards and
document pages, the call-to-action button and the landing page it sends
people to, who paid for it, the days it ran, how many impressions it got
(with each country's share) and who it was targeted at.

- **Your competitors' whole LinkedIn playbook:** every format, including
  single image, video, carousel, document, article, spotlight and
  thought-leader ads (a member's post promoted by the company, with both
  names).
- **Reach and targeting, not just creatives:** impressions range, share of
  impressions by country, target languages and locations, and whether
  audiences, companies, job titles, demographics, education and interests
  were used to include or exclude people.
- **Landing pages with their tracking tags:** see the exact offer, campaign
  and UTM parameters behind each ad.
- **Only new ads on a schedule:** turn on "Only new ads" and each scheduled
  run returns just the ads that appeared since the last one. Ads you already
  have are skipped free of charge.
- **Search the way you think:** by company, by any word or phrase in the ad
  text, or by the legal entity that paid, filtered by country and date. Or
  paste links straight from the Ad Library, or a company's LinkedIn page.
- **Reliable by design:** a misspelled company or a bad link is skipped and
  named in the run summary while your other searches carry on, and you only
  pay for ads delivered.

Run the prefilled form to preview HubSpot's 20 newest LinkedIn ad cards.
Turn on **Include ad details** to add the full ad page fields.

Built for B2B marketers, demand-generation and paid-social teams, agencies
pitching new clients, competitive-intelligence and product-marketing teams,
and anyone building a swipe file of LinkedIn ads that work.

**Watching other channels too?** Pair it with our Facebook Ads Library
scraper and Google Ads Transparency scraper for the same competitors.

### Use cases

- **Competitor monitoring:** schedule a weekly run on your top competitors
  with "Only new ads" on and get every new campaign the day it shows up.
- **Messaging and offer research:** export a category's ad copy, headlines
  and call-to-action buttons by keyword and see which angles everyone uses.
- **Budget and market signals:** impressions ranges and country splits show
  where a competitor is spending and how hard.
- **Targeting insight:** see which companies, job functions and locations an
  advertiser goes after.
- **Agency pitches and creative swipe files:** pull a prospect's last year of
  LinkedIn ads, with images and videos, in one run.
- **Lead generation:** keyword searches surface every company advertising in
  your niche, with its LinkedIn page and the landing page it promotes.

### Quick start

The prefilled form returns up to 20 HubSpot ad cards. An empty API input
(`{}`) returns up to 20 HubSpot ads with details.

Two competitors' ads from the last 30 days in Germany and France:

```json
{
  "advertisers": ["HubSpot", "Salesforce"],
  "countries": ["DE", "FR"],
  "dateRange": "last-30-days",
  "maxResults": 200
}
```

Every advertiser whose ads mention a topic, as a fast list without the
per-ad details:

```json
{
  "keywords": ["AI agents", "cybersecurity"],
  "includeDetails": false,
  "maxResults": 500
}
```

A weekly competitor watch (save it as a task and schedule it):

```json
{
  "advertisers": ["HubSpot", "Pipedrive", "Zoho"],
  "onlyNewAds": true,
  "monitorName": "crm-competitors"
}
```

Links copied from the Ad Library work too, with all their filters, and so
does a company's LinkedIn page:

```json
{
  "startUrls": [
    "https://www.linkedin.com/ad-library/search?accountOwner=hubspot&countries=GB,IE",
    "https://www.linkedin.com/ad-library/detail/1643384694",
    "https://www.linkedin.com/company/68529"
  ]
}
```

### Input

| Field | What it does |
|---|---|
| `advertisers` | Company or advertiser names, one search each. |
| `keywords` | Words or phrases in the ad text, one search each. |
| `payers` | Names of the entity that paid for the ads, one search each. |
| `countries` | Only ads shown in these countries (codes like `US`, `DE`, or English names). |
| `dateRange` | `all` (default), `last-30-days`, `current-month`, `current-year`, `last-year` or `custom` with `startDate` / `endDate`. |
| `includeDetails` | Defaults to on for API inputs that omit it. The prefilled form starts with it off. Turn it on for full text, button, landing page, payer, run dates, impressions and targeting. |
| `onlyNewAds` | Return only ads not delivered by this saved search before. |
| `monitorName` | Optional name for that history, so several tasks can share or separate it. |
| `startUrls` | Ad Library search links, single-ad links or company page links. Each delivered single-ad link incurs the ad details charge even when `includeDetails` is off. |
| `maxResults` | Most ads per search (default 100, up to 5,000). Search results are newest first. Single-ad links share one limit and follow input order. |

### Output

One row per ad. With details on (the default):

```json
{
  "adId": "1643384694",
  "adUrl": "https://www.linkedin.com/ad-library/detail/1643384694",
  "advertiserName": "HubSpot",
  "advertiserUrl": "https://www.linkedin.com/company/68529",
  "advertiserType": "company",
  "advertiserCompanyId": "68529",
  "advertiserLogoUrl": "https://media.licdn.com/dms/image/v2/C4D0BAQF8H-SLmMDZlA/company-logo_100_100/company-logo_100_100/0/1646683330132/hubspot_logo?e=1796256000&v=beta&t=t1LMuwdMXiqcs78ORC0phmuGUKugrae1RxkL9foPt30",
  "advertiserHeadline": null,
  "postAuthorName": null,
  "postAuthorHeadline": null,
  "postAuthorUrl": null,
  "postAuthorImageUrl": null,
  "adFormat": "Single Image Ad",
  "creativeType": "SPONSORED_STATUS_UPDATE",
  "adText": "Finally, AI-powered by the context of your business. Get the free HubSpot connector for ChatGPT and unlock better insights.",
  "adTextTruncated": false,
  "textLinks": [],
  "hashtags": [],
  "headline": "Ask about your pipeline. Get real answers, grounded in context.",
  "description": null,
  "callToAction": "Learn more",
  "destinationUrl": "https://www.hubspot.com/chatgpt",
  "imageUrl": "https://media.licdn.com/dms/image/v2/D5610AQE1kIunv9Hgog/image-shrink_1280/B56aHHGchtLMAY-/0/1794341718329/ChatGPTConnectorAds2png?e=2147483647&v=beta&t=ao5vZxMo7--chowmUTeMhXUScrd_kMVPNBrppmxhddw",
  "imageUrls": [
    "https://media.licdn.com/dms/image/v2/D5610AQE1kIunv9Hgog/image-shrink_1280/B56aHHGchtLMAY-/0/1794341718329/ChatGPTConnectorAds2png?e=2147483647&v=beta&t=ao5vZxMo7--chowmUTeMhXUScrd_kMVPNBrppmxhddw"
  ],
  "videoUrl": null,
  "videoSources": [],
  "carouselCards": [],
  "documentTitle": null,
  "documentPageCount": null,
  "documentPageImageUrls": [],
  "documentUrl": null,
  "payer": "HubSpot, Inc.",
  "runStartDate": "2026-11-12",
  "runEndDate": "2026-11-17",
  "runDatesText": "Ran from Nov 12, 2026 to Nov 17, 2026",
  "impressions": "50k-100k",
  "impressionsMin": 50000,
  "impressionsMax": 100000,
  "impressionsByCountry": [
    {"country": "United Kingdom", "percent": 74.0, "share": "74%"},
    {"country": "Ireland", "percent": 26.0, "share": "26%"},
    {"country": "China", "percent": null, "share": "< 1%"}
  ],
  "targeting": {
    "language": {"includes": ["English"], "excludes": [], "text": "Targeting includes English"},
    "location": {"includes": ["Ireland", "United Kingdom"], "excludes": [], "text": "Targeting includes Ireland, United Kingdom"}
  },
  "targetingCriteria": [
    {"parameter": "Audience", "targeted": false, "excluded": true},
    {"parameter": "Demographic", "targeted": false, "excluded": false},
    {"parameter": "Company", "targeted": true, "excluded": false}
  ],
  "detailLevel": "full",
  "search": "HubSpot",
  "searchType": "advertiser",
  "collectedAt": "2026-11-17T03:40:12.118204+00:00"
}
```

Video ads add `videoUrl` and every `videoSources` quality; carousels list
each card in `carouselCards`; document ads give `documentTitle`,
`documentPageCount` and page images; thought-leader ads name the member in
`postAuthorName` and `postAuthorHeadline`. Fields an ad does not have are
`null` or empty.

With **Include ad details** off, each row has the search-card fields: the
advertiser, format, image or video cover, headline and the first lines of
the ad copy (`adTextTruncated: true`), and `detailLevel` is `card`.

The run summary (key-value store record `OUTPUT`) lists each search with the
pages read, ads saved and why it ended, plus skipped inputs and source
failures. When time runs out during enrichment, ads already found are saved
with their available fields within the run's cost limit. With "Only new ads"
on the summary also shows how many ads were new and how
many were already delivered.

### Use it as an API

One public ad with creative and any published transparency details. Get the answer in JSON from one HTTPS call. Call it from an AI agent through an HTTP-capable MCP tool, or add an HTTP request step in n8n, Make, or Zapier.

```bash
curl --get 'https://automatic--linkedin-ad-library-scraper.apify.actor/' \
  --header "Authorization: Bearer $APIFY_TOKEN" \
  --data-urlencode ad=1643384694
```

Send the same fields as a JSON object with `POST /`. Results are in `data`. See `GET /openapi.json` for the request and response definitions.

### Pricing

Pay per result, no subscription:

| Event | Free plan | Bronze | Silver | Gold and up |
|---|---|---|---|---|
| Ad | $1.00 / 1,000 | $0.90 / 1,000 | $0.80 / 1,000 | $0.70 / 1,000 |
| Ad details (Include ad details or pasted single-ad links) | $1.00 / 1,000 | $0.90 / 1,000 | $0.80 / 1,000 | $0.70 / 1,000 |
| Run start | $0.003 | $0.003 | $0.003 | $0.003 |

Each delivered search ad carries the ad charge and adds the details charge
only if its own page was read. Each delivered pasted single-ad link carries
both charges. With "Only new ads" on, ads you already have are skipped free
of charge. Use the maximum cost per run to cap spending.

### Good to know

- LinkedIn publishes the landing page, run dates, impressions and targeting
  for ads shown in the EU and Brazil. For other ads it shows the creative,
  the button and who paid, and those fields are empty. Country shares can
  take up to 48 hours to appear for a new ad.
- The Ad Library keeps about one year of ads.
- Company names are matched the way LinkedIn's own Ad Library search matches
  them, so a broad name can also return similarly named advertisers; paste
  the company's page link (with its number, as in `/company/68529`) or use
  the payer name to narrow it.
- "Only new ads" follows the newest-first order: the first run sets the
  starting point and later runs stop once they reach ads already delivered.
- Image and video links come from LinkedIn and expire after a while;
  download the files you want to keep.
- Data is what LinkedIn shows publicly in its Ad Library; check its terms for
  your use.

# Actor input Schema

## `advertisers` (type: `array`):

Company or advertiser names, one search each (up to 30 searches per run), for example HubSpot or Salesforce. Each finds the ads LinkedIn lists for advertisers with that name. A name with no ads (a typo, for example) is skipped and named in the run summary so other searches can continue. The form is prefilled with a quick sample of 20 HubSpot ad cards.

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

Words or phrases, one search each: finds ads whose text mentions them, from any advertiser (for example "AI agents" or "cybersecurity").

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

Names of the legal entity that paid for the ads, one search each (for example "HubSpot, Inc."). Useful when a group runs ads from several brand pages.

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

Only ads shown in these countries. Two-letter codes (US, DE, GB) or English names (Germany). Empty means all countries. Applies to the company, keyword and payer searches.

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

Only ads shown in this period. The Ad Library keeps about one year of ads. Choose Custom and set the dates below for your own range (setting a date also switches to a custom range).

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

Custom range start, as YYYY-MM-DD. Leave empty for the earliest day the Ad Library offers.

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

Custom range end, as YYYY-MM-DD. Leave empty for today.

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

Open each ad's own page and add the full ad text, call-to-action button and destination link, who paid for the ad, the dates it ran, the impressions range with each country's share, and the targeting (languages, locations, and whether audiences, companies, job titles and more were targeted or excluded). Impressions and targeting are published for ads shown in the EU and Brazil. Each ad with details adds the ad-details charge (see Pricing). The quick sample leaves this off. Pasted single-ad links always include details and incur the details charge for each ad delivered.

## `onlyNewAds` (type: `boolean`):

For scheduled runs: skip ads this saved search already delivered, so each run returns just the ads that appeared since the last one. Skipped ads are free. The first run collects the current ads as the starting point.

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

Optional name for the history kept by "Only new ads", for example competitor-ads. Runs with the same name share one history. Leave empty to give each set of searches its own history automatically.

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

Links copied from linkedin.com/ad-library: a search results page (it keeps all the filters set in it) or a single ad (https://www.linkedin.com/ad-library/detail/...). A company's LinkedIn page (https://www.linkedin.com/company/...) works too and finds that company's ads, with the country and date filters above. Pasted single-ad links share one result limit. Each delivered single ad adds the ad-details charge ($0.001 on the Free plan) even when Include ad details is off. Other links are skipped and named in the run summary.

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

Most ads saved for each company, keyword, payer or search link (up to 5,000). Pasted single-ad links share one limit and are processed in input order. Search results are saved newest first.

## Actor input object example

```json
{
  "advertisers": [
    "HubSpot"
  ],
  "dateRange": "all",
  "includeDetails": false,
  "onlyNewAds": false,
  "maxResults": 20
}
```

# Actor output Schema

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

No description

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

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

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

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "advertisers": [
        "HubSpot"
    ],
    "includeDetails": false,
    "maxResults": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("automatic/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 = {
    "advertisers": ["HubSpot"],
    "includeDetails": False,
    "maxResults": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("automatic/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 '{
  "advertisers": [
    "HubSpot"
  ],
  "includeDetails": false,
  "maxResults": 20
}' |
apify call automatic/linkedin-ad-library-scraper --silent --output-dataset

```

## MCP server setup

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