# LinkedIn Ads Scraper (`blueskyscraper/linkedin-ads-scraper`) Actor

Scrape LinkedIn ads from the LinkedIn Ad Library by keyword, advertiser, payer or company: ad copy, headline, format, image, video, carousel, CTA, landing page, who paid, run dates, impressions by country and targeting. Only-new-ads mode for daily monitoring. No login.

- **URL**: https://apify.com/blueskyscraper/linkedin-ads-scraper.md
- **Developed by:** [BlueskyScraper](https://apify.com/blueskyscraper) (community)
- **Categories:** Social media, Marketing, Lead generation
- **Stats:** 3 total users, 3 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $1.12 / 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/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 Ads Scraper** turns the public [LinkedIn Ad Library](https://www.linkedin.com/ad-library) into a table of ads: **advertiser, format, ad copy, headline, image or video, carousel cards, document and event details** — and, with one switch, **who paid for the ad, when it ran, total impressions, impressions by country, targeted languages and locations, the targeting criteria used, the call-to-action button and the landing page with its UTM parameters**. One row per ad.

Search by **keyword, advertiser name, payer or LinkedIn company ID**, add competitors by their company page, or paste any Ad Library link. Filter by country and date. No LinkedIn account, no login, no cookies. **$1.6 per 1,000 ads, $3.2 per 1,000 ads with details, no start fee.**

### What is LinkedIn Ads Scraper?

A **LinkedIn ads scraper** and unofficial **LinkedIn Ads API** for B2B ad research. LinkedIn publishes every ad that runs on its platform in the Ad Library; this Actor reads that library for you and returns clean, flat rows you can sort, filter and load into a spreadsheet, a BI tool, a CRM or an AI agent — no official API needed.

Typical questions it answers: *Which companies advertise on LinkedIn for "crm" in the US? Which ads is my competitor running right now? Which formats and offers do they test? Which countries see their ads and how many impressions do they get? Who do they target — by job, company or audience? Which landing pages and UTM campaigns do they use?*

### What data can LinkedIn Ads Scraper extract?

| Field | Example | Meaning |
|---|---|---|
| `advertiserName` | `HubSpot` | Company or person shown as the advertiser |
| `advertiserType` | `company` | `company` or `person` |
| `format` | `Single Image Ad` | LinkedIn's own format name: Video Ad, Carousel Ad, Document Ad, Event Ad, Message Ad… |
| `text` | `Occupancy challenges? Let's chat!…` | Ad copy (a ~120-character preview from search; full text with details) |
| `headline` | `Attending SMASH 2026?` | Headline of the creative |
| `imageUrl` | `https://media.licdn.com/…` | Ad image, video cover, article cover, document page or first carousel card |
| `url`, `adId` | `https://www.linkedin.com/ad-library/detail/1630618696` | The ad's page in the Ad Library |
| `isThoughtLeaderAd`, `memberName` | `true`, `Charlotte Davies` | A company promoting a member's post, and whose post it is |
| `carouselCards` | `[{title, imageUrl}]` | Carousel ads: every card |
| `documentTitle`, `documentTotalPages` | `How AI Is Changing Commerce`, `13` | Document ads |
| `eventName`, `eventTime`, `eventLocation` | `CIO Summit`, `February 3, 2026`, `Basel, CH` | Event ads |
| `searchTerm`, `position` | `crm`, `1` | Which search found the ad and its rank |

#### 📊 Impressions, targeting and landing page (details option)

Turn on **Add impressions, countries, targeting and landing page** and every ad's own page is opened and added to the row:

| Field | Example |
|---|---|
| `paidBy` | `HubSpot, Inc.` |
| `ranFrom`, `ranTo`, `runDays` | `2026-09-14`, `2026-10-02`, `19` |
| `impressions`, `impressionsMin`, `impressionsMax` | `50k-100k`, `50000`, `100000` |
| `impressionsByCountry`, `topCountry` | `[{country: "United Kingdom", share: "43%", percent: 43}, {country: "Ireland", share: "19%"…}]`, `United Kingdom` |
| `targetingLanguages`, `targetingLocations` | `["English"]`, `["Dallas, TX", "Germany", "Chicago, IL"…]` |
| `targetingExcludedLocations` | `["India", "New Zealand", "United Arab Emirates"]` |
| `targetedParameters`, `excludedParameters`, `targetingCriteria` | `["Company", "Job"]` |
| `ctaText` | `Learn more` |
| `landingUrl`, `landingDomain`, `utmParameters` | the page the ad sends people to, its domain, and its `utm_*` / `hsa_*` parameters |
| `advertiserUrl`, `advertiserCompanyId` | `https://www.linkedin.com/company/68529`, `68529` |
| `videoUrl` | MP4 file of a video ad |

**Where impressions and targeting come from.** LinkedIn publishes run dates, impressions and targeting for ads it reports under the EU Digital Services Act — ads that reached people in the EU. In our test every ad found with a German country filter had an impressions range (150 of 150) and 143 of 150 had targeting; ads shown only outside the EU carry the advertiser, payer and creative but no impressions. The Actor never estimates numbers LinkedIn does not show.

### 💰 How much does it cost to scrape LinkedIn ads?

Pay per ad, nothing else. Every row is billed once, by what it contains:

| Event | Free plan | Starter (Bronze) | Scale (Silver) | Business, Platinum, Diamond |
|---|---|---|---|---|
| **Ad** — one ad from the Ad Library search | $0.0016 ($1.6 / 1K) | $0.00144 ($1.44 / 1K) | $0.00128 ($1.28 / 1K) | $0.00112 ($1.12 / 1K) |
| **Ad with details** — the same ad plus impressions, countries, targeting and landing page | $0.0032 ($3.2 / 1K) | $0.00288 ($2.88 / 1K) | $0.00256 ($2.56 / 1K) | $0.00224 ($2.24 / 1K) |
| Searches with no ads, error rows, start of a run | free | free | free | free |

An ad is billed as **either** an ad **or** an ad with details, never both. On the Apify Free plan the monthly $5 credit buys about **3,125 ads** or **1,562 ads with details**. For comparison, the most-used LinkedIn ads actor in Apify Store charges $2 per 1,000 ads and $4 per 1,000 ads with details on the Free plan (Store prices on 3 October 2026) — this Actor is 20% below that. **Max cost per run** in the run options is respected to the cent: the run stops by itself, green, once the next ad would go over it.

### How to scrape LinkedIn ads

1. Open the Actor and press **Try for free** (an Apify account is free).
2. In **Search terms** type what you are looking for, one per line — a keyword (`crm`), an advertiser (`hubspot`) or a company ID (`1337`).
3. Pick **Search by**: keyword, advertiser name, payer or LinkedIn company ID.
4. Optionally add **Countries** (`US`, `GB`, `DE`…), a **Date range**, or **Companies** by their LinkedIn page.
5. Turn on **Add impressions, countries, targeting and landing page** if you need them.
6. Press **Start**. The default search — 24 ads about CRM shown in the US — finishes in about 20 seconds.
7. Download the table as Excel, CSV or JSON, or send it to Google Sheets.

### ⬇️ Input

```json
{
    "searchTerms": ["cybersecurity"],
    "searchType": "keyword",
    "countries": ["DE", "FR"],
    "maxAdsPerSearch": 100,
    "includeDetails": true,
    "dateRange": "last-30-days"
}
```

| Field | What it does |
|---|---|
| `searchTerms` | One search per line |
| `searchType` | `keyword`, `advertiser`, `payer` or `companyId` |
| `countries` | Two-letter country codes; empty = all countries |
| `maxAdsPerSearch` | Ads per search line, 1–5,000 (default 24) |
| `includeDetails` | Impressions, countries, targeting, landing page ($) |
| `companies` | Competitors by LinkedIn page URL, company ID or name |
| `dateRange` | `any`, `last-30-days`, `current-month`, `current-year`, `last-year` |
| `startDate`, `endDate` | Exact range, `YYYY-MM-DD` |
| `sortOrder` | `newest` (default) or `oldest` |
| `startUrls` | LinkedIn Ad Library links (searches or single ads) |
| `onlyNewRowsStore` | Memory name for only-new-ads monitoring |

#### Search LinkedIn ads by keyword

`"searchType": "keyword"` finds ads whose copy contains the word — the way to map a whole category (`crm`, `cybersecurity`, `webinar`, `hiring`).

#### Search LinkedIn ads by advertiser, payer or company

`"searchType": "advertiser"` matches the advertiser's name; matching is partial, so `hubspot` returns HubSpot's ads and those of HubSpot partners. For exactly one company use `"searchType": "companyId"` with the number from its LinkedIn URL, or put the company page into **Companies** — `https://www.linkedin.com/company/hubspot/` is turned into its ID automatically. `"searchType": "payer"` matches the *Paid for by* entity, which often differs from the advertiser (agencies, legal entities).

#### Paste LinkedIn Ad Library URLs

Set up any search on linkedin.com/ad-library and paste the address into **Ad Library URLs** — every filter of the page is kept. A single ad's link (`/ad-library/detail/<id>`) returns that ad with full details.

### ⬆️ Output

One JSON object per ad. A shortened example with details on:

```json
{
    "type": "ad",
    "adId": "1560106944",
    "url": "https://www.linkedin.com/ad-library/detail/1560106944",
    "advertiserName": "HubSpot",
    "advertiserType": "company",
    "format": "Single Image Ad",
    "text": "Remote-first and built on trust. Sell from wherever you're sharpest…",
    "headline": "Sell from anywhere, close everywhere.",
    "imageUrl": "https://media.licdn.com/dms/image/v2/…",
    "searchType": "companyId",
    "searchTerm": "68529",
    "companyInput": "https://www.linkedin.com/company/hubspot/",
    "position": 1,
    "detailsScraped": true,
    "paidBy": "HubSpot, Inc.",
    "ranFrom": "2026-09-14",
    "ranTo": "2026-10-02",
    "runDays": 19,
    "impressions": "50k-100k",
    "impressionsMin": 50000,
    "impressionsMax": 100000,
    "topCountry": "United Kingdom",
    "impressionsByCountry": [
        { "country": "United Kingdom", "share": "43%", "percent": 43 },
        { "country": "Ireland", "share": "19%", "percent": 19 },
        { "country": "Germany", "share": "18%", "percent": 18 }
    ],
    "targetingLanguages": ["English"],
    "targetingLocations": ["Dallas, TX", "Germany", "Chicago, IL", "England", "United Kingdom"],
    "targetingExcludedLocations": ["India", "New Zealand", "United Arab Emirates"],
    "targetedParameters": ["Company", "Job"],
    "ctaText": "Learn more",
    "advertiserCompanyId": "68529",
    "scrapedAt": "2026-10-03T00:10:00+00:00"
}
```

The Console shows four tabs: **Ads** (the overview), **Impressions & targeting**, **Creative** and **Errors**.

#### Error rows

When a search finds nothing, an input cannot be read (a country code like `USA`, a company page that does not exist) or LinkedIn refuses a page several times, you get a row with `type: "error"` and a plain-English `error`. Error rows are never charged.

### 🔁 Get only new LinkedIn ads — schedule it

A one-off export is useful once; a feed of **new** ads is useful every day. Fill **Only new ads — memory name** (for example `competitors-weekly`) and the Actor remembers every ad it delivered under that name. Every later run with the same name writes — and charges — **only ads you have not received before**. Ads delivered earlier are skipped before their page is even opened, so details are not paid twice either.

1. Run once with the memory name to load the current ads.
2. Open the run → **Actions → Schedule** (or [Schedules](https://console.apify.com/schedules)) and pick daily or weekly.
3. Read the new ads from each run's dataset, or connect a webhook, Slack, n8n, Make or Zapier.

Each memory name is separate: one per competitor list or market. To start over, use a new name.

### Use cases for LinkedIn ads data

#### Competitor B2B ads monitoring

Track every ad a competitor launches, the offers and formats they test and how long each one runs. `runDays` shows which creatives they keep paying for.

#### Market and category research

Run a keyword like `payroll software` across `US`, `GB` and `DE` and see who advertises, with which messages and formats.

#### Ad impressions by country

`impressionsByCountry` shows where a campaign actually reached people — compare competitors' footprint across European markets before entering one.

#### Targeting research

`targetedParameters` and `targetingLocations` tell you whether a competitor targets by job title, company list, audience or demographics, and where.

#### Creative inspiration and AI analysis

Pull hundreds of ads in your category with headlines, copy, CTAs and images and feed them to an LLM to find patterns in hooks and offers.

#### Agency prospecting

Companies that advertise on LinkedIn have budget. Search a category, collect the advertisers and pitch them.

### Integrations

#### Apify API (Python and JavaScript)

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_API_TOKEN>")
run = client.actor("blueskyscraper/linkedin-ads-scraper").call(run_input={"searchTerms": ["cybersecurity"], "countries": ["DE"], "maxAdsPerSearch": 100, "includeDetails": True})
for ad in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(ad.get("advertiserName"), ad.get("format"), ad.get("impressions"))
```

```javascript
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: '<YOUR_API_TOKEN>' });
const run = await client.actor('blueskyscraper/linkedin-ads-scraper').call({ searchTerms: ['crm'], countries: ['US'], maxAdsPerSearch: 200 });
const { items } = await client.dataset(run.defaultDatasetId).listItems();
```

#### No-code: n8n, Make, Zapier, Google Sheets

Use the Apify app in n8n, Make or Zapier: *Run Actor* → *Get dataset items*. For Google Sheets, use the Google Sheets integration on the Actor's Integrations tab, or download the run as Excel or CSV.

#### MCP server for AI agents

Connect `https://mcp.apify.com/?actors=blueskyscraper/linkedin-ads-scraper` to Claude, ChatGPT, Cursor or any MCP client, then ask in plain words — for example *"Which companies run LinkedIn ads about cybersecurity in Germany, and which got the most impressions?"* The input fields are written so an agent can call the Actor correctly without reading this page.

### 🤖 For AI agents

Actor `blueskyscraper/linkedin-ads-scraper`. **Purpose:** one row per LinkedIn ad from the public LinkedIn Ad Library. **Minimal input:** `{"searchTerms": ["hubspot"], "searchType": "advertiser"}`. Behaviors: `startUrls` and `companies` run alongside `searchTerms`; `startDate`/`endDate` override `dateRange`; `maxAdsPerSearch` defaults to 24 per search line; `text` is a ~120-character preview (`textTruncated: true`) unless `includeDetails` is on; empty impressions mean LinkedIn does not publish them for that ad, not zero; `advertiser` matches names partially, `companyId` or a company URL in `companies` is exact. Billed per row as `ad` or `ad-with-details`; error rows are free.

### ❓ FAQ

#### Is it legal to scrape the LinkedIn Ad Library?

The Ad Library is a public transparency tool that LinkedIn publishes for anyone to search without logging in, and this Actor reads only those public pages. It does not log in or touch private profiles. Ads can contain names of people (Thought Leader ads, message senders); if you store or process them, the GDPR and similar laws apply to you. Check LinkedIn's terms and consult a lawyer for your specific use.

#### Does it need a LinkedIn account or cookies?

No. Nothing is logged in, so there is no account to get restricted, and no browser either — runs finish in seconds.

#### Can I use LinkedIn Ads Scraper with the Apify API?

Yes. Every run can be started and read over the REST API or the Python and JavaScript clients above, so it works as an unofficial **LinkedIn Ads API** for ad intelligence.

#### Can I use it through an MCP server?

Yes, through the Apify MCP server — see Integrations.

#### Can I integrate it with other apps?

Yes: n8n, Make, Zapier, Google Sheets, Slack, webhooks, and anything that can call an HTTP API.

#### Why are impressions or targeting empty for some ads?

LinkedIn publishes run dates, impressions and targeting only for ads it reports under the EU Digital Services Act — ads that reached people in the EU. For ads shown only outside the EU those fields stay empty. **Impressions by country** appear once LinkedIn publishes them, which can take up to 48 hours after an ad starts; very fresh ads show the total impressions range but no country split yet. The Actor never estimates numbers LinkedIn does not show.

#### What happens when a search finds nothing?

You get one free row with `type: "error"` saying so, with a hint (remove the country filter, widen the dates). A search with no ads is a valid answer, not a failure, and nothing is charged.

#### Is it one row per ad?

Yes. The same ad found by two searches or two companies in one run appears once.

#### How many ads can I get per search?

Up to 5,000 per search line per run. LinkedIn serves 24 ads per page; 1,000 ads from two keywords took about two minutes in our test.

#### How much does a typical run cost?

The default run (24 ads) costs about $0.0016 × 24 ≈ $0.04 on the Free plan. 1,000 ads cost $1.6, 1,000 ads with details $3.2, less on paid plans.

### Your feedback

Something missing or wrong? Open an issue on the Issues tab — we answer quickly and fix what we can. If the Actor saves you time, a review helps other buyers find it.

### You might also like

| Actor | What it does |
|---|---|
| [LinkedIn Competitor Ads Scraper](https://apify.com/blueskyscraper/linkedin-competitor-ads-scraper) | Paste a competitor's LinkedIn company page and get every ad it runs |
| [LinkedIn Ad Details Scraper](https://apify.com/blueskyscraper/linkedin-ad-details-scraper) | Impressions by country, run dates, payer, targeting and landing page of each ad |
| [LinkedIn Company Details Scraper](https://apify.com/blueskyscraper/linkedin-company-details-scraper) | Size, industry, website and followers of the advertisers you find |
| [LinkedIn Company Posts Scraper](https://apify.com/blueskyscraper/linkedin-company-posts-scraper) | A company's organic posts next to its paid ads |
| [LinkedIn Company Jobs Scraper](https://apify.com/blueskyscraper/linkedin-company-jobs-scraper) | Who the advertiser is hiring right now |
| [LinkedIn Scraper](https://apify.com/blueskyscraper/linkedin-scraper) | Profiles, companies and posts in one Actor, no login |

**Also known as:** LinkedIn ads scraper, LinkedIn Ads API, LinkedIn ad library scraper, LinkedIn ad library API, LinkedIn ad spy tool, scrape LinkedIn ads, LinkedIn sponsored content scraper, B2B ads intelligence.

# Actor input Schema

## `searchTerms` (type: `array`):

One search per line. What a line means depends on <b>Search by</b>: a keyword from the ad copy (<code>crm</code>), an advertiser name (<code>hubspot</code>), a payer name, or a LinkedIn company ID (<code>1337</code>). Each line is billed only for the ads it returns.

## `searchType` (type: `string`):

How to read the search terms. <b>Keyword</b> finds ads whose copy contains the word; <b>Advertiser</b> matches the company or person shown on the ad (partial names match: <code>hubspot</code> also returns HubSpot partners); <b>Payer</b> matches the "Paid for by" entity; <b>Company ID</b> returns exactly one company's ads.

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

Keep only ads shown in these countries — two-letter codes: <code>US</code>, <code>GB</code>, <code>DE</code>, <code>FR</code>… Empty = all countries. Impressions and targeting are published for ads that reached the EU, so <code>DE</code> or <code>FR</code> gives the fullest detail rows.

## `maxAdsPerSearch` (type: `integer`):

How many ads to take from each search line, newest first. LinkedIn serves 24 per page; up to 5,000 per search per run.

## `includeDetails` (type: `boolean`):

Opens each ad's page in the Ad Library: full ad text, who paid, run dates, total impressions and impressions by country, targeted languages and locations, which targeting criteria were used (audience, company, job, demographic…), call-to-action button, landing page URL with its UTM parameters, video file. Impressions and targeting exist only for ads LinkedIn reports under the EU Digital Services Act; for other ads those fields stay empty. Such an ad is billed as an ad with details.

## `companies` (type: `array`):

Competitors whose LinkedIn ads you want, one per line: a LinkedIn company page (<code>https://www.linkedin.com/company/hubspot/</code>), a company ID (<code>68529</code>) or a name (<code>HubSpot</code>). A page URL or ID returns exactly that company's ads; a name uses LinkedIn's advertiser-name search, which also matches partners with the name in theirs.

## `dateRange` (type: `string`):

Keep only ads that ran in this period. For exact dates use Start date / End date below instead.

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

Custom range start, YYYY-MM-DD (for example <code>2026-01-01</code>). Overrides Date range.

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

Custom range end, YYYY-MM-DD (for example <code>2026-03-31</code>). Overrides Date range.

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

Newest ads first (LinkedIn's default) or oldest first.

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

Paste LinkedIn Ad Library links as you see them in the browser — a search (<code>https://www.linkedin.com/ad-library/search?keyword=crm\&countries=US,GB</code>, every filter of the page kept) or a single ad (<code>https://www.linkedin.com/ad-library/detail/1560106944</code>, always returned with details).

## `onlyNewRowsStore` (type: `string`):

Give this run a name — <code>my-ads-watch</code> — and the Actor remembers every ad it delivered under that name. Every later run with the same name writes and charges <b>only ads you have not received before</b>. Schedule the Actor daily to get a feed of new LinkedIn ads instead of the whole list each time. Leave empty to get everything found, every time.

## `maxConcurrency` (type: `integer`):

How many ad pages to open at once when details are on. 4 is safe; higher is faster but gets more refusals.

## Actor input object example

```json
{
  "searchTerms": [
    "crm"
  ],
  "searchType": "keyword",
  "countries": [
    "US"
  ],
  "maxAdsPerSearch": 24,
  "includeDetails": false,
  "dateRange": "any",
  "sortOrder": "newest",
  "maxConcurrency": 4
}
```

# Actor output Schema

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

One row per ad from the LinkedIn Ad Library: advertiser, format, ad copy, headline, image or video, carousel cards, document and event details; with details also who paid, run dates, total impressions, impressions by country, targeting, call to action and landing page. Error rows explain inputs that could not be read.

# 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 = {
    "searchTerms": [
        "crm"
    ],
    "countries": [
        "US"
    ],
    "maxAdsPerSearch": 24
};

// Run the Actor and wait for it to finish
const run = await client.actor("blueskyscraper/linkedin-ads-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 = {
    "searchTerms": ["crm"],
    "countries": ["US"],
    "maxAdsPerSearch": 24,
}

# Run the Actor and wait for it to finish
run = client.actor("blueskyscraper/linkedin-ads-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 '{
  "searchTerms": [
    "crm"
  ],
  "countries": [
    "US"
  ],
  "maxAdsPerSearch": 24
}' |
apify call blueskyscraper/linkedin-ads-scraper --silent --output-dataset

```

## MCP server setup

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