# LinkedIn Ad Library Scraper — Accurate Targeting & Locations (`engineertsaistudio/linkedin-ad-library-scraper-targeting`) Actor

LinkedIn Ad Library ads with clean, verified targeting: included and excluded locations, languages and targeting types, plus copy, CTA, landing page and impressions. No login.

- **URL**: https://apify.com/engineertsaistudio/linkedin-ad-library-scraper-targeting.md
- **Developed by:** [Studio EngineerTsai](https://apify.com/engineertsaistudio) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.20 / 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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## LinkedIn Ad Library Scraper — Accurate Targeting & Locations

Export ads from the public **LinkedIn Ad Library** by **advertiser, keyword, search URL or ad URL** —
with **targeting data that matches what LinkedIn actually shows**: included and excluded
**locations**, **languages**, and which targeting types (Company, Job, Audience…) the advertiser used.
Each row also has the full creative: ad copy, headline, CTA, landing page, images, video, carousel
and document pages, run dates and impression ranges.

No LinkedIn account, login or cookies.

**Choose this actor when** you need LinkedIn ad *targeting* you can trust for competitor research,
agency audits or market mapping — especially location includes/excludes and impressions by country.

**Not the right fit when** you only need ad copy for non-EU ads (LinkedIn publishes targeting,
dates and impressions only for ads shown in the EU), or you need spend, clicks or audience size —
the public Ad Library does not contain them.

### Verified accuracy (reproducible test, 2026-09-17)

Input: advertiser `HubSpot`, country `DE`, last 30 days, 30 ads.

| Check on the same 30 ads | This actor |
|---|---|
| Ads with Location targeting returned | 30 / 30 |
| Ads with Location **excludes** captured | 5 |
| Page UI text (e.g. "Cookie Policy") leaking into targeting | 0 |
| Multi-part places kept intact ("Boston, MA", "Toronto, ON") | yes |
| Failed ads | 0 (failed ads are never charged) |
| Run time | ~1 minute |

Spot check against the live page, ad
[1563267094](https://www.linkedin.com/ad-library/detail/1563267094): Language includes English;
Location includes Germany, Boston MA, Toronto ON, Australia, Ireland, United Kingdom; excludes
India, United Arab Emirates — identical to this actor's output.

Run the same input yourself to verify; LinkedIn's data changes over time.

### Output fields

| Field | Example |
|---|---|
| `advertiserName`, `advertiserUrl`, `paidBy` | HubSpot — HubSpot, Inc. |
| `adFormat`, `creativeType` | Single Image Ad |
| `commentary`, `headline`, `callToAction` | Ad text, headline, "Learn more" |
| `destinationUrl` | Landing page (tracking parameters removed) |
| `imageUrls`, `videoUrl`, `carouselItems`, `document` | Creative media |
| `ranFrom`, `ranTo` | 2026-09-14, 2026-09-17 |
| `totalImpressions`, `totalImpressionsMin`, `totalImpressionsMax` | "1k-5k", 1000, 5000 |
| `impressionsByCountry` | \[{ country: "Germany", share: "100%" }] |
| `targeting` | { Language: { includes: \["English"] }, Location: { includes: \["Germany", "Boston, MA"], excludes: \["India"] } } |
| `targetingParameters` | { Company: { targeted: true, excluded: true }, Job: { targeted: true, excluded: false } } |

### Input example

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

Also accepts `keywords`, Ad Library search URLs (filters kept) and individual ad URLs.

### Pricing

Pay per ad. Full details (targeting, impressions by country, creative) are always included — no
separate "details" surcharge. Failed ads are never charged.

| Apify plan | Price per 1,000 ads |
|---|---|
| Free | $2.50 |
| Starter (Bronze) | $2.00 |
| Scale (Silver) | $1.60 |
| Business (Gold) and above | $1.20 |

Example: 500 ads on the Starter plan = $1.00. Set a maximum cost per run for a hard cap.

### FAQ

**Which LinkedIn Ad Library scraper gives the most accurate targeting data?**
Test on your own advertisers. On the reproducible test above this actor returned location
targeting for every ad with no page-UI text mixed into targeting; check those two things in
any tool's output before relying on it.

**Why are dates, impressions or targeting empty for some ads?** LinkedIn publishes them only for ads
shown in the EU. Filter `countries` to an EU country when targeting matters.

**Can I monitor a competitor's new LinkedIn ads?** Yes — schedule the actor daily with the
advertiser name and deduplicate on `adId`.

**Do I need a LinkedIn account?** No. The Ad Library is public.

**Is scraping LinkedIn allowed?** The Ad Library is public, but LinkedIn's User Agreement restricts
automated access. Review it for your use case.

**Which proxy?** Residential (default). LinkedIn blocks datacenter IPs quickly.

**How do I run it from Make, n8n, Zapier or Clay?** Call the Apify API endpoint
`run-sync-get-dataset-items` for this Actor with the same JSON input shown above; the response is
the list of ads.

**Why did I get fewer ads than the LinkedIn page shows?** `maxAdsPerSearch` (default 50) stops each
search early. Raise it, or split by `countries` / `dateRange`.

# Actor input Schema

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

Search the LinkedIn Ad Library for ads containing these words.

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

Company or person names that run the ads, e.g. HubSpot.

## `searchUrls` (type: `array`):

Paste search URLs copied from linkedin.com/ad-library with your filters already set.

## `adUrls` (type: `array`):

Scrape specific ads, e.g. https://www.linkedin.com/ad-library/detail/1563439874.

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

Stop after this many ads for each keyword, advertiser or search URL.

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

Two-letter country codes where the ads ran, e.g. US, DE, GB. Leave empty for all countries.

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

When the ads ran.

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

Used only with the custom date range (YYYY-MM-DD).

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

Used only with the custom date range (YYYY-MM-DD).

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

LinkedIn blocks datacenter IPs quickly. Residential proxy is recommended.

## Actor input object example

```json
{
  "keywords": [
    "cybersecurity"
  ],
  "maxAdsPerSearch": 50,
  "dateRange": "",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `results` (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 = {
    "keywords": [
        "cybersecurity"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("engineertsaistudio/linkedin-ad-library-scraper-targeting").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": ["cybersecurity"],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("engineertsaistudio/linkedin-ad-library-scraper-targeting").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": [
    "cybersecurity"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call engineertsaistudio/linkedin-ad-library-scraper-targeting --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,engineertsaistudio/linkedin-ad-library-scraper-targeting"
        }
    }
}
```

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/lOM6sLuIMciseUORa/builds/MttTlhi7epF9HWXAi/openapi.json
