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

Scrape the LinkedIn Ad Library by keyword, company, advertiser or payer. Get ad text, image or video, landing page with UTM, run dates, plus EU/EEA impressions and targeting. No login. Bulk input, auto proxy fallback. Export JSON, CSV or Excel.

- **URL**: https://apify.com/data_minds/linkedin-ads-scraper.md
- **Developed by:** [Data Minds](https://apify.com/data_minds) (community)
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.01 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
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

### What is LinkedIn Ads Scraper?

**LinkedIn Ads Scraper** is a LinkedIn ads scraper for the public [LinkedIn Ad Library](https://www.linkedin.com/ad-library). Enter keywords, company links, advertiser or payer names, or Ad Library links, and each ad comes back as one row with copy, headline, creatives, landing page with UTM tags, run dates and EU/EEA impressions and targeting. Use it for competitor ad research, ad creative swipe file building and competitor ad monitoring. Pay per ad from $1.80 per 1,000 on the Gold plan, platform usage billed in addition. [📢 Try it free](https://apify.com/data_minds/linkedin-ads-scraper)

Use it for:

- 🔎 **Competitor ad research:** see which ads a rival runs, in which formats and since when.
- 🎨 **Ad creative swipe file:** collect headlines, ad copy, images, videos and document links for your next campaign brief.
- 📈 **Competitor ad monitoring:** schedule runs and compare new ads against your last export.
- 🔗 **Landing page and UTM tracking:** list landing domains and UTM tags per ad.
- 📝 **Ad copy analysis:** study calls to action and the links inside the ad text.
- 🏢 **Advertiser discovery:** find which companies advertise on a keyword.

The Apify platform adds scheduling, an API, webhooks, integrations and exports to JSON, CSV, Excel, XML or HTML.

#### What can LinkedIn Ads Scraper do?

- 🔎 Search the LinkedIn ad library by keyword, company link, `advertiser: Name`, `payer: Name`, an Ad Library search link or a single ad link.
- 🌍 Filter LinkedIn ads by country and by date range, and sort newest or oldest first.
- 🔬 Open every ad for the full text, landing page, run dates, impressions and targeting, or switch that off for a quick scan.
- 🎨 Return every format: single image, carousel, video, message, document, event, article and text ads.
- 📊 Save separate tables for targeting, impressions by country, carousel slides, media, links, advertisers and searches.
- 🕒 Stream each ad into the dataset as soon as it is collected, so you can watch results appear.

### What data can LinkedIn Ads Scraper extract?

Each ad is one row in the default dataset (the Ads table). Fields that LinkedIn does not show for an ad are returned empty.

| Group | Fields |
|---|---|
| 📢 Ad | `adId`, `adUrl`, `format`, `creativeType`, `isRestricted`, `restrictionDetails`, `variantCount` |
| 🏢 Advertiser | `advertiserName`, `advertiserUrl`, `advertiserId`, `advertiserType`, `advertiserLogo`, `advertiserHeadline`, `thoughtLeader`, `paidBy` |
| 📝 Copy | `body`, `bodyTruncated`, `bodyLinks`, `headline`, `ctas` |
| 🔗 Landing page | `clickUrl`, `clickUrlSource`, `landingDomain`, `utm` |
| 🎨 Creative | `imageUrl`, `carouselSlides`, `video`, `document`, `message`, `event`, `article` |
| 📅 Run dates | `availability`, `isActive` |
| 📈 Reach | `impressions`, `impressionsPerCountry`, `targeting` |
| 🔎 Run info | `detailsFetched`, `query`, `totalAdsForQuery`, `searchUrl`, `scrapedAt`, `error` |

> **Note:** `availability`, `isActive`, `impressions`, `impressionsPerCountry` and `targeting` exist only for ads LinkedIn served in the EU/EEA. `error` appears only when the full ad could not be read; the search data is still returned.

#### What data can't LinkedIn Ads Scraper extract?

- Ads that LinkedIn does not list in its public Ad Library.
- Impressions, run dates and targeting for ads outside the EU/EEA, because LinkedIn does not publish them.
- Spend or budget figures, which the Ad Library does not show.

### How to scrape LinkedIn ads

1. Create a free Apify account at [console.apify.com](https://console.apify.com/sign-up).
2. Open [LinkedIn Ads Scraper](https://apify.com/data_minds/linkedin-ads-scraper).
3. Add keywords, company links, `advertiser: Name`, `payer: Name` or Ad Library links to **urls**.
4. Choose **countries**, **dateRange** and **sortBy**, and set **maxItems** for each search.
5. Keep **includeDetails** on for the complete data, or turn it off for a quick scan.
6. Click **Start** and watch ads appear in the Output tab while the run is going.
7. Export the dataset as JSON, CSV or Excel.

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

LinkedIn Ads Scraper uses pay-per-event pricing: you pay for each ad saved to the default dataset, and platform usage is billed in addition. Per-section tables and the failed inputs table are not billed as ads.

| Apify plan | Price per ad | Price per 1,000 ads |
|---|---|---|
| Free | $0.0025 | $2.50 |
| Bronze | $0.0023 | $2.30 |
| Silver | $0.002 | $2.00 |
| Gold | $0.0018 | $1.80 |

The Actor start event costs $0.00005 per GB of memory, with a minimum of one event. The default memory is 1024 MB, so each run is charged 1 start event, $0.00005. The pricing tab also lists a dataset item event of $0.00001 per result ($0.01 per 1,000).

**Worked example:** 5,000 ads on the Gold plan cost 5,000 x $0.0018 = $9.00 for results, plus $0.05 for dataset item events and $0.00005 for the start event, about $9.05 before platform usage.

**Free plan math:** the $5 monthly Free credit covers about 2,000 ads at the Free price of $0.0025 (before the dataset item event and platform usage).

#### Is scraping LinkedIn ads free?

You can try it on the Free plan, where the monthly credit pays for about 2,000 ads before platform usage. Bigger volumes use Bronze, Silver or Gold prices. You can also set a maximum charge per run, and the run stops cleanly when it is reached. See the [pricing page](https://apify.com/data_minds/linkedin-ads-scraper/pricing).

### Input

Only **urls** is required. The prefilled example below collects ads for one company in the US.

```json
{
  "urls": ["https://www.linkedin.com/company/hubspot/"],
  "countries": ["US"],
  "proxyConfiguration": { "useApifyProxy": false }
}
```

The full list of fields is on the [input schema page](https://apify.com/data_minds/linkedin-ads-scraper/input-schema).

| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| `urls` | array | yes | none | Keywords, LinkedIn company links, `advertiser: Name`, `payer: Name`, Ad Library search links or single ad links. Duplicates are removed. |
| `maxItems` | integer | no | `10` | Ads per search. `0` returns everything the Ad Library lists. The form and schema default is 10; if the key is missing from an API call, it is treated as `0` (everything). |
| `includeDetails` | boolean | no | `true` | Opens every ad for the full text, landing page, run dates, impressions, targeting, video and document links. |
| `countries` | array | no | empty (worldwide) | Two-letter country codes such as US, GB, DE. |
| `dateRange` | string | no | `allTime` | `allTime`, `last-30-days`, `current-month`, `current-year`, `last-year` or `custom`. |
| `startDate` | string | no | none | First day of the custom range, YYYY-MM-DD. |
| `endDate` | string | no | none | Last day of the custom range, YYYY-MM-DD. Empty means yesterday. |
| `sortBy` | string | no | `newest` | `newest` or `oldest`. |
| `maxConcurrency` | integer | no | `8` | How many ads are opened at the same time (1 to 16). |
| `maxRequestRetries` | integer | no | `4` | How often a failed step is retried (0 to 10). |
| `proxyConfiguration` | object | no | `{"useApifyProxy": false}` | Optional proxy choice for the run. |

#### Tricky fields

- **urls**
  - ✅ Good: `"https://www.linkedin.com/company/hubspot/"`, `"crm software"`, `"payer: HubSpot"`.
  - ❌ Bad: an Ad Library link with no keyword, advertiser or payer in it; it returns nothing.
  - ✅ Good: a company link, which is matched to the advertiser with that name.
  - ❌ Bad: a member profile link when you want one company; member pages are matched by name and may include other advertisers.
- **maxItems**
  - ✅ Good: `50` for a first look at a competitor.
  - ❌ Bad: `0` with **includeDetails** on for a very large search, because every ad is opened separately and the run takes much longer.

> **Warning:** `0` means everything the Ad Library lists for each search. Set a number first, then raise it.

- **dateRange**
  - ✅ Good: `custom` together with `startDate` and `endDate`.
  - ❌ Bad: `startDate` or `endDate` while **dateRange** is not `custom`; they are ignored.

> **Warning:** The Ad Library only goes back about one year, so earlier dates are adjusted to the earliest searchable date.

- **countries**
  - ✅ Good: `["US", "DE"]`.
  - ❌ Bad: country names such as "Germany"; use two-letter codes. A pasted Ad Library link keeps its own country filter.

### Output

Results appear in the Output tab and in the default dataset while the run is going. Export them as JSON, CSV, Excel, XML or HTML, or read them through the API. Besides the Ads table, the run saves separate tables for targeting, impressions by country, carousel slides, media, links, advertisers, searches and failed inputs.

#### JSON example

An ad from the prefilled input (values are examples):

```json
{
  "adId": "1000000001",
  "adUrl": "https://www.linkedin.com/ad-library/detail/1000000001",
  "format": "SINGLE_IMAGE",
  "creativeType": "SPONSORED_STATUS_UPDATE",
  "advertiserName": "Example Company",
  "advertiserUrl": "https://www.linkedin.com/company/12345",
  "advertiserId": "12345",
  "advertiserType": "company",
  "advertiserLogo": "https://example.com/logo.jpg",
  "advertiserHeadline": "Example headline",
  "thoughtLeader": null,
  "paidBy": "Example Company, Inc.",
  "availability": { "start": "2026-09-01", "end": "2026-10-15", "durationDays": 45, "text": "Ran from Sep 1, 2026 to Oct 15, 2026" },
  "body": "Example ad text.",
  "bodyTruncated": false,
  "bodyLinks": ["https://example.com/guide"],
  "headline": "Example ad headline",
  "ctas": ["Learn more"],
  "clickUrl": "https://example.com/guide?utm_source=linkedin&utm_campaign=demo",
  "clickUrlSource": "ad",
  "landingDomain": "example.com",
  "utm": { "source": "linkedin", "campaign": "demo" },
  "imageUrl": "https://example.com/ad.jpg",
  "carouselSlides": null,
  "video": null,
  "document": null,
  "message": null,
  "event": null,
  "article": null,
  "impressions": { "label": "10k-50k", "min": 10000, "max": 50000 },
  "impressionsPerCountry": [{ "country": "Germany", "percent": 60, "label": "60%" }],
  "targeting": { "location": { "includes": ["Germany"], "excludes": [] } },
  "isRestricted": false,
  "restrictionDetails": null,
  "variantCount": 1,
  "detailsFetched": true,
  "query": "https://www.linkedin.com/company/hubspot/",
  "totalAdsForQuery": 120,
  "searchUrl": "https://www.linkedin.com/ad-library/search?accountOwner=example",
  "scrapedAt": "2026-11-07T10:00:00Z",
  "isActive": false
}
```

A row of the targeting table:

```json
{
  "adId": "1000000001",
  "adUrl": "https://www.linkedin.com/ad-library/detail/1000000001",
  "advertiserName": "Example Company",
  "format": "SINGLE_IMAGE",
  "facet": "Location",
  "rule": "include",
  "value": "Germany"
}
```

A row of the searches table:

```json
{ "input": "https://www.linkedin.com/company/hubspot/", "kind": "search", "adsFound": 10, "adsInLibrary": 120, "status": "ok" }
```

A row of the failed inputs table:

```json
{ "input": "example keyword", "url": "https://www.linkedin.com/ad-library/search?keyword=example", "error": "the search page could not be loaded" }
```

The other tables (impressions by country, carousel slides, media, links and advertisers) follow the same pattern: ad identifiers plus the section values.

The run also saves a `RUN_SUMMARY` record with counts such as `searches_requested`, `ads_saved`, `ads_charged`, `ads_without_details`, `entries_with_problems`, `entries_skipped`, `duration_seconds` and `spend_limit_reached`.

#### Notes and limitations

- Run dates, impressions, impressions per country and targeting exist only for EU/EEA ads.
- `clickUrl` can be empty: many non-EU ads and message ads have no outbound link. When the ad text contains an external link, the first one is used and `clickUrlSource` is `body`; when the link comes from the ad itself, it is `ad`.
- Media links are signed and expire, so download what you need soon after the run.
- With **includeDetails** off, the text can be shortened and `bodyTruncated` is `true`.
- `isActive` is `true` when the ad ran within the last 2 days and is only known for ads with run dates.

### Tips and advanced usage

- Start with `maxItems` 10 to check the output, then raise it. In API calls, set `maxItems` explicitly, because a missing value means everything.
- Use `advertiser: Name` for a brand name and `payer: Name` for the company that paid for the ads.
- Schedule LinkedIn ads scraping weekly on the same input to follow new campaigns, and use the LinkedIn ad library date filter to narrow ads by creation date.
- For LinkedIn ad library competitor analysis, compare competitor LinkedIn ads side by side and read the `body`, `headline` and `ctas` fields as LinkedIn ad copy examples.
- For LinkedIn ad landing page tracking, group the links table by landing domain and LinkedIn UTM parameters.
- Use the advertisers table and `paidBy` for LinkedIn B2B advertising research and to find who is advertising on LinkedIn for a keyword.
- Review LinkedIn ad targeting criteria such as language, location, job and company for EU/EEA ads.
- The `format` field separates LinkedIn carousel ads, LinkedIn video ads and LinkedIn document ads, and LinkedIn thought leader ads carry member details in `thoughtLeader`.
- The media table holds LinkedIn ad media links, and the `ctas` field holds LinkedIn ad CTA buttons.
- Feed ads into your own LinkedIn ads for AI analysis of messaging.
- Download LinkedIn ads from the Output tab to export LinkedIn ads to Excel, or read the LinkedIn ads JSON through the API as a LinkedIn ads data extractor.
- Save the LinkedIn ad library to CSV or use it like a LinkedIn ad library API from your own code.
- It also works as a bulk LinkedIn ads scraper for many keywords and as a LinkedIn competitor ads scraper.

### Integrations and API

#### Can I use LinkedIn Ads Scraper as an API?

Yes. Start runs and read results with the [Apify API](https://docs.apify.com/api/v2) or the apify-client packages for Node.js and Python. See the [API tab](https://apify.com/data_minds/linkedin-ads-scraper/api) for ready-made calls.

#### How to scrape LinkedIn ads with Python

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("data_minds/linkedin-ads-scraper").call(run_input={
    "urls": ["https://www.linkedin.com/company/hubspot/"],
    "countries": ["US"],
    "proxyConfiguration": {"useApifyProxy": False},
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["advertiserName"], item["headline"])
```

#### Can I integrate LinkedIn Ads Scraper with other apps?

Yes. Connect it to Make, Zapier, Google Sheets or Slack, trigger other tools with [webhooks](https://docs.apify.com/integrations/webhooks), and schedule recurring runs from the Apify Console.

#### Can I use LinkedIn Ads Scraper with AI agents (MCP)?

Yes. Use the Apify MCP server to let an AI agent run the Actor and read its results. Setup details are on the [MCP tab](https://apify.com/data_minds/linkedin-ads-scraper/api/mcp).

### Other LinkedIn scrapers

| Actor | What it does |
|---|---|
| 📢 [LinkedIn Ads Library Scraper](https://apify.com/data_minds/linkedin-ads-library-scraper) | Scrapes the LinkedIn Ad Library for ad copy, headlines, creatives, CTAs, advertiser and payer, impressions by country, targeting and run dates. |
| 👤 [LinkedIn People Search Scraper](https://apify.com/data_minds/linkedin-people-search-scraper) | Finds public LinkedIn profiles by keyword, job title, location and company, with work history, education and career metrics. |
| 📝 [LinkedIn Post Scraper](https://apify.com/data_minds/linkedin-post-scraper) | Scrapes public LinkedIn posts from company pages, profiles, post URLs and content searches: full text, author, media, engagement and comments. |
| 🔁 [Post Reshares & Reposts Scraper for LinkedIn (No Cookies)](https://apify.com/data_minds/post-reshares-reposts-scraper-for-linkedin-no-cookies) | Scrapes public LinkedIn posts from links or IDs: text, author, reactions, comments, media, links and reposted originals. |

### FAQ

#### Is it legal to scrape LinkedIn ads?

The Actor only collects ads that LinkedIn shows publicly in its Ad Library. Whether your use is lawful depends on your country and purpose, so read [Is web scraping legal?](https://blog.apify.com/is-web-scraping-legal/) and follow LinkedIn's terms. This is not legal advice; ask a lawyer when unsure.

#### How does LinkedIn Ads Scraper work?

You give it keywords, company links, advertiser or payer names, or Ad Library links, plus optional country and date filters. It looks each one up in the public Ad Library, collects every matching ad up to your maximum, and saves one row per ad with separate section tables you can export.

#### Why scrape LinkedIn ads?

Marketers and agencies scrape LinkedIn ads to research competitors, build ad creative swipe files, benchmark campaigns and track landing pages. Sales teams use advertiser lists to discover companies that spend on B2B ads. Repeated runs show which messages competitors launch, test and stop over time.

#### Why did I get fewer LinkedIn ads than expected?

Check three things: your maxItems limit, your country and date filters, and whether the search really has that many ads in the Ad Library. The searches table shows adsFound and adsInLibrary for each input, and the failed inputs table lists searches that could not be loaded.

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

LinkedIn publishes impression ranges, impressions per country, run dates and targeting only for ads served in the EU and EEA. For ads outside that area these fields are empty by design, not by error. The ad copy, creatives, advertiser and landing page are still returned.

#### Do I need a LinkedIn account or cookies?

No. It needs no LinkedIn login and no cookies. You only need a free Apify account to start runs. Never share your LinkedIn password with any scraper; this Actor does not ask for it, and public Ad Library data is all it collects.

#### Can I search a company by its LinkedIn link?

Yes. Paste a company link such as the HubSpot page in the example, and the Actor matches it to the advertiser with that name. A numeric company link is used directly. You can also type advertiser: Name to search by advertiser name, or payer: Name for the paying company.

#### LinkedIn Ads Scraper not working, what should I do?

First check your input against the examples above and read the run log, which explains most problems in plain words. If results still look wrong, open a report in the [Issues tab](https://apify.com/data_minds/linkedin-ads-scraper/issues/open) with your run link, and the maintainers will look into it.

### Support and feedback

- Found a bug or need another field? Open the [Issues tab](https://apify.com/data_minds/linkedin-ads-scraper/issues/open).
- Need custom solutions? Write to hello.dataminds@gmail.com.
- Built and maintained by the [data_minds team on Apify](https://apify.com/data_minds).

LinkedIn Ads Scraper is an independent tool and is not affiliated with or endorsed by LinkedIn. Use the data in line with the law and LinkedIn's terms.

# Actor input Schema

## `urls` (type: `array`):

One per line: a keyword (salesforce), a LinkedIn company link (https://www.linkedin.com/company/hubspot/), 'advertiser: Name', 'payer: Name', a LinkedIn Ad Library search link, or a link to a single ad. Duplicates are removed. Add as many as you like.

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

Ads to collect for each keyword or link. Use 0 for everything the Ad Library returns.

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

Opens every ad to add the full text, landing page with UTM tags, run dates, impressions, targeting, video and document links. Turn off for a much faster run with only the search card data (text may be shortened).

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

Two-letter country codes such as US, GB, DE. Leave empty for worldwide. A pasted Ad Library link keeps its own country filter.

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

When the ads were created. The Ad Library only goes back about one year. Choose Custom range to use the start and end dates below.

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

First day of the custom range, YYYY-MM-DD. Only used when the date range is Custom range.

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

Last day of the custom range, YYYY-MM-DD. Only used when the date range is Custom range. Empty means yesterday.

## `sortBy` (type: `string`):

Newest ads first or oldest ads first.

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

How many ad pages are opened at the same time. The run slows itself down when LinkedIn asks for it.

## `maxRequestRetries` (type: `integer`):

How often a failed request is retried before it is given up.

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

Optional. The default works for most runs. You can pick your own proxy here.

## Actor input object example

```json
{
  "urls": [
    "https://www.linkedin.com/company/hubspot/"
  ],
  "maxItems": 10,
  "includeDetails": true,
  "countries": [
    "US"
  ],
  "dateRange": "allTime",
  "sortBy": "newest",
  "maxConcurrency": 8,
  "maxRequestRetries": 4,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `results` (type: `string`):

One row per ad.

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

Advertiser name, page, type and payer per ad.

## `landingPages` (type: `string`):

Landing page, domain and UTM tags per ad.

## `runDates` (type: `string`):

Start, end and duration per ad (EU/EEA ads).

## `impressions` (type: `string`):

Impression range per ad (EU/EEA ads).

## `targeting` (type: `string`):

One row per targeting value (EU/EEA ads).

## `impressionsByCountry` (type: `string`):

One row per country share (EU/EEA ads).

## `carouselSlides` (type: `string`):

One row per carousel slide.

## `media` (type: `string`):

One row per image, video or document link.

## `links` (type: `string`):

One row per landing page or text link, with UTM tags.

## `advertisers` (type: `string`):

One row per advertiser found in the run.

## `searches` (type: `string`):

One row per keyword or link you gave, with how many ads it returned.

## `failedInputs` (type: `string`):

Keywords or links that could not be searched.

## `summary` (type: `string`):

Counts and timing of the run.

# 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 = {
    "urls": [
        "https://www.linkedin.com/company/hubspot/"
    ],
    "countries": [
        "US"
    ],
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("data_minds/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 = {
    "urls": ["https://www.linkedin.com/company/hubspot/"],
    "countries": ["US"],
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("data_minds/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 '{
  "urls": [
    "https://www.linkedin.com/company/hubspot/"
  ],
  "countries": [
    "US"
  ],
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call data_minds/linkedin-ads-scraper --silent --output-dataset

```

## MCP server setup

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