# LinkedIn Ads Library Scraper (`trovevault/linkedin-ads-library-scraper`) Actor

Extract public LinkedIn ad previews with advertiser names, creative IDs, fuller ad text, linked mentions, headlines, CTA labels, ad formats, images, and paid-for entities.

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

## Pricing

from $0.85 / 1,000 ads

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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/docs.md):

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

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.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/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 Library Scraper

Extract public LinkedIn ad previews for B2B competitor monitoring, creative research, and campaign tracking. The actor searches LinkedIn's public Ad Library by brand, company name, competitor, or keyword, then returns public ad cards with advertiser names, creative IDs, ad text, linked mentions, headlines, CTA labels, image URLs, ad format labels, paid-for entities, and direct detail links.

Use it when you want repeatable LinkedIn ad data for brands such as Nike, Salesforce, HubSpot, or a client competitor list without manually searching LinkedIn's Ad Library.

### Why use LinkedIn Ads Library Scraper?

- Monitor public LinkedIn ads by brand, company, competitor, or topic.
- Build B2B creative swipe files from public promoted post previews.
- Export ad text, linked mentions, headline, CTA, image, advertiser, ad format, paid-for entity, and detail URLs.
- Feed agency reports, sales intelligence, or cross-platform ad monitoring workflows.
- Keep the run cheap by using public HTML pages instead of browser automation.

### What data does LinkedIn Ads Library Scraper extract?

| Field group | Fields |
|---|---|
| Search context | `target`, `runId` |
| Advertiser identity | `advertiserName`, `companyUrl`, `paidForBy`, `logoUrl` |
| Creative identity | `creativeId`, `creativeType`, `adFormat`, `adDetailsUrl` |
| Copy and assets | `creativeText`, `linkedMentions`, `headline`, `callToAction`, `imageUrl` |

The actor uses the public LinkedIn Ad Library pages tested for guest access. It does not require a LinkedIn login for the tested search and detail paths.

### Who uses LinkedIn Ads Library Scraper?

**B2B growth teams** can monitor competitor messaging and promoted post angles.

**Agencies** can run scheduled checks for client competitors and export LinkedIn creative examples.

**Sales and RevOps teams** can spot campaign themes around accounts, categories, or buying committees.

**Researchers** can collect public LinkedIn ad previews with direct detail links for review.

### What input does LinkedIn Ads Library Scraper accept?

```json
{
  "targets": ["Nike", "Salesforce"],
  "maxAds": 40,
  "sortOrder": "DESCENDING"
}
````

| Input | Required | Description |
|---|---:|---|
| `targets` | Yes | Brand names, company names, or keywords. Examples: `Nike`, `Salesforce`, `B2B marketing`. |
| `maxAds` | No | Maximum ad previews to return per target. Default: `40`; maximum: `250`. |
| `sortOrder` | No | `DESCENDING` for newest first or `ASCENDING` for oldest first. Default: `DESCENDING`. |
| `datasetId` | No | Existing Apify dataset ID for pipeline runs. Rows are appended there in addition to the default run dataset. |
| `runId` | No | External workflow ID copied to output rows and `RUN_SUMMARY`. |

### What output does LinkedIn Ads Library Scraper return?

Example row:

```json
{
  "target": "Nike",
  "advertiserName": "MarqVision",
  "creativeId": "1499909906",
  "creativeType": "SPONSORED_STATUS_UPDATE",
  "adFormat": "Single Image Ad",
  "creativeText": "At Nike's volume, fakes reappear as fast as they come down. Proactive control changes what's measured: not how many listings were removed, but whether exposure is actually falling.",
  "linkedMentions": ["Nike"],
  "headline": "Removed by you. Relisted by them.",
  "callToAction": "Learn more",
  "imageUrl": "https://media.licdn.com/dms/image/v2/...",
  "paidForBy": "Marq Vision Inc.",
  "companyUrl": "https://www.linkedin.com/company/35587681",
  "adDetailsUrl": "https://www.linkedin.com/ad-library/detail/1499909906"
}
```

For each result, the actor opens the public detail page when a creative ID is available. This usually provides fuller ad text than the search preview, plus the public `adFormat` label shown by LinkedIn, such as `Single Image Ad` or `Video Ad`. `linkedMentions` lists public LinkedIn entities linked inside the ad text; those mentions remain in `creativeText` as part of the original copy. The actor does not infer feed placement or campaign setup fields when LinkedIn does not expose them.

### How do I run LinkedIn Ads Library Scraper?

1. Add one or more brand names, company names, or keywords.
2. Set `maxAds` based on how deep you want the run to go.
3. Choose newest-first or oldest-first sorting.
4. Run the actor and download the dataset as JSON, CSV, Excel, or through the Apify API.

### How can I use LinkedIn Ads Library Scraper through the API?

```bash
curl "https://api.apify.com/v2/acts/YOUR_USERNAME~linkedin-ads-library-scraper/runs" \
  -X POST \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  -d '{
    "targets": ["Nike"],
    "maxAds": 40
  }'
```

Fetch dataset items:

```bash
curl "https://api.apify.com/v2/datasets/DATASET_ID/items?clean=true" \
  -H "Authorization: Bearer $APIFY_TOKEN"
