# LinkedIn Ad Library Scraper (`w3crawler/linkedin-ad-library-scraper`) Actor

Collect public LinkedIn Ad Library results by advertiser or company name and country. Returns evidenced advertiser, creative, media, detail, and source fields, with explicit diagnostics when no public ads are available.

- **URL**: https://apify.com/w3crawler/linkedin-ad-library-scraper.md
- **Developed by:** [w3crawler](https://apify.com/w3crawler) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 95.8% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.99 / 1,000 ad libraries

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## LinkedIn Ad Library Scraper

Collect public LinkedIn Ad Library results for an advertiser or company name and a country. The Actor searches LinkedIn's public ad library, opens each matching ad detail page, and returns evidenced advertiser, creative, copy, media, landing-page, status, and source fields. It does not sign in or claim access to ads that are not public in the selected country.

### Get started

1. Open the [Actor Store page](https://apify.com/w3crawler/linkedin-ad-library-scraper) and select **Try for free** or open the **Input** tab.
2. Enter an advertiser or company name in `query` and choose the two-letter `country` code.
3. Keep `maxItems` small for the first run; each saved ad also requires a public detail-page request.
4. Start the Actor, open the dataset, and export the ads as JSON, CSV, or Excel. Open **Run summary** (`OUTPUT`) to check the outcome and counts.

### Input

`query` is required. The other fields are optional, and the defaults below are ready to use. Unsupported field names and out-of-range values are rejected before requests start.

| Field | Type | Required? | Default | Meaning |
| --- | --- | --- | --- | --- |
| `query` | string | Required | `Google` | Advertiser or company name passed to LinkedIn's `accountOwner` search field. This is advertiser matching, not free-text ad-copy search. |
| `maxItems` | integer | Optional | `50` | Maximum ad results to save, from 1 to 500. |
| `country` | string | Optional | `US` | Two-letter country code used to filter the public ad library, such as `US`, `GB`, `IN`, or `DE`. |
| `proxyConfiguration` | object | Optional | `{"useApifyProxy":false}` | Standard Apify Proxy settings. Direct connections are used by default. |

Full default input:

```json
{
  "query": "Google",
  "maxItems": 50,
  "country": "US",
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

The Actor reads public LinkedIn Ad Library pages. Optional proxy settings change routing only; they do not grant access to protected or non-public ads.

### Output

The dataset contains one row per saved public ad. Optional values are omitted when the ad card or detail page does not expose them; no diagnostic or placeholder rows are written.

| Field | Type | Availability | Meaning |
| --- | --- | --- | --- |
| `id` | string | Always | Stable ad identifier derived from LinkedIn's ad ID or detail URL. |
| `recordType` | string enum | Always | Row discriminator; always `linkedin-ad-library-ad`. |
| `position` | integer | Always | One-based position of the ad in the saved result set. |
| `adId` | string | When the ad ID is exposed | LinkedIn ad identifier. |
| `creativeId` | string | When exposed | Creative identifier associated with the ad. |
| `creativeType` | string | When exposed | LinkedIn creative type, such as `SPONSORED_VIDEO` or `SPONSORED_STATUS_UPDATE`. |
| `adAuthorName` | string | When exposed | Name shown for the ad author. |
| `adAuthorUrl` | string | When exposed | Public LinkedIn URL for the ad author. |
| `advertiserName` | string | When exposed | Advertiser or company name. |
| `advertiserUrl` | string | When exposed | Public LinkedIn company URL for the advertiser. |
| `advertiserUrn` | string | When exposed | LinkedIn advertiser URN. |
| `adText` | string | When the ad has body text | Ad body copy. Completeness is described by `adTextCompleteness` and `adTextSource`. |
| `headline` | string | When the ad has a headline | Ad headline. |
| `callToAction` | string | When the ad has a CTA | Call-to-action label, such as `Download` or `Learn more`. |
| `adFormat` | string | When exposed | Displayed ad format, such as `Video Ad` or `Single Image Ad`. |
| `mediaType` | string | When media is exposed | Media type label, such as `image` or `video`. |
| `mediaUrl` | string | When media is exposed | Primary public media URL. |
| `mediaUrls` | array | When media is exposed | Public media URLs found for the ad. |
| `mediaTitle` | string | When exposed | Title associated with the media. |
| `logoUrl` | string | When exposed | Advertiser logo URL. |
| `landingPageUrl` | string | When an external CTA link supports it | External landing-page URL. A LinkedIn search URL is never used as the landing page. |
| `externalLinks` | array | When external links exist | Public external links found in the ad. |
| `link` | string | When exposed | Public LinkedIn ad-detail URL. |
| `startDate` | string | When the ad dates are exposed | Ad start date as displayed. |
| `endDate` | string | When the ad dates are exposed | Ad end date as displayed. |
| `adStatus` | string | When exposed | Ad status label shown by the library. |
| `targetingSummary` | string | When exposed | Public targeting summary, when LinkedIn displays one. |
| `impressionRange` | string | When exposed | Public impression range, when displayed. |
| `spendRange` | string | When exposed | Public spend range, when displayed. |
| `language` | string | When exposed | Language attribute recorded from the ad card. |
| `paidForBy` | string | When exposed | "Paid for by" value shown on the ad. |
| `adVersionNotice` | string | When exposed | Notice about multiple ad versions or device-specific rendering. |
| `detailHttpStatus` | integer | When the detail page is fetched | HTTP status of the public ad-detail request. |
| `detailHtmlLength` | integer | When the detail page is fetched | Length of the public ad-detail HTML response. |
| `detailFetchedAt` | string | When the detail page is fetched | Time the detail page was fetched, in ISO UTC. |
| `query` | string | Always | Advertiser query used for the run. |
| `country` | string | Always | Country code used for the run. |
| `sourceUrl` | string | Always | Public LinkedIn Ad Library search URL requested. |
| `finalUrl` | string | Always | Final search URL after redirects. |
| `scrapedAt` | string | Always | Time the row was saved, in ISO UTC. |
| `adTextCompleteness` | string | When ad text exists | `preview` or `detail`, indicating how complete the saved ad text is. |
| `adTextSource` | string | When ad text exists | Evidence path for the text, such as `expanded_detail`. |
| `landingPageEvidence` | string | When a landing page is saved | Evidence marker showing that an external CTA link supports `landingPageUrl`. |

The example below is the complete saved row from the 2026-10-24 run, collected for `query: "cloud"` in `US`.

```json
{
  "id": "linkedin-ad:96c9b58f248bc11f4952ce10",
  "recordType": "linkedin-ad-library-ad",
  "position": 1,
  "adId": "1592786753",
  "creativeType": "SPONSORED_VIDEO",
  "adAuthorName": "CloudFactory",
  "adAuthorUrl": "https://www.linkedin.com/company/2613668?trk=ad_library_ad_preview_advertiser",
  "advertiserName": "CloudFactory",
  "advertiserUrl": "https://www.linkedin.com/company/2613668?trk=ad_library_about_ad_advertiser",
  "adText": "AI agents don’t announce their mistakes. Most enterprises can’t see which decisions are safe until one becomes a business risk. The Trusted AI at Scale paper shows how leading organizations score every AI decision, route uncertain ones to human experts and keep a full audit trail from data to deployment.",
  "adTextCompleteness": "detail",
  "adTextSource": "expanded_detail",
  "headline": "Know Which AI Decisions to Trust. Download the Paper.",
  "callToAction": "Download",
  "adFormat": "Video Ad",
  "mediaType": "image",
  "mediaUrl": "https://media.licdn.com/dms/image/v2/D4D10AQEeUZGEH7kwDg/videocover-high/B4DaFf_l97IoBI-/0/1792611870074?e=2147483647&v=beta&t=UxIR3aqK-NOpeBzo2oBqz0LZ-JmgmkImhRNxkZoQStU",
  "mediaUrls": [
    "https://media.licdn.com/dms/image/v2/D4D10AQEeUZGEH7kwDg/videocover-high/B4DaFf_l97IoBI-/0/1792611870074?e=2147483647&v=beta&t=UxIR3aqK-NOpeBzo2oBqz0LZ-JmgmkImhRNxkZoQStU"
  ],
  "logoUrl": "https://media.licdn.com/dms/image/v2/D4D0BAQH4xc_s41jmSA/company-logo_100_100/B4DaCRUgV1I8AI-/0/1789144467183/cloudfactory_com_logo?e=1794441600&v=beta&t=VKX0dziDfQviiUpk_LRIh1F1iKZKKq6mhqbs9wHjrgg",
  "landingPageUrl": "https://www.cloudfactory.com/trusted-ai-at-scale-solution-brief?utm_campaign=1032_TrustedAI_IT&utm_source=linkedin&utm_medium=paid&utm_id=1234468633&hsa_acc=502535688&hsa_cam=1234468633&hsa_grp=897067423&hsa_ad=1592418883&hsa_net=linkedin&hsa_ver=3&trk=ad_library_ad_preview_headline_content",
  "landingPageEvidence": "cta_evidence",
  "externalLinks": [
    "https://www.cloudfactory.com/trusted-ai-at-scale-solution-brief?utm_campaign=1032_TrustedAI_IT&utm_source=linkedin&utm_medium=paid&utm_id=1234468633&hsa_acc=502535688&hsa_cam=1234468633&hsa_grp=897067423&hsa_ad=1592418883&hsa_net=linkedin&hsa_ver=3&trk=ad_library_ad_preview_headline_content"
  ],
  "link": "https://www.linkedin.com/ad-library/detail/1592786753",
  "paidForBy": "CloudFactory",
  "adVersionNotice": "Please note that this ad may have multiple versions. Some versions may appear different on mobile or desktop screens with different sizes.",
  "detailHttpStatus": 200,
  "detailHtmlLength": 51557,
  "detailFetchedAt": "2026-10-24T18:02:47.963Z",
  "query": "cloud",
  "country": "US",
  "sourceUrl": "https://www.linkedin.com/ad-library/search?accountOwner=cloud&country=US",
  "finalUrl": "https://www.linkedin.com/ad-library/search?accountOwner=cloud&country=US",
  "scrapedAt": "2026-10-24T18:02:47.964Z"
}
```

### Run summary

**Run summary** is stored separately from the dataset in the run's key-value store under `OUTPUT`.

| Field | Meaning |
| --- | --- |
| `recordType` | Summary discriminator; `linkedin-ad-library-run-summary`. |
| `status` | Actor process outcome: `SUCCEEDED` or `FAILED`. |
| `runStatus` | Canonical run status; matches `status`. |
| `dataStatus` | Completeness of the dataset: `COMPLETE`, `PARTIAL`, `NO_RESULTS`, or `FAILED`. |
| `itemCount` | Ad rows saved to the dataset. |
| `diagnosticCount` | Operational issues recorded for the run. |
| `optionalFailureCount` | Optional detail-enrichment failures that did not stop saved ads from being kept. |
| `dataAvailable` | Whether at least one usable ad row was saved. |
| `proxyConfigured` | Whether a proxy configuration was supplied. |
| `scrapedAt` | Time the summary was written, in ISO UTC. |

| Status | Data status | Meaning |
| --- | --- | --- |
| `SUCCEEDED` | `COMPLETE` | Ads were saved without an operational problem. |
| `SUCCEEDED` | `PARTIAL` | Ads were saved, but one or more optional detail requests failed. Saved rows remain available. |
| `SUCCEEDED` | `NO_RESULTS` | The public search completed cleanly and returned no matching ads. |
| `FAILED` | `FAILED` | A fatal error occurred before any usable ad was saved. |

Example `OUTPUT` from the 2026-10-24 run:

```json
{
  "recordType": "linkedin-ad-library-run-summary",
  "status": "SUCCEEDED",
  "runStatus": "SUCCEEDED",
  "dataStatus": "COMPLETE",
  "itemCount": 3,
  "diagnosticCount": 0,
  "optionalFailureCount": 0,
  "dataAvailable": true,
  "proxyConfigured": true,
  "scrapedAt": "2026-10-24T18:02:49.805Z"
}
```

### Coverage and limitations

The Actor searches by advertiser or company name through LinkedIn's public `accountOwner` field and filters by `country`. It is not a keyword search across ad copy, and it does not enumerate every advertiser in the library.

Search results are bounded by `maxItems`. Each saved ad can require a separate public detail request, so larger limits increase runtime and request volume. The ad library can show different creatives, versions, and availability by country, device, language, and time; a saved row reflects what the public page returned during the run.

Fields such as `startDate`, `endDate`, `adStatus`, `targetingSummary`, `impressionRange`, and `spendRange` appear only when the public library displays them. `landingPageUrl` is saved only when a public external CTA link supports it; the LinkedIn search URL is never substituted. Login-gated or removed ads are omitted. All URLs are validated, and the Actor does not bypass authentication, CAPTCHAs, or access controls.

### Usage and support

Apify compute, source requests, dataset storage, and any optional proxy traffic determine the run cost; there is no separate per-ad event configured for this Actor. Start with a small `maxItems`, inspect the dataset and `OUTPUT`, then scale gradually. See the Actor's Pricing tab for current account rates.

Use the [Actor Issues page](https://apify.com/w3crawler/linkedin-ad-library-scraper/issues) to report a problem. Include the run ID, the input used, and the `OUTPUT` summary; do not include tokens, cookies, or private data. This Actor is not affiliated with LinkedIn. Use it only for public data and in accordance with LinkedIn's terms, robots guidance, and applicable law. Public ads can contain personal information; use the output only for lawful purposes.

# Changelog

This Actor's version history is a separate document: https://apify.com/w3crawler/linkedin-ad-library-scraper/changelog.md

# Actor input Schema

## `query` (type: `string`):

Advertiser or company name for LinkedIn's accountOwner search field.

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

Maximum number of ad results to scrape.

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

Country code to filter ads by (e.g. US, GB, IN, DE).

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

Optional proxy settings. Direct connections are used by default.

## Actor input object example

```json
{
  "query": "Google",
  "maxItems": 50,
  "country": "US",
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

## `keyValueStore` (type: `string`):

No description

## `runSummary` (type: `string`):

Run status and counters stored by the Actor.

# 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 = {
    "query": "Google",
    "maxItems": 50,
    "country": "US"
};

// Run the Actor and wait for it to finish
const run = await client.actor("w3crawler/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 = {
    "query": "Google",
    "maxItems": 50,
    "country": "US",
}

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

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

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

```

## CLI example

```bash
echo '{
  "query": "Google",
  "maxItems": 50,
  "country": "US"
}' |
apify call w3crawler/linkedin-ad-library-scraper --silent --output-dataset

```

## MCP server setup

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

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/CooJ3cKfi1u00orRJ/builds/CqL0HSRCJ2eTRTkOu/openapi.json
