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

Scrape the public LinkedIn Ad Library by keyword, advertiser or payer, country and date. Get ad text, headline, CTA, landing URL, images, videos, run dates, impressions by country and targeting. No login. $0.0008/ad.

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

## Pricing

from $0.80 / 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.

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: Ads, Impressions, Targeting (No Login)

Scrape the **public LinkedIn Ad Library** (linkedin.com/ad-library) by **keyword, advertiser (company) or payer**, filtered by **country** and **date range**. Every ad comes back with **full details at one flat price**: full ad text, headline, CTA button, landing URL, images, video files, carousel cards, run dates, **total impressions, impressions by country and targeting** (for ads shown in the EU).

No LinkedIn account, no cookies, no login. Public pages only.

### Why this one

| | This actor | Typical alternatives |
|---|---|---|
| Price per ad, full details | **$0.0008** flat | $0.0015 to $0.004 on the free tier |
| Run start fee | $0.00005 | up to $0.005 |
| Impressions + by-country split | yes | sometimes, extra fee |
| Targeting (language, location, parameters) | yes | rarely |
| Landing URL with UTM parameters | yes | often missing |
| Video MP4 URLs (all qualities) | yes | often only a poster |

### Use cases

- **Competitor ad research**: see every LinkedIn ad a rival ran in the last 12 months, with copy, offer and CTA.
- **B2B lead generation**: find companies actively spending on LinkedIn ads in your niche (keyword search) and get their landing pages.
- **Creative swipe file**: collect headlines, ad copy, images and videos by industry keyword.
- **Agency prospecting & reporting**: estimated reach and countries per ad, run dates, targeting choices.

### Input

| Field | Example | Notes |
|---|---|---|
| `keywords` | `["crm", "ai agents"]` | Words in the ad |
| `advertisers` | `["HubSpot", "Salesforce"]` | Company names. With keywords, every pair is searched |
| `payers` | `["HubSpot, Inc."]` | Optional: the entity that paid |
| `countries` | `["DE", "FR"]` | ISO codes. Empty = all countries |
| `dateRange` | `all`, `last-30-days`, `current-year`, `last-year`, `custom` | With `custom`, set `startDate` / `endDate` (YYYY-MM-DD) |
| `maxResults` | `100` | Max ads per search |
| `includeDetails` | `true` | Open each ad for the full record (same price) |
| `startUrls` | Ad Library search or detail URLs | Paste any URL from linkedin.com/ad-library |

```json
{"advertisers": ["hubspot"], "countries": ["DE"], "dateRange": "last-30-days", "maxResults": 100}
```

### Example output (real record)

```json
{
  "adId": "1639063634",
  "adUrl": "https://www.linkedin.com/ad-library/detail/1639063634",
  "creativeType": "SPONSORED_STATUS_UPDATE",
  "format": "Single Image Ad",
  "advertiserName": "HubSpot",
  "advertiserUrl": "https://www.linkedin.com/company/68529",
  "advertiserCompanyId": "68529",
  "paidBy": "HubSpot, Inc.",
  "adText": "Erstellen Sie im Marketing-Studio personalisierte Follow-ups, damit mehr Leads bei Ihrem Vertrieb ankommen.",
  "headline": "Personalisierung im großen Stil.",
  "cta": "Request Demo",
  "landingUrl": "https://www.hubspot.de/products/marketing/studio",
  "landingDomain": "hubspot.de",
  "imageUrls": ["https://media.licdn.com/dms/image/v2/D4E10AQGnFaA8iema7g/image-shrink_1280/..."],
  "videoUrl": null,
  "carouselCards": [],
  "ranFrom": "2026-11-17",
  "ranTo": "2026-12-01",
  "totalImpressions": "10k-20k",
  "impressionsMin": 10000,
  "impressionsMax": 20000,
  "impressionsByCountry": [{"country": "Germany", "share": "100%"}, {"country": "Austria", "share": "< 1%"}],
  "targeting": {"Language": ["Targeting includes English"], "Location": ["Targeting includes Germany"]},
  "targetingParameters": [{"parameter": "Audience", "targeted": false, "excluded": true}, {"parameter": "Job", "targeted": false, "excluded": false}],
  "searchUrl": "https://www.linkedin.com/ad-library/search?accountOwner=hubspot&countries=DE"
}
```

Video ads also return `videoUrl` (best quality MP4), `videoUrls` (all qualities) and `videoPosterUrl`. Carousel ads return `carouselCards` with title and image per card.

### Notes

- LinkedIn shows impressions, run dates and targeting mainly for ads delivered in the EU (DSA transparency). For other regions these fields can be empty.
- The Ad Library keeps about one year of ads.
- The actor runs politely (low concurrency, backoff on rate limits). Large runs take a few minutes.
- Export as JSON, CSV, Excel, or call it via the Apify API, Make, Zapier or n8n.

### Pricing

Pay per result: **$0.0008 per ad** with full details, plus a $0.00005 start fee. 1,000 ads = $0.80. You only pay for ads saved to the dataset.

Independent tool, not affiliated with LinkedIn. It reads only the public Ad Library. Use the data in line with LinkedIn's terms and the laws that apply to you (GDPR etc.).

# Actor input Schema

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

Words or phrases found in the ads, one per line. Example: crm, ai agents

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

Company / advertiser names to look up, one per line. Example: HubSpot, Salesforce. Combined with keywords if both are given.

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

Search by the entity that paid for the ad.

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

ISO 2-letter country codes where the ads ran, e.g. US, DE, GB, FR. Empty = all countries. EU countries show impressions and targeting.

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

When the ads ran. The Ad Library keeps about the last 12 months.

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

YYYY-MM-DD, used when Date range = Custom. The Ad Library keeps about 1 year.

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

YYYY-MM-DD, used when Date range = Custom.

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

Max ads per search

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

Open each ad: full text, headline, CTA, landing URL, images/videos, run dates, impressions by country and targeting. Same price either way.

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

Paste linkedin.com/ad-library/search?... or /ad-library/detail/... URLs.

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

Max concurrency

## Actor input object example

```json
{
  "keywords": [
    "crm"
  ],
  "advertisers": [
    "hubspot"
  ],
  "countries": [
    "DE"
  ],
  "dateRange": "all",
  "maxResults": 20,
  "includeDetails": true,
  "maxConcurrency": 2
}
```

# Actor output Schema

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

One record per ad.

# 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 = {
    "keywords": [
        "crm"
    ],
    "advertisers": [
        "hubspot"
    ],
    "countries": [
        "DE"
    ],
    "maxResults": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("rejoicing_shanty/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 = {
    "keywords": ["crm"],
    "advertisers": ["hubspot"],
    "countries": ["DE"],
    "maxResults": 20,
}

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

```

## MCP server setup

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