# Linkedin Ads Scraper (`data_xplorer/linkedin-ad-library-scraper`) Actor

💸 CHEAPEST LINKEDIN ADS SCRAPER 💸  Scrape LinkedIn Ad Library at scale: extract advertisers, campaigns, creatives, targeting, and impressions by country. Clean URLs, standardized dates, JSON output, and a proxy-ready API for market research and competitor insights.

- **URL**: https://apify.com/data\_xplorer/linkedin-ad-library-scraper.md
- **Developed by:** [Data Xplorer](https://apify.com/data_xplorer) (community)
- **Categories:** Lead generation, Social media, Automation
- **Stats:** 60 total users, 10 monthly users, 100.0% runs succeeded, 2 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $0.50 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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 Ads Scraper 

> 💡
> A powerful scraper to extract advertising data from the LinkedIn Ads Library, providing comprehensive insights into LinkedIn advertising campaigns

Extract detailed advertising data from LinkedIn's Ad Library with this reliable scraping solution! Get structured data about ads, including advertiser information, campaign details, targeting, and performance metrics. Perfect for market research, competitor analysis, and advertising insights.

![trends scraper](https://i.ibb.co/xt3rYKt0/Flux-Dev-A-vibrant-banner-in-the-retrofuturistic-style-of-GTA-3.jpg)

### ✨ What You'll Get

#### 💎 Why Choose Our LinkedIn Ads Scraper?
- Complete extraction of ad content, creative assets, and advertiser details
- Precise impression calculations and estimated reach metrics by country
- Standardized date formats (MM/DD/YYYY) with automatic timestamp conversion
- Smart URL processing with optional decoding of shortened links (bit.ly, lnkd.in)
- High-performance batch processing optimized for large-scale scraping

#### 📊 Available Data
- Ad details and content
- Advertiser information
- Campaign dates and performance
- Targeting information
- Impression statistics by country
- Ad media (images, videos)
- Campaign URLs and links

### 🤖 Easy Automation with Make & n8n
The Linkedin Ads Scraper is fully compatible with automation tools like Make  and n8n — no coding required! 🎉

👉 [Make x Apify Integration Docs](https://www.make.com/en/integrations/apify)

👉 [n8n x Apify Docs](https://n8n.io/integrations/apify/)

#### Data Structure Details
| Field | Type | Description |
|-------|------|-------------|
| id | string | Unique ad identifier (numeric string) |
| advertiserName | string | Name of the advertiser company or member |
| advertiserLogo | string | URL of advertiser's logo or profile picture |
| adImage | string | URL of ad creative (image, video poster, or document cover) |
| Publication Date | array | Ad run dates (Human readable) |
| Publication Timestamps | array | Ad run dates (Unix Timestamps) |
| adType | string | Type of advertisement (Video, Image, Carousel, Document...) |
| adDescription | string | Ad copy text (post content) |
| adHashtags | array | List of hashtags extracted from description |
| adTotalImpressions | string | Estimated total impressions (e.g. "5k-10k") |
| adImpressionsCountry | array | Breakdown of impressions by country with percentages |
| adTargetingAudience | array | Detailed targeting criteria (Location, Language, Job, Company...) |
| adUrl | string | Ad detail page URL on LinkedIn Ad Library |
| adLinkUrl | string | Advertisement destination URL (Landing Page) |
| adPaidBy | string | Entity paying for the ad |

### 🚀 Performance Features
#### ⚡️ Lightning Fast:
- Parallel processing of ad pages
- Optimized batch processing
- Smart proxy handling
- Efficient URL cleaning and resolving

#### 🛠️ Smart Handling:
- Proxy support
- Dynamic content extraction
- Automatic pagination
- Robust error recovery
- Multiple ad format support

#### 🎯 Coverage:
- All ad types supported

### 📋  Quick Start
#### Input Parameters
| Parameter	| Type | Default | Description |
|-----------|------|-------|----------------|
| searchUrl | string | required | LinkedIn Ads Library search URL 
| maxItems| integer | 20 |  Maximum number of ads to scrape |
| decodeUrls | boolean | false | If enabled, decodes shortened URLs (bit.ly, lnkd.in) |
| proxyType| string | Datacenter |  Type of proxy to use |

#### Input 
```json
{
    "decodeUrls": false,
    "maxItems": 20,
    "proxyConfiguration": {
        "useApifyProxy": true
    },
    "searchUrl": "https://www.linkedin.com/ad-library/search?keyword=energy"
}
````

#### Output Example

```json
{
    "id": "38459102",
    "advertiserName": "Example Company",
    "advertiserLogo": "https://media.licdn.com/dms/image/logo.jpg",
    "adImage": "https://media.licdn.com/dms/image/ad-creative.jpg",
    "adLinkUrl": "https://example.com/careers?utm_source=linkedin",
    "rawUrl": "https://lnkd.in/d/xyz...",
    "Publication Date": [
        {
            "start": "02/01/2026"
        },
        {
            "end": "02/28/2026"
        }
    ],
    "Publication Timestamps": [
        {
            "type": "Start",
            "value": 1770076800000
        },
        {
            "type": "End",
            "value": 1772409600000
        }
    ],
    "adType": "Document",
    "adDescription": "Join our team of experts! We're looking for talented professionals to drive innovation and growth. Click to learn more about our exciting opportunities.",
    "adHashtags": [
        "hiring",
        "jobs",
        "careers"
    ],
    "adTotalImpressions": "10k-50k",
    "adImpressionsCountry": [
        {
            "country": "France",
            "percentage": "45%",
            "estimatedImpressions": {
                "min": 4500,
                "max": 22500
            }
        },
        {
            "country": "Belgium",
            "percentage": "30%",
            "estimatedImpressions": {
                "min": 3000,
                "max": 15000
            }
        },
        {
            "country": "Switzerland",
            "percentage": "25%",
            "estimatedImpressions": {
                "min": 2500,
                "max": 12500
            }
        }
    ],
    "adTargetingAudience": [
        {
            "type": "Location",
            "value": "France, Belgium, Switzerland"
        },
        {
            "type": "Language",
            "value": "English"
        },
        {
            "type": "Criteria",
            "value": "Companies with 1000+ employees",
            "status": "Included"
        }
    ],
    "adUrl": "https://www.linkedin.com/ad-library/detail/38459102",
    "adPaidBy": "Example Company Global Services"
}
```

### 🔒 Reliability & Performance

#### Data Quality

- Structured ad content extraction
- Clean URL processing
- Consistent date formatting
- Reliable impression data
- Comprehensive targeting information

#### Technical Robustness

- Proxy rotation support
- Automatic retry mechanism
- Smart error handling
- Rate limiting compliance
- Session management

#### Performance Optimization

- Parallel request processing
- Efficient memory usage
- Smart batch processing
- Optimized content parsing

### 🤝 Support

- Need assistance? We're here to help!
- Open an issue for feature requests
- Technical support available
- Regular updates and maintenance

### 📝 Notes

- Respects LinkedIn's terms of service
- Data is from public Ad Library
- Use responsibly and ethically

# Actor input Schema

## `searchUrl` (type: `string`):

URL of the LinkedIn Ads Library search page you want to scrape (e.g. https://www.linkedin.com/ad-library/search?keyword=recrutement)

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

Maximum number of ads to scrape (default: 20)

## `decodeUrls` (type: `boolean`):

If enabled, the scraper will attempt to decode shortened URLs (bit.ly, lnkd.in). This provides complete URLs but slightly slows down the extraction process

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

Configure Apify Proxy. By default, standard Datacenter proxies are used. Switch to RESIDENTIAL if you encounter blocks.

## Actor input object example

```json
{
  "searchUrl": "https://www.linkedin.com/ad-library/search?keyword=energy",
  "maxItems": 20,
  "decodeUrls": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `scrapedAds` (type: `string`):

The full list of scraped ads in JSON format.

# 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 = {
    "searchUrl": "https://www.linkedin.com/ad-library/search?keyword=energy",
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("data_xplorer/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 = {
    "searchUrl": "https://www.linkedin.com/ad-library/search?keyword=energy",
    "maxItems": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("data_xplorer/linkedin-ad-library-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "searchUrl": "https://www.linkedin.com/ad-library/search?keyword=energy",
  "maxItems": 20
}' |
apify call data_xplorer/linkedin-ad-library-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=data_xplorer/linkedin-ad-library-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Linkedin Ads Scraper",
        "description": "💸 CHEAPEST LINKEDIN ADS SCRAPER 💸  Scrape LinkedIn Ad Library at scale: extract advertisers, campaigns, creatives, targeting, and impressions by country. Clean URLs, standardized dates, JSON output, and a proxy-ready API for market research and competitor insights.",
        "version": "1.5",
        "x-build-id": "GcR4JicOWaPQ3xxiF"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/data_xplorer~linkedin-ad-library-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-data_xplorer-linkedin-ad-library-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/data_xplorer~linkedin-ad-library-scraper/runs": {
            "post": {
                "operationId": "runs-sync-data_xplorer-linkedin-ad-library-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/data_xplorer~linkedin-ad-library-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-data_xplorer-linkedin-ad-library-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "searchUrl"
                ],
                "properties": {
                    "searchUrl": {
                        "title": "LinkedIn Ads Search URL",
                        "type": "string",
                        "description": "URL of the LinkedIn Ads Library search page you want to scrape (e.g. https://www.linkedin.com/ad-library/search?keyword=recrutement)"
                    },
                    "maxItems": {
                        "title": "Maximum number of ads",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Maximum number of ads to scrape (default: 20)"
                    },
                    "decodeUrls": {
                        "title": "Decode shortened URLs",
                        "type": "boolean",
                        "description": "If enabled, the scraper will attempt to decode shortened URLs (bit.ly, lnkd.in). This provides complete URLs but slightly slows down the extraction process",
                        "default": false
                    },
                    "proxyConfiguration": {
                        "title": "Proxy Configuration",
                        "type": "object",
                        "description": "Configure Apify Proxy. By default, standard Datacenter proxies are used. Switch to RESIDENTIAL if you encounter blocks.",
                        "default": {
                            "useApifyProxy": true
                        }
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
