# Linkedin Ads Library (`data_link_miner/linkedin-ads-library`) Actor

The scraper extract LinkedIn ads data & detect active advertisers. This actor allows you to scrape LinkedIn Ads Library to either: Extract full ad creatives and metadata.Check whether a company is running ads and how many ads are active

- **URL**: https://apify.com/data_link_miner/linkedin-ads-library.md
- **Developed by:** [Data LinkMiner](https://apify.com/data_link_miner) (community)
- **Categories:** Automation, Social media, Lead generation
- **Features:** Limited permissions
- **Stats:** 26 total users, 2 monthly users, 19.0% runs succeeded, 2 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 results

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/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 Library Scraper

Extract LinkedIn ads data & detect active advertisers

This actor allows you to scrape LinkedIn Ads Library to either:

📄 Extract full ad creatives and metadata

📊 Check whether a company is running ads and how many ads are active

### What This Scraper Does

Scrapes LinkedIn Ads Library results

Extracts detailed ad information (text, images, targeting, impressions)

Detects if a company is actively running ads

Returns structured JSON suitable for analysis, reporting, or monitoring

Supports multiple ad formats (image, video, document, sponsored posts)

### Features

📄 Ad Details Extraction

- For each ad, the scraper can extract:

- Ad type (Sponsored Post, Status Update, etc.)

- Advertiser name & LinkedIn company URL

- Ad copy (body text & headline)

- CTA label & destination URL

- Image, video, or document assets

- Paying entity (legal advertiser)

- Ad start & end dates

- Estimated total impressions range

- Impressions breakdown by country

- Targeting settings (location, language, exclusions)

📊 Advertiser Activity Detection

- Check if a company is currently running ads

- Retrieve the total number of ads found

- Lightweight mode (no creative extraction)

⚙️ General

- Authenticated scraping via LinkedIn cookies

- Works with keyword or advertiser search URLs

- Clean, normalized JSON output

- Designed for monitoring & competitive analysis

### Use Cases

🧠 Competitive ad intelligence

📢 Ad creative inspiration & benchmarking

🏢 Brand monitoring & reputation analysis

📈 Marketing & media buying research

🌍 Geographic targeting insights

🕵️ Detect if competitors are actively advertising

🧾 Compliance & transparency research

### OUTPUT

Ads detail

```json
{
  "ad_type": "SPONSORED_STATUS_UPDATE",
  "href": "https://www.linkedin.com/ad-library/detail/464936606",
  "body": [
    "[Contenu proposé par HP avec Intel®] Le travail hybride offre une agilité sans précédent, mais il présente également des défis en matière de cybersécurité. Découvrez comment protéger vos collaborateurs à distance avec une approche résiliente face aux cybermenaces "
  ],
  "video_url": "",
  "image_urls": [
    "https://media.licdn.com/dms/image/D5610AQHORJ5eMErc3A/image-shrink_1280/0/1719241041817/IC-COMM_LKpost2_LM_FR_7680x4320_NA_Static_LinkedIn___737837_2072980jpg?e=2147483647&v=beta&t=APItq9QggHy4NZKm3pENW8B3BRapuQ539Sv5aa9n75E"
  ],
  "document_url": "",
  "document_transcript": [],
  "advertiser_name": "Les Echos",
  "advertiser_linkedin": "https://www.linkedin.com/company/164716",
  "headline": "Cybersécurité : comment les entreprises relèvent les défis du travail hybride",
  "CTA_url": "https://www.lesechos.fr/partenaires/hp/cybersecurite-comment-les-entreprises-relevent-les-defis-du-travail-hybride-2087429?trk=ad_library_ad_preview_headline_content",
  "CTA_name": "En savoir plus",
  "paying_entity": "LES ECHOS LE PARISIEN MEDIAS",
  "ad_start": "2024-06-24",
  "ad_end": "2024-07-17",
  "total_impressions": "500k-1M",
  "impressions_per_country": [
    {
      "country": "France",
      "impressions": "68%"
    },
    {
      "country": "United States",
      "impressions": "25%"
    },
    {
      "country": "Canada",
      "impressions": "1%"
    },
    {
      "country": "India",
      "impressions": "<1%"
    },
    {
      "country": "United Kingdom",
      "impressions": "<1%"
    },
    ...
  ],
  "targeting_settings": {
    "Language": [
      "Français"
    ],
    "Location": [
      "France"
    ],
    "Company": "Exclusion targeting applied"
  }
}
```

Is a company running

```json
{
  "input_url": "https://www.linkedin.com/ad-library/search?keyword=lesechos",
  "is_running_ads": true,
  "total_ads": "930"
}
```

### SUPPORT

Create an issue and share the failed run.

We will help resolve the problem.

We also stay available for questions

# Actor input Schema

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

The best option is usually Automatic proxy. But you can also use your own proxies or no proxy

## `is_running_ads` (type: `boolean`):

If not selected, we will collect ads details

## `limit` (type: `integer`):

0 = no limit

## `type_search` (type: `string`):

Select your country

## `search_url` (type: `string`):

URL to start with

## `accountOwner` (type: `string`):

same search box as linkedin

## `word_search` (type: `string`):

same search box as linkedin

## `date_range_type` (type: `string`):

If custom selected, you need to provide a start and end date

## `date_start` (type: `string`):

mandatory when selecting date range as 'Custom date range'

## `date_end` (type: `string`):

mandatory when selecting date range as 'Custom date range'

## `country` (type: `string`):

Select a country to limit your search results

## `combine_companies_onesearch` (type: `boolean`):

Select if you want 1 search for X companies or X searchs for X companies. Default value is False, 1 search per company in the list

## `companies` (type: `array`):

Provide companies to be searched on linkedin ads library

## `company_word_search` (type: `string`):

Keyword search

## `company_date_range_type` (type: `string`):

If custom selected, you need to provide a start and end date

## `company_date_start` (type: `string`):

mandatory when selecting date range as 'Custom date range'

## `company_date_end` (type: `string`):

mandatory when selecting date range as 'Custom date range'

## `company_country` (type: `string`):

Select a country to limit your search results

## Actor input object example

```json
{
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": []
  },
  "is_running_ads": false,
  "limit": 5,
  "type_search": "search_url",
  "search_url": "https://www.linkedin.com/ad-library/search?accountOwner=les+echos&keyword=entreprise&countries=FR&dateOption=last-30-days",
  "accountOwner": "",
  "word_search": "",
  "date_range_type": "last-30-days",
  "date_start": "",
  "date_end": "",
  "country": "ALL",
  "combine_companies_onesearch": false,
  "companies": [
    {
      "url": "https://www.linkedin.com/company/les-echos"
    }
  ],
  "company_word_search": "",
  "company_date_range_type": "last-30-days",
  "company_date_start": "",
  "company_date_end": "",
  "company_country": "ALL"
}
```

# 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 = {
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": []
    },
    "limit": 5,
    "search_url": "https://www.linkedin.com/ad-library/search?accountOwner=les+echos&keyword=entreprise&countries=FR&dateOption=last-30-days",
    "accountOwner": "",
    "word_search": "",
    "date_start": "",
    "date_end": "",
    "companies": [
        {
            "url": "https://www.linkedin.com/company/les-echos"
        }
    ],
    "company_word_search": "",
    "company_date_start": "",
    "company_date_end": ""
};