```

### How can I monitor advertisers over time?

Schedule the actor daily or weekly with the same targets. Use `creativeId`, `advertiserName`, `creativeText`, `linkedMentions`, `headline`, and `adDetailsUrl` to deduplicate and detect new creative angles.

### What are the limits of LinkedIn Ads Library Scraper?

- The actor returns data visible through public LinkedIn Ad Library guest pages.
- It does not claim complete LinkedIn Ads account or campaign coverage.
- Public pages may not expose dates, impressions, spend, targeting, or all creative variants.
- Placement-style labels such as feed placement are not returned unless LinkedIn exposes them as public text.
- Search results can include ads that mention the keyword but are not owned by the brand.
- LinkedIn can change public HTML structure. The actor records failures in `RUN_SUMMARY` rather than inventing rows.

### How do I troubleshoot LinkedIn Ads Library Scraper?

| Issue | Likely cause | Solution |
|---|---|---|
| Search results include unrelated companies | Keyword search matches ad copy, headlines, and brand mentions | Use a more specific company name or phrase. |
| A row has no paid-for entity | The detail page did not expose it or the detail request failed | Use advertiser and detail URL fields, then inspect the row manually if needed. |
| A row has no ad format | The detail page did not expose a public format label or the detail request failed | Use `creativeType` and `adDetailsUrl`, but avoid treating them as placement fields. |
| A row has no image | The public preview may be text-only or use a format without an image | Use `creativeText`, `headline`, and `adDetailsUrl`. |
| No rows were returned | The target has no visible public results, or LinkedIn changed the page | Try a broader target and check `RUN_SUMMARY` for suppressed errors. |

### What changed in the current version?

#### 0.1

- Initial version with public search, detail enrichment, fuller creative text, linked mentions, ad format labels, image URLs, paid-for entities, and pipeline fields.

### How can I get support?

Open an issue on the actor page with the target, run ID, and a short description of what looked wrong. Include whether the problem was matching, missing rows, or detail enrichment.

# Actor input Schema

## `targets` (type: `array`):

Brand names, company names, or keywords to search. Examples: Nike, Salesforce, B2B marketing. Use specific company names for cleaner competitor monitoring.

## `maxAds` (type: `integer`):

Maximum number of ad previews to return per target. Use 5-50 for quick checks and higher values for deeper monitoring. Default: 40; maximum: 250.

## `sortOrder` (type: `string`):

Result ordering used by the LinkedIn Ad Library search page. Default: newest first.

## `datasetId` (type: `string`):

Optional existing Apify dataset ID for pipeline runs. Rows are appended there in addition to the default run dataset. Leave empty for normal one-off runs.

## `runId` (type: `string`):

Optional external run or workflow ID to include in output rows and RUN\_SUMMARY. Use it to join scheduled runs with your own monitoring jobs; leave empty when not needed.

## Actor input object example

```json
{
  "targets": [
    "Nike"
  ],
  "maxAds": 40,
  "sortOrder": "DESCENDING"
}
```

# Actor output Schema

## `datasetUrl` (type: `string`):

No description

## `runSummaryUrl` (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 = {
    "targets": [
        "Nike"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("trovevault/linkedin-ads-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 = { "targets": ["Nike"] }

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

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "LinkedIn Ads Library Scraper",
        "description": "Extract public LinkedIn ad previews with advertiser names, creative IDs, fuller ad text, linked mentions, headlines, CTA labels, ad formats, images, and paid-for entities.",
        "version": "0.1",
        "x-build-id": "4xml61uhGIRHjXzTa"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/trovevault~linkedin-ads-library-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-trovevault-linkedin-ads-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/trovevault~linkedin-ads-library-scraper/runs": {
            "post": {
                "operationId": "runs-sync-trovevault-linkedin-ads-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/trovevault~linkedin-ads-library-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-trovevault-linkedin-ads-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": [
                    "targets"
                ],
                "properties": {
                    "targets": {
                        "title": "Brands or Keywords",
                        "type": "array",
                        "description": "Brand names, company names, or keywords to search. Examples: Nike, Salesforce, B2B marketing. Use specific company names for cleaner competitor monitoring.",
                        "items": {
                            "type": "string"
                        },
                        "default": [
                            "Nike"
                        ]
                    },
                    "maxAds": {
                        "title": "Maximum Ads",
                        "minimum": 1,
                        "maximum": 250,
                        "type": "integer",
                        "description": "Maximum number of ad previews to return per target. Use 5-50 for quick checks and higher values for deeper monitoring. Default: 40; maximum: 250.",
                        "default": 40
                    },
                    "sortOrder": {
                        "title": "Sort Order",
                        "enum": [
                            "DESCENDING",
                            "ASCENDING"
                        ],
                        "type": "string",
                        "description": "Result ordering used by the LinkedIn Ad Library search page. Default: newest first.",
                        "default": "DESCENDING"
                    },
                    "datasetId": {
                        "title": "Dataset ID",
                        "type": "string",
                        "description": "Optional existing Apify dataset ID for pipeline runs. Rows are appended there in addition to the default run dataset. Leave empty for normal one-off runs."
                    },
                    "runId": {
                        "title": "Run ID",
                        "type": "string",
                        "description": "Optional external run or workflow ID to include in output rows and RUN_SUMMARY. Use it to join scheduled runs with your own monitoring jobs; leave empty when not needed."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
