# LinkedIn Ad Library Scraper – No Login (`datascraperes/linkedin-ad-library-scraper`) Actor

Scrape public LinkedIn Ad Library results by keyword, advertiser, or payer. Extract ad copy, creative media, advertiser, payer, dates, landing pages, impressions, and targeting data without login or cookies.

- **URL**: https://apify.com/datascraperes/linkedin-ad-library-scraper.md
- **Developed by:** [DataScraperES](https://apify.com/datascraperes) (community)
- **Categories:** SEO tools, Social media
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$2.00 / 1,000 ad 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/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 Ad Library Scraper – No Login

[Run the Actor on Apify](https://apify.com/datascraperes/linkedin-ad-library-scraper)

Search LinkedIn's public Ad Library and export ads as structured JSON, CSV, Excel, XML, or RSS. The Actor searches by keyword, advertiser, or payer and can enrich every ad with its public detail page—no LinkedIn account, cookies, or session token required.

### What you can collect

Each dataset item represents one unique LinkedIn ad and can include:

- LinkedIn ad ID and public Ad Library URL
- Advertiser name, LinkedIn URL, identifier, and logo
- Entity shown in the **Paid for by** field
- Ad format and LinkedIn creative type
- Primary text, headline, description, and call to action
- Landing-page URL
- Creative image, video, and poster URLs
- First and last run dates
- Total impression range and impressions by country, when shown
- Targeting categories and targeted/excluded parameter groups, when shown
- Multiple creative variants belonging to the same ad
- Search source and UTC collection timestamp

LinkedIn does not disclose every field for every ad. Missing information is returned as `null` or an empty array instead of being guessed.

### How to use the Actor

1. Open the Actor and select **Create new task** or **Start**.
2. Add at least one value under **Keywords**, **Advertisers**, or **Payers**.
3. Choose the countries and date range.
4. Set **Maximum ads** to the total number of unique ads you want across all searches.
5. Keep **Fetch full ad details** enabled for payer, dates, landing pages, complete media, impressions, and targeting data.
6. Start the run and open the **Dataset** tab to preview or export the results.

Duplicate ad IDs found by several searches are written only once.

### Input

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `keywords` | `string[]` | `[]` | Words or phrases matched against public ads. Each item is a separate search. |
| `advertisers` | `string[]` | `[]` | Advertiser names, LinkedIn company slugs, or full company URLs. |
| `payers` | `string[]` | `[]` | Names shown in LinkedIn's **Paid for by** field. |
| `countries` | `string[]` | `["US"]` | Two-letter country codes. Use `["ALL"]` to search all countries. |
| `dateOption` | `string` | `"last-30-days"` | `last-30-days`, `current-month`, `current-year`, `last-year`, or `custom-date-range`. |
| `startDate` | `string \| null` | `null` | Custom start date in `YYYY-MM-DD` format. |
| `endDate` | `string \| null` | `null` | Custom end date in `YYYY-MM-DD` format. |
| `maxResults` | `integer` | `100` | Global limit from 1 to 1,000 unique ads. |
| `fetchDetails` | `boolean` | `true` | Enrich each search result using its public ad detail page. |

At least one keyword, advertiser, or payer is required. A run accepts up to 50 combined searches.

#### Example: keywords and advertisers

```json
{
  "keywords": ["marketing automation", "artificial intelligence"],
  "advertisers": [
    "microsoft",
    "https://www.linkedin.com/company/hubspot/"
  ],
  "countries": ["US", "GB"],
  "dateOption": "last-30-days",
  "maxResults": 100,
  "fetchDetails": true
}
````

#### Example: payer with a custom date range

```json
{
  "payers": ["Example Media LLC"],
  "countries": ["ALL"],
  "dateOption": "custom-date-range",
  "startDate": "2026-06-01",
  "endDate": "2026-06-30",
  "maxResults": 50,
  "fetchDetails": true
}
```

### Output example

```json
{
  "adId": "1234567890",
  "adLibraryUrl": "https://www.linkedin.com/ad-library/detail/1234567890",
  "advertiserName": "Example Company",
  "advertiserUrl": "https://www.linkedin.com/company/example-company",
  "advertiserSlug": "example-company",
  "advertiserLogoUrl": "https://media.licdn.com/dms/image/example-logo",
  "paidBy": "Example Company LLC",
  "creativeType": "SPONSORED_STATUS_UPDATE",
  "format": "image",
  "body": "Build a faster reporting workflow.",
  "headline": "Download the 2026 benchmark report",
  "headlineDescription": null,
  "cta": "Download",
  "destinationUrl": "https://example.com/report?utm_source=linkedin",
  "imageUrls": [
    "https://media.licdn.com/dms/image/example-creative"
  ],
  "videoUrls": [],
  "videoPosterUrl": null,
  "isRestricted": false,
  "startDate": "2026-06-10",
  "endDate": "2026-06-30",
  "runDateText": "Ran from Jun 10, 2026 to Jun 30, 2026",
  "totalImpressions": "1k – 5k",
  "impressionsByCountry": [
    {"country": "United States", "percentage": 82.0},
    {"country": "United Kingdom", "percentage": 18.0}
  ],
  "targeting": [
    {"category": "Language", "details": "Targeting includes English"}
  ],
  "targetingMatrix": [
    {"parameter": "Company", "targeted": true, "excluded": false}
  ],
  "variantsCount": 1,
  "variants": [
    {
      "body": "Build a faster reporting workflow.",
      "headline": "Download the 2026 benchmark report",
      "headlineDescription": null,
      "cta": "Download",
      "destinationUrl": "https://example.com/report?utm_source=linkedin",
      "imageUrls": ["https://media.licdn.com/dms/image/example-creative"],
      "videoUrls": [],
      "videoPosterUrl": null
    }
  ],
  "detailsFetched": true,
  "detailStatus": "success",
  "source": {
    "type": "keyword",
    "value": "marketing automation",
    "countries": ["US", "GB"],
    "dateOption": "last-30-days",
    "startDate": null,
    "endDate": null
  },
  "scrapedAt": "2026-07-13T16:20:00Z"
}
```

When detail enrichment is disabled, `detailsFetched` is `false` and `detailStatus` is `not_requested`. If an individual detail page is temporarily unavailable, the valid search-card data is still returned and `detailStatus` describes the missing enrichment.

### Run through the Apify API

Start a run with your Apify API token:

```bash
curl -X POST \
  "https://api.apify.com/v2/acts/datascraperes~linkedin-ad-library-scraper/runs?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "keywords": ["B2B software"],
    "countries": ["US"],
    "dateOption": "last-30-days",
    "maxResults": 25,
    "fetchDetails": true
  }'
```

You can also run the Actor from JavaScript, Python, Make, Zapier, n8n, or any service that can call the Apify API. Use the run's `defaultDatasetId` to download the resulting items.

### Billing behavior

Each unique ad successfully written to the dataset counts as one result when pay-per-event pricing is enabled. Duplicate ads, failed searches, retries, and detail pages that do not create an additional dataset item are not separate results. The current unit price and platform usage are shown on the Actor page before you run it.

### Data availability and responsible use

- The Actor reads only pages exposed by LinkedIn's public Ad Library.
- Ads and transparency fields vary by country, date, ad format, and disclosure requirements.
- The public library can change over time, so repeated searches may return different totals.
- Use the results in accordance with applicable laws, privacy rules, and LinkedIn's terms.

# Actor input Schema

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

Find ads whose content matches each keyword or phrase. Each item runs as a separate search.

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

Advertiser names, LinkedIn company slugs, or full LinkedIn company URLs. Each item runs as a separate search.

## `payers` (type: `array`):

Names shown in LinkedIn's Paid for by field. Each item runs as a separate search.

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

Two-letter country codes for where the ads were served. Use ALL alone to search every country.

## `dateOption` (type: `string`):

Limit results to ads active during the selected period.

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

Start date in YYYY-MM-DD format. Required only for a custom date range.

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

End date in YYYY-MM-DD format. Required only for a custom date range.

## `maxResults` (type: `integer`):

Maximum number of unique ads returned across all searches. Duplicate ad IDs are written only once.

## `fetchDetails` (type: `boolean`):

Open each public detail page to add payer, run dates, destination URL, full media, impressions, and targeting data when LinkedIn provides them.

## Actor input object example

```json
{
  "keywords": [
    "artificial intelligence"
  ],
  "advertisers": [],
  "payers": [],
  "countries": [
    "US"
  ],
  "dateOption": "last-30-days",
  "maxResults": 100,
  "fetchDetails": true
}
```

# Actor output Schema

## `ads` (type: `string`):

No description

## `summary` (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": [
        "artificial intelligence"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("datascraperes/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 = { "keywords": ["artificial intelligence"] }

# Run the Actor and wait for it to finish
run = client.actor("datascraperes/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 '{
  "keywords": [
    "artificial intelligence"
  ]
}' |
apify call datascraperes/linkedin-ad-library-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "LinkedIn Ad Library Scraper – No Login",
        "description": "Scrape public LinkedIn Ad Library results by keyword, advertiser, or payer. Extract ad copy, creative media, advertiser, payer, dates, landing pages, impressions, and targeting data without login or cookies.",
        "version": "0.1",
        "x-build-id": "3Zbb4iL0Hi9GxVIVR"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/datascraperes~linkedin-ad-library-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-datascraperes-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/datascraperes~linkedin-ad-library-scraper/runs": {
            "post": {
                "operationId": "runs-sync-datascraperes-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/datascraperes~linkedin-ad-library-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-datascraperes-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",
                "properties": {
                    "keywords": {
                        "title": "Keywords",
                        "maxItems": 25,
                        "type": "array",
                        "description": "Find ads whose content matches each keyword or phrase. Each item runs as a separate search.",
                        "items": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 200
                        },
                        "default": []
                    },
                    "advertisers": {
                        "title": "Advertisers",
                        "maxItems": 25,
                        "type": "array",
                        "description": "Advertiser names, LinkedIn company slugs, or full LinkedIn company URLs. Each item runs as a separate search.",
                        "items": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 300
                        },
                        "default": []
                    },
                    "payers": {
                        "title": "Payers",
                        "maxItems": 25,
                        "type": "array",
                        "description": "Names shown in LinkedIn's Paid for by field. Each item runs as a separate search.",
                        "items": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 200
                        },
                        "default": []
                    },
                    "countries": {
                        "title": "Countries",
                        "minItems": 1,
                        "maxItems": 20,
                        "type": "array",
                        "description": "Two-letter country codes for where the ads were served. Use ALL alone to search every country.",
                        "items": {
                            "type": "string",
                            "pattern": "^(ALL|[A-Za-z]{2})$"
                        },
                        "default": [
                            "US"
                        ]
                    },
                    "dateOption": {
                        "title": "Date range",
                        "enum": [
                            "last-30-days",
                            "current-month",
                            "current-year",
                            "last-year",
                            "custom-date-range"
                        ],
                        "type": "string",
                        "description": "Limit results to ads active during the selected period.",
                        "default": "last-30-days"
                    },
                    "startDate": {
                        "title": "Custom start date",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                        "type": "string",
                        "description": "Start date in YYYY-MM-DD format. Required only for a custom date range."
                    },
                    "endDate": {
                        "title": "Custom end date",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                        "type": "string",
                        "description": "End date in YYYY-MM-DD format. Required only for a custom date range."
                    },
                    "maxResults": {
                        "title": "Maximum ads",
                        "minimum": 1,
                        "maximum": 1000,
                        "type": "integer",
                        "description": "Maximum number of unique ads returned across all searches. Duplicate ad IDs are written only once.",
                        "default": 100
                    },
                    "fetchDetails": {
                        "title": "Fetch full ad details",
                        "type": "boolean",
                        "description": "Open each public detail page to add payer, run dates, destination URL, full media, impressions, and targeting data when LinkedIn provides them.",
                        "default": 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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
