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

Scrape public LinkedIn Ad Library ads by keyword, advertiser, country, and official search URLs.

- **URL**: https://apify.com/fetch_cat/linkedin-ad-library-scraper.md
- **Developed by:** [Fetch Cat](https://apify.com/fetch_cat) (community)
- **Categories:** Marketing, Lead generation
- **Features:** Limited permissions
- **Stats:** 23 total users, 14 monthly users, 97.2% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.28 / 1,000 ad records

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

Export public LinkedIn Ad Library search results and ad details for competitive advertising research. Collect advertiser and payer names, creative text, ad URLs, media links and available transparency text as JSON, CSV or Excel.

Use keywords, advertiser or payer names, or official search URLs. This Actor uses anonymous public pages, not Campaign Manager, private profiles or member-only data. Results and optional fields depend on what LinkedIn makes available.

### Quick start

1. Open the input form and enter a keyword, advertiser or payer, or paste an official Ad Library search URL.
2. For a keyword-only search, clear the prefilled search URL. Set a small `maxAds` limit and run the Actor.
3. Open the default dataset to inspect and export the records.

```json
{
  "keyword": "crm",
  "countries": ["US"],
  "dateOption": "last-30-days",
  "maxAds": 20
}
```

Prefer a video guide? This short Apify walkthrough shows you how to set up and run an Actor. It uses a different Actor, but the setup steps are the same.

https://youtu.be/1OW8gOqlZbY?t=25

### Ready-to-run examples

Choose a public example to see its settings before starting a run:

- [LinkedIn CRM Ads Research](https://apify.com/fetch_cat/linkedin-ad-library-scraper/examples/linkedin-crm-ads-research)
- [LinkedIn Fintech Ads — UK](https://apify.com/fetch_cat/linkedin-ad-library-scraper/examples/linkedin-fintech-ads-uk)
- [B2B SaaS LinkedIn Ads Research](https://apify.com/fetch_cat/linkedin-ad-library-scraper/examples/b2b-saas-linkedin-ads-research)

### What you get

One public ad record with its ad ID, source search and detail link, plus available advertiser, payer, creative and transparency text. Media fields expose image links rather than downloaded files or guaranteed video assets. Optional values can be null, and published impression ranges are not measured campaign performance.

### Who is it for?

- **Competitive-advertising researchers** reviewing publicly visible advertiser messaging.
- **Agency analysts** assembling source-linked advertiser, payer and transparency evidence.
- **Creative teams** comparing available headlines, calls to action and image references.
- **Data developers** maintaining their own repeated research exports without assuming built-in ad-history tracking.

### How you can use the data

- **Prepare a US CRM creative sheet.** Use the existing crm query, US country and last-thirty-days range with a small ad cap. Keep adId, adUrl, advertiser and available creative text together before opening the public detail page.
- **Review another source market deliberately.** Use the existing fintech/GB example and retain the requested search context. Official URL inputs and query-builder searches are additive, so clear the prefilled URL for a keyword-only run.
- **Inspect payer and transparency evidence.** Preserve available payerName, activeDatesText, impressionsText and targetingText beside the ad link. A published impression range is not campaign performance or complete targeting data.
- **Compare your own saved exports.** Join ad IDs with collection times in your destination. ChangedSince does not filter ads or detect historical changes, and firstSeenAt/lastSeenAt refer to the current extraction rather than an ad's first or final appearance. Check final run-summary outcomes before treating a coverage gap as a creative change.

### Input settings

Provide at least one `startUrls` entry or one query-builder field: `keyword`, `advertiser` or `payer`. URL searches and a query-builder search are additive when both are supplied. Detailed setting behavior is in the input-form help.

| Setting | API key | Purpose |
| --- | --- | --- |
| Official search URLs | `startUrls` | Search URLs copied from LinkedIn Ad Library. |
| Keyword | `keyword` | Public ad-text search. |
| Advertiser / account owner | `advertiser` | Optional advertiser-name filter. |
| Payer name | `payer` | Optional paid-by filter. |
| Countries | `countries` | ISO codes such as `US` or `GB`. Default `US`. |
| Date range | `dateOption` | `last-30-days`, `last-6-months`, `last-year` or `any-time`. |
| Changed since | `changedSince` | Labels based on extraction time, not historical ad changes. Does not filter records. |
| Maximum ads | `maxAds` | Run-wide unique-record cap, from 1 to 1000. Set explicitly for API calls. |
| Detail delay | `requestDelayMs` | Requested spacing between detail requests. Default 750 ms. |
| Proxy configuration | `proxyConfiguration` | Existing proxy controls. The form defaults to managed proxy access. |

The form/schema defaults `maxAds` to 20. An input read without that schema-applied default uses the existing runtime limit of 50, so explicit bounded API examples are recommended. The default date range is the last 30 days. No field is globally required because URLs and query-builder fields are alternatives.

#### Example inputs

Use the Quick start input as a small first run. Adjust the fields described above for your own data.

### Output data

Each dataset item represents one public LinkedIn ad. Optional values may be `null`, and `mediaUrls` may be empty. The following is a **shape-only illustration**, not a real ad or a promise of field availability:

```json
{
  "adId": "<public-ad-id>",
  "adUrl": "https://www.linkedin.com/ad-library/detail/<public-ad-id>",
  "advertiserName": null,
  "payerName": null,
  "creativeText": null,
  "mediaUrls": [],
  "changeType": "new"
}
```

| Fields | Meaning |
| --- | --- |
| `adId`, `adUrl`, `searchUrl` | Ad identity and the search where it was found. |
| `advertiserName`, `advertiserUrl`, `payerName` | Available public advertiser and paid-by details. |
| `creativeText`, `headline`, `callToAction`, `creativeType` | Available creative text and format signals. |
| `mediaUrls` | Exposed image URLs, not downloaded files or guaranteed video assets. |
| `activeDatesText`, `impressionsText`, `targetingText` | Available public transparency text. Impressions are a published range, not measured campaign performance. |
| `firstSeenAt`, `lastSeenAt` | Current extraction timestamps, not an ad's historical first/last appearance. |
| `changeType` | `unchanged` only when extraction occurs before the supplied `changedSince` timestamp. Otherwise `new`. |

Records follow discovered search/detail order, not a guaranteed ranking or date sort. `RUN-SUMMARY` in the default key-value store reports saved and charged counts, completed and pending searches, per-search outcomes and a `completionReason`. Its `searchUrls` list contains requested searches, not a claim that all were processed. `bootstrapRecoveryAttempts` and `bootstrapRecovered` describe bounded initial connection recovery. Temporary initial HTTP 403/429/server, unexpected-status, connection or proxy tunnel failures may trigger up to two fresh sessions (three exits total) within your selected managed proxy configuration before extraction; `bootstrapFailureKinds` names each failed initial attempt with a short fixed label. If the managed proxy connection fails later, while loading pages in the browser, the Actor switches to a new session up to two more times (`browserProxyRotations`) instead of stopping. Custom proxy pools, direct connections and omitted proxy settings are not switched to a managed route.

Processing is limited to 270 seconds, or less when needed to finish before your run timeout. Useful partial results can succeed with `partial: true` and `completionReason: runtime_budget`, `charge_capacity` or `max_ads`. Pending counts describe only work already known, not all possible matching ads. Confirmed no-ad searches still succeed empty. A zero-output internal runtime limit without confirmed empty results fails, as do essential storage and billing errors. Your own max-cost or short-timeout limit stops successfully with a warning and `completionReason: customer_limit`, preserving saved ads without charging beyond the allowance. Allow at least 40 seconds for useful work; processing reserves 25 seconds for storage and shutdown. Blocking and extraction failures are not classified as customer-limit stops. Inspect run status as well as the dataset: partial records can remain after a failure. Runs use at most 512 MB. Automatic replay of an already-started run without an extraction checkpoint is rejected to avoid duplicate work and charges.

#### Download your results

Open your run's dataset, choose **Export** and select JSON, CSV or Excel. JSON keeps nested fields together. CSV and Excel are useful when you want to review the records in a spreadsheet.

See [Apify's download and export guide](https://docs.apify.com/storage/dataset#apify-console) for the available formats and field options.

### Pricing

Pay-per-event pricing charges `start` once per run and `item` for each ad record saved. A run with no saved ads can still incur the start charge.

Use a small run-wide unique-ad cap and focused searches. See the [current pricing and plan discounts](https://apify.com/fetch_cat/linkedin-ad-library-scraper/pricing).

### Tips for best results

- **Clear unwanted URL or query inputs before running.** Searches are additive rather than one mode overriding the other.
- **Set the ad cap explicitly in API calls.** Schema/form defaults and raw runtime fallback differ.
- **Use a focused keyword, country and date range.** A valid search with few matches can be broadened after reviewing it.
- **Keep source ad URLs with transparency text.** Optional payer, impression and targeting fields depend on what LinkedIn publishes.
- **Read completion reason and pending work before repeating a search.** Requested searches are not proof all were processed, and larger limits do not unlock blocked pages.

### Limits and caveats

Only anonymous public Ad Library pages are used. There is no LinkedIn login, cookie, Campaign Manager, private-account or member-only access. Media is returned as exposed links rather than downloaded files, and complete ad or creative coverage is not guaranteed.

LinkedIn can change pages or restrict access. Confirmed no-ad searches can succeed empty, while blocked or unrecognized pages can fail. Isolated detail failures can be skipped with other records preserved. A zero-output runtime stop without confirmed empty results fails, as do essential storage or billing errors.

Processing is bounded as described in Output data, with useful partial rows possible after time, charge or row limits. Pending counts cover already-known work rather than all matching ads. Review platform status as well as RUN-SUMMARY, since saved partial records can remain after failure. After a platform restart or migration, the Actor restores saved ad IDs from that run’s dataset, skips those ads and does not repeat its startup charge. It reconciles an interrupted row write before new extraction, while keeping the original processing deadline. Inconsistent stored output or billing state still fails rather than silently repeating work.

Discovered order is not a guaranteed rank or date sort. Timestamp and change labels describe the current extraction rather than historical ad monitoring. Impression ranges are source transparency text, optional values can be null, and comparison or change detection belongs in your own workflow. Request spacing can help with rate limits but does not guarantee access.

### Automation and integrations

#### Save your settings for next time

Once you have an input that works for you, [save it as an Apify task](https://docs.apify.com/actors/running/tasks). This keeps your settings together so you can use them again without filling in the form from scratch.

#### Run on a schedule

Need fresh results regularly? You can [schedule the Actor or a saved task](https://docs.apify.com/actors/running/schedules) to run at a time that suits you.

Each scheduled run collects the data again. If you want to compare results or highlight changes, add that step in your own workflow.

#### Send results to your other tools

Use **n8n, Make or Zapier** to connect this scraper to the rest of your workflow. For example, you could pass its results to an AI assistant or add records to a spreadsheet. Follow the [Apify integration guides](https://docs.apify.com/integrations) for your chosen tool.

For a custom connection, an [Apify webhook](https://docs.apify.com/integrations/webhooks) can notify your app when a run finishes or fails. Your app can then fetch the results or handle the failure.

### API usage

Want to collect this data from your own app or automation? The examples below send input to the scraper and show how to collect its results.

The Node.js and Python examples wait for the run to finish before reading its results. The cURL example starts the run and returns its details. Wait for that run to finish, then use its `defaultDatasetId` to fetch the results.

For setup instructions, see Apify's [JavaScript client guide](https://docs.apify.com/api/client/js), [Python client guide](https://docs.apify.com/api/client/python) and [Actor runs API reference](https://docs.apify.com/api/v2/acts-runs-post).

#### cURL

```bash
curl -X POST 'https://api.apify.com/v2/acts/fetch_cat~linkedin-ad-library-scraper/runs' \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  -H 'Content-Type: application/json' \
  --data @- <<'JSON'
{
  "keyword": "crm",
  "countries": [
    "US"
  ],
  "dateOption": "last-30-days",
  "maxAds": 20
}
JSON
```

#### Node.js

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('fetch_cat/linkedin-ad-library-scraper').call({
  "keyword": "crm",
  "countries": [
    "US"
  ],
  "dateOption": "last-30-days",
  "maxAds": 20
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

#### Python

```python
import os
from apify_client import ApifyClient

client = ApifyClient(os.environ['APIFY_TOKEN'])
run = client.actor('fetch_cat/linkedin-ad-library-scraper').call(run_input={'keyword': 'crm', 'countries': ['US'], 'dateOption': 'last-30-days', 'maxAds': 20})
print(client.dataset(run['defaultDatasetId']).list_items().items)
```

### MCP and AI agents

You can ask your AI assistant to collect data with **LinkedIn Ad Library Scraper** and help you work with the results. The scraper returns the data, and your assistant can then summarize it, compare records or prepare notes.

Connect your assistant through the [Apify MCP server](https://mcp.apify.com/). MCP gives your assistant a way to find this scraper, run it and read the results. Follow the [official setup and sign-in guide](https://docs.apify.com/mcp) for your app.

#### Easier setup with an Apify plugin

If you use a supported coding assistant, the [official Apify plugin](https://docs.apify.com/agents/plugins) can set up the connection for you. It connects your assistant to Apify and includes instructions for common tasks. Follow the guide for your particular app.

#### Use Apify AI in Console

Prefer to keep everything in Apify? Open [Apify AI in Console](https://docs.apify.com/account/apify-ai) and ask it to find Fetch Cat's **LinkedIn Ad Library Scraper**. You can describe the data you want and ask questions about the results.

Apify AI is currently in beta. It asks for confirmation before starting an Actor, and normal run charges apply.

#### Choose your assistant

- **Claude and Claude Code (Anthropic):** [Apify setup guide](https://docs.apify.com/integrations/claude).
- **ChatGPT and Codex (OpenAI):** [Apify setup guides](https://docs.apify.com/integrations/openai).
- **Grok Bot (xAI):** [Apify plugin guide](https://docs.apify.com/integrations/grok-bot).
- **Gemini CLI (Google):** [MCP server setup guide](https://geminicli.com/docs/tools/mcp-server/). Use the server URL below with the HTTP configuration supported by Gemini CLI.

#### Connect just this scraper

To keep your setup focused on this scraper, add this server configuration to a compatible MCP client:

```json
{
  "mcpServers": {
    "apify": {
      "url": "https://mcp.apify.com?tools=fetch_cat/linkedin-ad-library-scraper"
    }
  }
}
```

Sign in to Apify when your client asks. If your client uses a Bearer token instead, follow its setup guide and keep the token in its secure configuration. Configuration formats vary by app, so use the linked guide if your client needs a different format.

#### Use Apify's general server

Already connected to the general Apify MCP server at `https://mcp.apify.com`? You can use it to find this scraper without adding another server. Ask your assistant to use **LinkedIn Ad Library Scraper** by Fetch Cat, or give it the identifier `fetch_cat/linkedin-ad-library-scraper`.

Your assistant can check the available settings and retrieve the results from the returned run. If the run is still working, it should follow that run rather than start it again. Both connection options use Apify's hosted service.

#### Example requests

- “Use Fetch Cat’s LinkedIn Ad Library Scraper to collect up to 5 crm ads for country US over the last 30 days, clearing prefilled search URLs. Keep ad links, advertiser names and available creative text without downloading media.”
- “Collect up to 5 fintech ads for country GB over the last 30 days using the query builder only. Show available payer and transparency text with source ad links, without treating impressions as measured campaign performance.”
- “Retrieve up to 5 crm ads for country US over the last 30 days with search URLs cleared. Keep ad IDs and extraction timestamps for my own later comparison, and check final completion and pending outcomes rather than using change labels as historical tracking.”

Normal Apify charges apply. Check the [live Pricing tab](https://apify.com/fetch_cat/linkedin-ad-library-scraper/pricing) before asking your assistant to run a larger batch.

### Pay with x402

If your AI agent has a funded wallet, it can pay for Apify usage through [x402](https://docs.apify.com/integrations/x402). This experimental option lets an agent use Apify without a conventional account.

[Apify AGI](https://agi.apify.com/) provides a prepaid API token with a spending cap after payment. Your agent can use that token to run this scraper through the Apify API or an authenticated MCP connection.

Some MCP setups also support paying for each request directly. That is a different payment option, so check the official guide for its availability.

Follow the official guide for wallet setup, supported payment options and current terms. Apify handles the payments. Keep wallet keys and payment tokens in your agent's secure configuration.

#### Other ways for agents to pay

Apify also supports **MPP** for prepaid access through AGI and **Skyfire** for eligible Actors. If your agent already uses one of these, see the [agentic payment guide](https://docs.apify.com/agents/payments) to choose the right setup.

### FAQ

#### How can I scrape LinkedIn Ad Library ads by keyword?

Set `keyword`, choose `countries` and `dateOption`, and explicitly set `maxAds`. Alternatively paste an official search URL into `startUrls`, clearing query fields for a URL-only run.

#### Can I export LinkedIn ad creatives and payer data?

Yes, when publicly exposed. Output includes ad URLs, advertiser details, creative text and image links, plus available payer and transparency text. Export the default dataset as JSON, CSV or Excel.

#### Does changedSince find only new competitor ads?

No. It neither filters records nor compares earlier runs. Both timestamp fields describe this extraction, and `changeType` compares that extraction time with the supplied cutoff. Compare separate exports yourself for historical research.

#### Does this require a LinkedIn login or provide an official LinkedIn API?

No login or cookies are required. This is an independent public-page scraper run through Apify, not LinkedIn's official advertising API. It does not access Campaign Manager or private accounts.

### Related Actors

- [Facebook Ads Library Scraper](https://apify.com/fetch_cat/facebook-ads-library-scraper) — Research public Meta ad creatives.
- [Google Ads Transparency Scraper](https://apify.com/fetch_cat/google-ads-transparency-scraper) — Research Google's public ad creatives.
- [TikTok Creative Center Top Ads Scraper](https://apify.com/fetch_cat/tiktok-ads-library-scraper) — Compare public TikTok Creative Center Top Ads.
- [LinkedIn Company Posts Scraper](https://apify.com/fetch_cat/linkedin-company-posts-scraper) — Research public company posts alongside advertising.
- [LinkedIn Company Profiles Scraper](https://apify.com/fetch_cat/linkedin-company-profiles-scraper) — Add public company-profile context.

### Support and feedback

For custom additions or integrations, email <hello@fetchcat.dev>.

Found an error or have a feature request? [Open an issue](https://apify.com/fetch_cat/linkedin-ad-library-scraper/issues) with the run URL, a non-sensitive input example and what you expected.

Need help sharing it? See [Apify’s guide to sharing a run when reporting an issue](https://docs.apify.com/account/collaboration/general-resource-access#automatically-sharing-runs-via-actor-issues). Sharing a run can give the developer access to its input, logs and results, so use a run that contains no sensitive data. Please leave out API tokens, passwords, cookies, private documents and personal data. Use a public sample URL or a redacted example instead.

Tried this scraper? We'd love to hear how it worked for you. [Leave a review](https://apify.com/fetch_cat/linkedin-ad-library-scraper/reviews) to help others choose the right tool and help us improve it. Your feedback means a lot to us.

Made with care for curious people, AI agents and the possibilities in data. ♥

# Changelog

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

# Actor input Schema

## `startUrls` (type: `array`):

Paste official LinkedIn Ad Library search URLs. These are processed in addition to any keyword, advertiser or payer search; clear the query fields for a URL-only run. Provide at least one URL or query field.

## `keyword` (type: `string`):

Search public ad text by keyword. Supply a keyword, advertiser, payer or official search URL. When query fields and startUrls are both supplied, both searches are processed.

## `advertiser` (type: `string`):

Optional advertiser/account owner name for LinkedIn's accountOwner filter.

## `payer` (type: `string`):

Optional payer name for LinkedIn's paidBy filter.

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

ISO country codes to include, such as US, GB, CA, AU.

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

LinkedIn Ad Library date filter.

## `changedSince` (type: `string`):

Optional ISO timestamp compared with the current extraction time. Records are labeled unchanged only when extracted before this timestamp; otherwise they are new. This does not filter ads, compare creative changes or remember ads from previous runs.

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

Maximum unique ad records saved across all searches, from 1 to 1000. The Console/schema default is 20; specify this explicitly in API requests for a predictable bound.

## `requestDelayMs` (type: `integer`):

Throttle detail requests to reduce LinkedIn rate limits. Increase this for larger monitoring runs.

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

The form defaults to Apify Proxy from the first request, using residential proxies for the first selected country (US when omitted) unless a managed group is supplied. Managed settings and custom proxy URLs are supported. Set useApifyProxy to false with no custom URLs for direct requests. There is no automatic switch from direct access to a paid proxy. Malformed settings are rejected rather than enabling a managed route.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.linkedin.com/ad-library/search?keyword=crm&countries=US&dateOption=last-30-days"
    }
  ],
  "keyword": "crm",
  "countries": [
    "US"
  ],
  "dateOption": "last-30-days",
  "maxAds": 20,
  "requestDelayMs": 750,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

No description

## `overview` (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 = {
    "startUrls": [
        {
            "url": "https://www.linkedin.com/ad-library/search?keyword=crm&countries=US&dateOption=last-30-days"
        }
    ],
    "keyword": "crm",
    "countries": [
        "US"
    ],
    "maxAds": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("fetch_cat/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 = {
    "startUrls": [{ "url": "https://www.linkedin.com/ad-library/search?keyword=crm&countries=US&dateOption=last-30-days" }],
    "keyword": "crm",
    "countries": ["US"],
    "maxAds": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("fetch_cat/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 '{
  "startUrls": [
    {
      "url": "https://www.linkedin.com/ad-library/search?keyword=crm&countries=US&dateOption=last-30-days"
    }
  ],
  "keyword": "crm",
  "countries": [
    "US"
  ],
  "maxAds": 20
}' |
apify call fetch_cat/linkedin-ad-library-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,fetch_cat/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/grF62vOnZIMiSU7wL/builds/vaS2RnbZ9xgsKaXlI/openapi.json
