# LinkedIn Ads Scraper (`ivanvs/linkedin-ads-scraper`) Actor

Extract details about ads from Linkedin Ad Library. Scrape ad details like when it was run, ad targeting, advertiser and content of ad. Download ad data in JSON, XML, Excel format.

- **URL**: https://apify.com/ivanvs/linkedin-ads-scraper.md
- **Developed by:** [Gen First](https://apify.com/ivanvs) (community)
- **Categories:** SEO tools, Automation, Lead generation
- **Features:** Limited permissions
- **Stats:** 67 total users, 4 monthly users, 100.0% runs succeeded, 4 bookmarks
- **User rating**: 2.04 out of 5 stars

## Pricing

from $2.40 / 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 Ads Scraper

Turn any [LinkedIn Ad Library](https://www.linkedin.com/ad-library) search into structured data — ad creative, copy, advertiser info, spend-tier impressions, and audience targeting — delivered as JSON, CSV, or Excel in minutes. No login, no session cookies, no browser.

### What does LinkedIn Ads Scraper do?

LinkedIn Ads Scraper crawls the public Ad Library — the same tool anyone can browse to see which ads a company is currently running — and turns each result into a clean, structured record. Give it a search URL (by keyword, advertiser, or country) or a direct ad link, and it returns:

- **Full ad creative** — images, video sources, carousel slides, or the linked document/PDF
- **Ad copy** — headline, body text, and call-to-action button
- **Advertiser details** — company name, LinkedIn page, logo
- **Impressions** — LinkedIn's total range (e.g. "10K–50K") plus a per-country breakdown estimated from the published percentages
- **Audience targeting** — the targeting criteria LinkedIn discloses for the ad
- **Format detection** — auto-classified into 10 types: single image, video, carousel, document, text, spotlight, event, job, article, and follow-company ads

Because it runs on a lightweight HTTP crawler instead of a headless browser, runs are fast and cheap, and there's nothing to log in to or maintain session cookies for.

### Who is this for?

- **Competitive intelligence & marketing teams** tracking what competitors are running on LinkedIn, in which formats, and for how long.
- **Sales & market research teams** building lists of companies actively investing in LinkedIn ads as a buying signal.
- **Agencies & compliance reviewers** auditing client or competitor ad copy and creative at scale, across countries.
- **Researchers & journalists** analyzing B2B or industry ad spend and messaging trends using LinkedIn's public disclosures.

### How to use LinkedIn Ads Scraper

1. Go to the [LinkedIn Ad Library](https://www.linkedin.com/ad-library) and run the search you want — by keyword, advertiser, country, date range, or any combination.
2. Copy the resulting URL, or the URL of a single ad's detail page, and paste it into the **URLs** input field. You can add several, or point to a Google Sheet listing many at once.
3. Set **Maximum number of records**, hit **Start**, and download results as JSON, CSV, Excel, XML, RSS, or an HTML table once the run finishes.

Example of valid input URLs:

- `https://www.linkedin.com/ad-library/search?accountOwner=JetBrains`
- `https://www.linkedin.com/ad-library/search?keyword=jetbrains`
- `https://www.linkedin.com/ad-library/search?keyword=jetbrains&countries=FI`
- `https://www.linkedin.com/ad-library/search?keyword=jetbrains&countries=FI&dateOption=current-year`
- `https://www.linkedin.com/ad-library/detail/349389913`

#### Example input

```json
{
  "urls": [
    {
      "url": "https://www.linkedin.com/ad-library/search?keyword=jetbrains",
      "method": "GET"
    },
    {
      "url": "https://www.linkedin.com/ad-library/detail/349389913",
      "method": "GET"
    }
  ],
  "maxResults": 100
}
```

#### Example output

```json
{
  "url": "https://www.linkedin.com/ad-library/detail/1515146044",
  "id": 1515146044,
  "format": "SINGLE_IMAGE_AD",
  "period": {
    "start": "2026-08-20",
    "end": "2026-08-22"
  },
  "paidBy": "Paid for by Philip Calam",
  "totalImpression": "20k-30k",
  "totalImpressionParsed": {
    "raw": "20k-30k",
    "estimatedMin": 20000,
    "estimatedMax": 30000
  },
  "impressions": [],
  "advertiser": {
    "url": "https://www.linkedin.com/in/philcalam",
    "name": "Phil Calam",
    "logo": "https://media.licdn.com/dms/image/v2/D4E03AQGneUcs3cxTOg/profile-displayphoto-scale_100_100/B4EZwg_sl5JAAc-/0/1770080105347?e=1788998400&v=beta&t=M3Lv8aZd8TKNUMZHCxrmm9ZgacWsszhNp_3n3Ghz6cQ"
  },
  "body": "The marketing world remains fixated on AI transparency, but is the outrage partially a deflection tactic? ...",
  "title": null,
  "imageUrls": [
    "https://media.licdn.com/dms/image/v2/D5622AQGGTEuRScLIIQ/feedshare-shrink_1280/B56aAhXHB9IEAM-/0/1787266103658?e=2147483647&v=beta&t=JJ82yxWdjwxOTqmFcWg7-7fXDeOPKOiWTqwXc4l1Hcs"
  ],
  "videoUrls": [],
  "targetingSettings": [
    {
      "target": "Language",
      "value": "Targeting includes English"
    },
    {
      "target": "Location",
      "value": "Targeting includes Australia and New Zealand, North America and\n      \n        2 others\n      \n      United Kingdom, European Union"
    }
  ],
  "buttons": [],
  "event": null
}
```

### Input parameters

| Field        | Type    | Description                                                                               |
| ------------ | ------- | ----------------------------------------------------------------------------------------- |
| `urls`       | array   | LinkedIn Ad Library search URLs, ad detail URLs, or a Google Sheet listing URLs to scrape |
| `maxRecords` | integer | Maximum number of ads to scrape in this run (default: 10)                                 |

### Output

Results are stored in the run's dataset. Once finished, download them as JSON, CSV, Excel, XML, RSS, or an HTML table — or pull them programmatically via the [Apify API](https://docs.apify.com/api/v2).

### ❓ FAQ

#### Do I need proxies or a LinkedIn account?

No. Proxy is already preconfigured for optimal performance, and the scraper never logs in or uses session cookies — it only reads what's already public on the Ad Library.

#### What ad formats are supported?

Single image, video, carousel, document/PDF, text, spotlight, event, job, article, and follow-company ads.

#### Can I filter by country or advertiser?

Yes — any filter available on the LinkedIn Ad Library UI (keyword, advertiser, country, date range) works, since you're just passing through the search URL you already built there.

#### Where does the impressions data come from?

LinkedIn only publishes a total impression range (e.g. "10K–50K") plus a per-country percentage bar for each ad. The scraper parses both and computes an estimated min/max per country — it's an estimate, not an exact figure LinkedIn discloses directly.

### Support

Need a custom or simplified output, or found a bug? Contact the developer at support@getmediumdata.com or open an issue.

# Changelog

This Actor's version history is a separate document: https://apify.com/ivanvs/linkedin-ads-scraper/changelog.md

# Actor input Schema

## `maxRecords` (type: `integer`):

Maximum number of records to be scraped

## `urls` (type: `array`):

List of URLs from Linkedin Ad Library page (https://www.linkedin.com/ad-library) that needs to be scraped

## Actor input object example

```json
{
  "maxRecords": 10,
  "urls": [
    {
      "url": "https://www.linkedin.com/ad-library/search?keyword=jetbrains"
    }
  ]
}
```

# 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 = {
    "maxRecords": 10,
    "urls": [
        {
            "url": "https://www.linkedin.com/ad-library/search?keyword=jetbrains"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("ivanvs/linkedin-ads-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 = {
    "maxRecords": 10,
    "urls": [{ "url": "https://www.linkedin.com/ad-library/search?keyword=jetbrains" }],
}

# Run the Actor and wait for it to finish
run = client.actor("ivanvs/linkedin-ads-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 '{
  "maxRecords": 10,
  "urls": [
    {
      "url": "https://www.linkedin.com/ad-library/search?keyword=jetbrains"
    }
  ]
}' |
apify call ivanvs/linkedin-ads-scraper --silent --output-dataset

```

## MCP server setup

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