// Run the Actor and wait for it to finish
const run = await client.actor("data_link_miner/linkedin-ads-library").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 = {
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": [],
    },
    "limit": 5,
    "search_url": "https://www.linkedin.com/ad-library/search?accountOwner=les+echos&keyword=entreprise&countries=FR&dateOption=last-30-days",
    "accountOwner": "",
    "word_search": "",
    "date_start": "",
    "date_end": "",
    "companies": [{ "url": "https://www.linkedin.com/company/les-echos" }],
    "company_word_search": "",
    "company_date_start": "",
    "company_date_end": "",
}

# Run the Actor and wait for it to finish
run = client.actor("data_link_miner/linkedin-ads-library").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 '{
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": []
  },
  "limit": 5,
  "search_url": "https://www.linkedin.com/ad-library/search?accountOwner=les+echos&keyword=entreprise&countries=FR&dateOption=last-30-days",
  "accountOwner": "",
  "word_search": "",
  "date_start": "",
  "date_end": "",
  "companies": [
    {
      "url": "https://www.linkedin.com/company/les-echos"
    }
  ],
  "company_word_search": "",
  "company_date_start": "",
  "company_date_end": ""
}' |
apify call data_link_miner/linkedin-ads-library --silent --output-dataset

```

## MCP server setup

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

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/RLgpE9ZVQiH8CznJ2/builds/sSn033qBxrnUidds0/openapi.json
