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

A linkedin ads library scraper: collect ads from LinkedIn's public ad library by advertiser, word or ad link, with text, dates, formats, reach, targeting and media links. Export JSON, CSV or Excel.

- **URL**: https://apify.com/icoe-man/linkedin-ads-scraper.md
- **Developed by:** [Icoe Man](https://apify.com/icoe-man) (community)
- **Categories:** Social media, Marketing
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

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

Compare LinkedIn ads side by side in a table you can download or use in other tools. Search the public ad library by advertiser or keyword, or paste links to the ads you want. See who advertised, what the ad said and what it asked viewers to do. You'll also get the dates, ad format and links to its media. When LinkedIn publishes those details, you can see who paid, whose name appeared on the ad, how often it was shown and who it targeted.

### What you get

Under **What to collect**, choose the type of results you want. Fill in the fields for that choice, then start the run. Each run returns one kind of result. The Actor ignores fields from other modes. Use full web addresses. If you have a short link, open it and copy the full address from your browser's address bar. Choose **Live** under **Data freshness** to collect fresh data on every run.

### Collection modes

#### Search ads

Find ads in LinkedIn's public ad library by advertiser or by words that appear in the ads. In `adlibrary-search` mode, fill in **Advertisers or words** (up to 100 entries), and **Search by** (optional), **Countries** (optional), **Ran from** (optional), **Ran until** (optional). Use **Result limit per target** to set how many ads the Actor can collect per entry. The default is 100 and the highest setting is 1000. Each ad appears in its own row and counts as one **Search ads result** charge.

Example result for one ad:

```json
{
  "status": "ok",
  "type": "ad",
  "platform": "linkedin",
  "id": "1643234054",
  "url": "https://www.linkedin.com/ad-library/detail/1643234054",
  "advertiser": {
    "id": "1337",
    "name": "Microsoft"
  },
  "text": "A short example sentence about a software product, shown for illustration.",
  "ctaText": "Learn more",
  "landingUrl": "https://www.example.com/",
  "startedAt": "2026-11-12T00:00:00Z",
  "endedAt": "2026-11-13T00:00:00Z",
  "media": [
    {
      "kind": "image",
      "url": "https://media.licdn.com/dms/image/example/ad.jpg",
      "thumbnailUrl": null
    }
  ],
  "details": {
    "linkedin": {
      "adType": "Single Image Ad",
      "creativeType": "SPONSORED_STATUS_UPDATE",
      "countries": [
        "Germany",
        "France"
      ],
      "totalImpressions": "5k-10k",
      "impressionsByCountry": [
        {
          "country": "Germany",
          "share": "60%"
        },
        {
          "country": "France",
          "share": "40%"
        }
      ],
      "targeting": {
        "language": "Targeting includes English",
        "location": "Targeting includes Germany, France",
        "parameters": [
          {
            "name": "Job",
            "targeted": true,
            "excluded": false
          },
          {
            "name": "Company",
            "targeted": false,
            "excluded": true
          }
        ]
      },
      "paidBy": "Microsoft",
      "poster": {
        "name": "Microsoft",
        "title": null
      },
      "messageSender": null
    }
  },
  "collectedAt": "2026-11-14T12:00:00Z",
  "input": {
    "advertiser": "microsoft",
    "maxItems": 10
  }
}
```

#### Ad details

Paste links to individual ads from LinkedIn's ad library to get their details. In `adlibrary-ad` mode, fill in **Ad links** (up to 100 entries). You get one ad per entry. Each ad appears in its own row and counts as one **Ad details result** charge.

Example result for one ad:

```json
{
  "status": "ok",
  "type": "ad",
  "platform": "linkedin",
  "id": "1643234054",
  "url": "https://www.linkedin.com/ad-library/detail/1643234054",
  "advertiser": {
    "id": "1337",
    "name": "Microsoft"
  },
  "text": "A short example sentence about a software product, shown for illustration.",
  "ctaText": "Learn more",
  "landingUrl": "https://www.example.com/",
  "startedAt": "2026-11-12T00:00:00Z",
  "endedAt": "2026-11-13T00:00:00Z",
  "media": [
    {
      "kind": "image",
      "url": "https://media.licdn.com/dms/image/example/ad.jpg"
    }
  ],
  "details": {
    "linkedin": {
      "adType": "Single Image Ad",
      "creativeType": "SPONSORED_STATUS_UPDATE",
      "countries": [
        "Germany",
        "France"
      ],
      "totalImpressions": "5k-10k",
      "impressionsByCountry": [
        {
          "country": "Germany",
          "share": "60%"
        },
        {
          "country": "France",
          "share": "40%"
        }
      ],
      "targeting": {
        "language": "Targeting includes English",
        "location": "Targeting includes Germany, France",
        "parameters": [
          {
            "name": "Job",
            "targeted": true,
            "excluded": false
          },
          {
            "name": "Company",
            "targeted": false,
            "excluded": true
          }
        ]
      },
      "paidBy": "Microsoft",
      "poster": {
        "name": "Microsoft",
        "title": null
      },
      "messageSender": null
    }
  },
  "collectedAt": "2026-11-14T12:00:00Z",
  "input": {
    "url": "https://www.linkedin.com/ad-library/detail/1643234054",
    "maxItems": 1
  }
}
```

### Ways to use the data

- See which ads a company has run on LinkedIn.
- Find ideas for your next ad by comparing the wording and formats of ads about a product or topic.
- When LinkedIn shares reach and targeting details, see how often an ad ran, each country's share of views and who the ad targeted.
- Keep a record of a brand's ads and when they ran for your campaign reports.
- Compare what companies in your market promote and how they present it.

### What to enter

| Field key | Name on the form | What to enter |
| --- | --- | --- |
| `mode` | What to collect | Choose one type of result per run, then fill in the fields for that choice. |
| `advertisers` | Advertisers or words | Enter company names like Microsoft or numeric advertiser IDs. If Search by is set to keyword, enter words you want to find in ads, like cloud security. |
| `searchBy` | Search by | Use advertiser (the default) to find ads from the companies you enter. Use keyword to find ads that mention your words, from any advertiser. |
| `countries` | Countries | Enter two-letter country codes in capitals to find ads shown in those countries. Use commas between codes, as in US,CA, or enter a single code like DE. Leave blank to include all countries. |
| `startDate` | Ran from | Enter the first day to include, such as 2026-10-01, and fill in Ran until. LinkedIn accepts dates from one year ago through yesterday. |
| `endDate` | Ran until | Enter the last day to include, such as 2026-10-31, and fill in Ran from. The end date must be on or after Ran from and no later than yesterday. |
| `adUrls` | Ad links | Paste links to individual ads from LinkedIn's public ad library. Example: https://www.linkedin.com/ad-library/detail/1643234054 |
| `maxItems` | Result limit per target | Set the most results to collect from each target, up to the mode's maximum. Leave this blank to use the mode's default limit. The limit you set doesn't apply to these modes, which return one result per target: Ad details. |
| `freshness` | Data freshness | Standard can return results faster when recently collected data is available. Choose Live to collect fresh data on every run. |

Example input:

```json
{
  "mode": "adlibrary-search",
  "advertisers": [
    "microsoft"
  ],
  "searchBy": "advertiser",
  "maxItems": 10,
  "freshness": "standard"
}
```

### Your results

Each mode has its own view of the results table. See **Collection modes** for what each mode returns.

Every row has a `status` field. For each entry that fails, the Actor returns one row with `status: "error"`. The `error` field has a `code` and a `message`. If a required field for your mode is blank, the run returns one error row and collects no data.

### Pricing

You pay per result. Prices for each Apify plan are in USD per 1,000 results.

| What you pay for | Free | Bronze | Silver | Gold | Platinum | Diamond |
| --- | --- | --- | --- | --- | --- | --- |
| Ad details result | $3.665 | $3.300 | $3.300 | $3.300 | $3.300 | $3.300 |
| Search ads result | $1.499 | $1.350 | $1.200 | $1.050 | $1.050 | $1.050 |

You don't pay for errors or empty results. The run stops when it reaches your spending limit.

On the free plan, you can collect up to 10 results per run and make up to 20 runs per day.

### Common questions

#### Which mode should I choose?

Use Search ads to find ads from the companies you name. To find ads that mention specific words, set Search by to keyword. If you already have links from the ad library, choose Ad details to get one ad per link.

#### Can I filter ads by country or date?

Yes. In Countries, enter two-letter codes like DE or US,CA. For a date filter, fill in both Ran from and Ran until. Both dates must be between one year ago and yesterday, inclusive. Ran until can be the same as Ran from or later. The tool rejects a search with invalid dates at no cost.

#### Can I see how often an ad was shown, who it targeted and who paid for it?

Yes, when LinkedIn publishes those details, mostly for ads shown in the EU. You can see who paid for the ad, the range of times it was shown (impressions) and each country's share of those impressions. Targeting details can include language, location and which groups the ad included or excluded. If LinkedIn doesn't show a detail, the tool leaves it blank.

#### Will I see whose name appears on an ad?

Yes, if the ad shows a name. For sponsored posts, you get the name and job title shown on the ad. For message ads, you get the sender's name and any photo shown on the ad. The tool doesn't look up anything else about the person.

#### Where do the ads come from?

The tool collects ads from LinkedIn's public ad library.

#### Do the ad dates include the time of day?

No. Start and end dates use day-precision, so you see the date without a time of day.

#### Do I need a LinkedIn account to collect ads?

No. The tool uses public information, so you don't need to sign in to LinkedIn or share login details or browser cookies.

#### How do I limit results, and what do I pay for?

Set Result limit per target to cap how many results you get for each entry. You pay only for ads the tool returns, so errors and empty results cost nothing. The run stops if it reaches your spending limit.

#### Is this tool affiliated with LinkedIn?

No. This tool is independent and isn't affiliated with, endorsed by or sponsored by LinkedIn. It collects only information LinkedIn makes public.

### Disclaimer

This Actor is not affiliated with, endorsed by, or sponsored by LinkedIn. All trademarks belong to their owners.

# Actor input Schema

## `mode` (type: `string`):

Choose one type of result per run, then fill in the fields for that choice.

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

Enter company names like Microsoft or numeric advertiser IDs. If Search by is set to keyword, enter words you want to find in ads, like cloud security.

## `searchBy` (type: `string`):

Use advertiser (the default) to find ads from the companies you enter. Use keyword to find ads that mention your words, from any advertiser.

## `countries` (type: `string`):

Enter two-letter country codes in capitals to find ads shown in those countries. Use commas between codes, as in US,CA, or enter a single code like DE. Leave blank to include all countries.

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

Enter the first day to include, such as 2026-10-01, and fill in Ran until. LinkedIn accepts dates from one year ago through yesterday.

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

Enter the last day to include, such as 2026-10-31, and fill in Ran from. The end date must be on or after Ran from and no later than yesterday.

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

Paste links to individual ads from LinkedIn's public ad library. Example: https://www.linkedin.com/ad-library/detail/1643234054

## `maxItems` (type: `integer`):

Set the most results to collect from each target, up to the mode's maximum. Leave this blank to use the mode's default limit. The limit you set doesn't apply to these modes, which return one result per target: Ad details.

## `freshness` (type: `string`):

Standard can return results faster when recently collected data is available. Choose Live to collect fresh data on every run.

## Actor input object example

```json
{
  "mode": "adlibrary-search",
  "advertisers": [
    "microsoft"
  ],
  "searchBy": "advertiser",
  "adUrls": [
    "https://www.linkedin.com/ad-library/detail/1643234054"
  ],
  "maxItems": 10,
  "freshness": "standard"
}
```

# Actor output Schema

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

See everything this run collected in one table.

# 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 = {
    "mode": "adlibrary-search",
    "advertisers": [
        "microsoft"
    ],
    "adUrls": [
        "https://www.linkedin.com/ad-library/detail/1643234054"
    ],
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("icoe-man/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 = {
    "mode": "adlibrary-search",
    "advertisers": ["microsoft"],
    "adUrls": ["https://www.linkedin.com/ad-library/detail/1643234054"],
    "maxItems": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("icoe-man/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 '{
  "mode": "adlibrary-search",
  "advertisers": [
    "microsoft"
  ],
  "adUrls": [
    "https://www.linkedin.com/ad-library/detail/1643234054"
  ],
  "maxItems": 10
}' |
apify call icoe-man/linkedin-ads-scraper --silent --output-dataset

```

## MCP server setup

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