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

Scrape the LinkedIn Ad Library: ad copy, headline, images, videos, CTAs, landing page, advertiser, payer, run dates, impressions by country and targeting. Search URLs, ad URLs or company pages.

- **URL**: https://apify.com/parsebird/linkedin-ads-library-scraper.md
- **Developed by:** [ParseBird](https://apify.com/parsebird) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.69 / 1,000 linkedin ad (without details)s

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 Library Scraper

**LinkedIn Ads Library Scraper** extracts ads from the [LinkedIn Ad Library](https://www.linkedin.com/ad-library): full ad copy, headline, images, videos, CTAs, landing page, advertiser, the entity that paid for the ad, run dates, total impressions, impressions by country and targeting, as clean JSON, CSV or Excel.

<table><tr>
<td style="border-left:4px solid #0A66C2;padding:12px 16px;font-weight:600">
Paste any LinkedIn Ad Library search URL (advertiser, keyword, payer, country and date filters are kept), a single ad URL or a company page, and get every ad with its creative, landing page, reach and targeting across 12 ad formats, from single image and video to message, document and event ads.
</td>
</tr></table>

<br>

<table>
<tr>
<td colspan="3" style="padding:10px 14px;background:#0A66C2;border:none;border-radius:4px 4px 0 0">
<span style="color:#FFFFFF;font-size:14px;font-weight:700;letter-spacing:0.5px">ParseBird LinkedIn Suite</span>
<span style="color:#CFE4FA;font-size:13px">&nbsp;&nbsp;&bull;&nbsp;&nbsp;Companies, jobs, ads &amp; B2B leads</span>
</td>
</tr>
<tr>
<td style="padding:10px 14px;border:1px solid #E7E5E4;border-right:none;border-top:none;vertical-align:top;width:33%;background:#FFFFFF">
<a href="https://apify.com/parsebird/linkedin-company-scraper" style="color:#1C1917;text-decoration:none;font-weight:700;font-size:13px">LinkedIn Company Scraper Bulk</a><br>
<span style="color:#78716C;font-size:11px">Company profiles in bulk, no cookies</span>
</td>
<td style="padding:10px 14px;border:1px solid #E7E5E4;border-right:none;border-top:none;vertical-align:top;width:33%;background:#FFFFFF">
<a href="https://apify.com/parsebird/linkedin-jobs-scraper" style="color:#1C1917;text-decoration:none;font-weight:700;font-size:13px">LinkedIn Jobs Scraper</a><br>
<span style="color:#78716C;font-size:11px">Job postings, salaries &amp; details</span>
</td>
<td style="padding:10px 14px;border:1px solid #E7E5E4;border-top:none;vertical-align:top;width:33%;background:#FFFFFF">
<a href="https://apify.com/parsebird/linkedin-b2b-phone-number-scraper" style="color:#1C1917;text-decoration:none;font-weight:700;font-size:13px">LinkedIn B2B Phone Number Scraper</a><br>
<span style="color:#78716C;font-size:11px">B2B phone numbers &amp; emails</span>
</td>
</tr>
<tr>
<td style="padding:10px 14px;border:1px solid #E7E5E4;border-radius:0 0 0 4px;border-right:none;border-top:none;vertical-align:top;width:33%;background:#E8F1FB">
<a href="https://apify.com/parsebird/linkedin-ads-library-scraper" style="color:#0A66C2;text-decoration:none;font-weight:700;font-size:13px">LinkedIn Ads Library Scraper</a><br>
<span style="color:#0A66C2;font-size:11px;font-weight:600">You are here</span>
</td>
<td style="padding:10px 14px;border:1px solid #E7E5E4;border-right:none;border-top:none;vertical-align:top;width:33%;background:#FFFFFF"></td>
<td style="padding:10px 14px;border:1px solid #E7E5E4;border-radius:0 0 4px 0;border-top:none;vertical-align:top;width:33%;background:#FFFFFF"></td>
</tr>
</table>

<br>

##### Copy to your AI assistant

Copy this block into ChatGPT, Claude, Cursor, or any LLM to start using this actor.

```
Apify Actor: parsebird/linkedin-ads-library-scraper. Scrapes ads from the LinkedIn Ad Library (linkedin.com/ad-library). Call via ApifyClient: client.actor("parsebird/linkedin-ads-library-scraper").call(run_input={"startUrls": [{"url": "https://www.linkedin.com/ad-library/search?accountOwner=apify&countries=US&dateOption=last-30-days"}], "resultsLimit": 100, "skipDetails": false}). Inputs: startUrls (required array of {url}: LinkedIn Ad Library search URLs with any filters such as accountOwner, keyword, payer, countries, dateOption=last-30-days|current-month|current-year|last-year|custom-date-range with startdate/enddate; single ad URLs https://www.linkedin.com/ad-library/detail/<id>; or company pages https://www.linkedin.com/company/<slug or id>/, which return all of the company's ads without country or date filters), resultsLimit (integer, max ads per start URL, empty = all), skipDetails (boolean, default false: true reads search results only, faster and cheaper, without run dates, impressions, targeting, paidBy, advertiserUrl or video files, ad copy cut to about 100 characters), concurrency (integer 1-32, default 8). Output: one record per ad with adId, adUrl, advertiserName, advertiserUrl, advertiserId, advertiserLogo, paidBy, format (SINGLE_IMAGE | VIDEO | CAROUSEL | DOCUMENT | EVENT | ARTICLE | MESSAGE | TEXT | SPOTLIGHT | FOLLOW_COMPANY | JOBS | JOB_POSTING), adType, creativeType, availability {start, end}, impressions (range such as "100k-150k"), impressionsPerCountry [{country, impressions}], targeting {language, location, ...}, targetingParameters [{parameter, targeted, excluded}], headline, body, description, clickUrl, ctas, imageUrl, imageUrls, videoUrl, videoPosterUrl, carouselCards, document, event, article, message, job, hashtags, hasDetails, startUrl, scrapedAt. Pricing: pay per ad, one event per ad: "ad-with-details" or "ad-without-details". Full API spec: https://apify.com/parsebird/linkedin-ads-library-scraper/api. Get your token: https://console.apify.com/settings/integrations.
```

### What is LinkedIn Ads Library Scraper?

**LinkedIn Ads Library Scraper** turns the public [LinkedIn Ad Library](https://www.linkedin.com/ad-library) into a structured dataset. The Ad Library lists the ads companies run on LinkedIn. On October 18, 2026 it showed 26,224 ads for Microsoft, 30,567 for SAP and 2,242 for NVIDIA.

The easiest way to try it: search for an advertiser in the Ad Library, set the country and date filters, copy the URL from your browser, paste it into **Start URLs** and click **Start**. It works as a **LinkedIn Ad Library API alternative**: no LinkedIn account, cookies or API key needed.

### What can LinkedIn Ads Library Scraper do?

- 🔎 **Any Ad Library search.** Advertiser, keyword, payer, countries, date range and impressions filters are read straight from the URL.
- 🏢 **Company pages.** Paste a LinkedIn company URL and get all of that company's ads (matched by company id, not by name).
- 🔗 **Single ads.** Paste ad detail URLs to scrape specific ads.
- 🎨 **12 ad formats.** Single image, video, carousel, document, event, article, message (InMail and conversation), text, spotlight, follow company, jobs and job posting ads, each with its own content fields.
- 📊 **Reach and targeting.** Run dates, total impressions, impressions by country, targeted languages and locations, and which targeting parameters were used or excluded, when LinkedIn shows them.
- ⚡ **Skip details mode.** Read only the search results for much faster, cheaper runs.
- 📅 **Scheduling.** Run daily or weekly with [Apify Schedules](https://docs.apify.com/platform/schedules) to track competitors' new LinkedIn ads.
- 🔌 **API and integrations.** Use the [Apify API](https://docs.apify.com/api/v2), or send results to Google Sheets, Zapier, Make, Slack or webhooks with [Apify integrations](https://docs.apify.com/platform/integrations). Export as JSON, CSV, Excel, XML or HTML.

### What data can you extract from the LinkedIn Ad Library?

| Field | Description |
|-------|-------------|
| `adId`, `adUrl` | Ad Library id and ad page URL |
| `advertiserName`, `advertiserUrl`, `advertiserId`, `advertiserLogo` | The company page that ran the ad |
| `paidBy` | The entity that paid for the ad (often an agency) |
| `format`, `adType`, `creativeType` | Ad format (e.g. `SINGLE_IMAGE`), LinkedIn's label ("Single Image Ad") and its internal creative type |
| `headline`, `body`, `description` | Headline, full ad copy and image description |
| `clickUrl`, `ctas` | Landing page URL (when the ad links out) and call-to-action buttons |
| `imageUrl`, `imageUrls` | Ad images |
| `videoUrl`, `videoPosterUrl` | Video file (highest bitrate) and cover image |
| `carouselCards` | Title and image of each carousel card |
| `document` | Document ad title, preview pages and cover images |
| `event`, `article`, `job` | Event name, time, organizer and location; article title and newsletter; job title, company and location |
| `message` | Sender name and photo of message ads (InMail / conversation) |
| `availability` | First and last day the ad ran |
| `impressions` | Total impressions range (e.g. `100k-150k`, `<1k`, `>1M`) |
| `impressionsPerCountry` | Share of impressions per country |
| `targeting` | Targeted languages and locations (and excluded locations) |
| `targetingParameters` | Whether audience, demographic, company, education, job and interest targeting was used or excluded |
| `hashtags` | Hashtags in the ad copy |

### How to scrape the LinkedIn Ad Library

1. Open the [LinkedIn Ad Library](https://www.linkedin.com/ad-library) and search by advertiser, keyword or payer. Set countries and dates if you like.
2. Copy the URL of the results page, for example `https://www.linkedin.com/ad-library/search?accountOwner=apify&countries=US&dateOption=last-30-days`.
3. Open [LinkedIn Ads Library Scraper](https://apify.com/parsebird/linkedin-ads-library-scraper) in Apify Console and sign in (or create a free account).
4. Paste the URL into **Start URLs**. Add more search URLs, ad URLs or company pages if you need them.
5. Set **Results limit** (ads per URL). Leave **Skip details** off to get reach, targeting, run dates and full ad copy.
6. Click **Start**, then download the ads from the **Output** tab as JSON, CSV or Excel, or read them through the API.

### How much does it cost to scrape the LinkedIn Ad Library?

LinkedIn Ads Library Scraper uses **pay-per-event** pricing: each ad is charged once, with or without details. Compute and proxy costs are included in the event price; there are no other usage charges for the run.

| Event | Free | Bronze | Silver | Gold |
|-------|------|--------|--------|------|
| `ad-without-details` (Skip details on) | $0.00099 | $0.00089 | $0.00079 | $0.00069 |
| `ad-with-details` (full ad page) | $0.00299 | $0.00249 | $0.00199 | $0.00149 |
| Per 1,000 ads without details | **$0.99** | **$0.89** | **$0.79** | **$0.69** |
| Per 1,000 ads with details | **$2.99** | **$2.49** | **$1.99** | **$1.49** |

For example, 1,000 ads with full details cost $2.99 on the Free plan, or $0.99 with **Skip details** on. If an ad's page can't be loaded, that ad is saved from the search results and charged at the lower price. Set a maximum cost per run in Apify Console and the actor stops when it's reached.

### Input parameters

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `startUrls` | URL\[] | **Yes** | — | Ad Library search URLs, ad detail URLs or LinkedIn company URLs |
| `resultsLimit` | integer | No | all | Maximum ads per start URL |
| `skipDetails` | boolean | No | `false` | Read search results only (faster and cheaper, fewer fields) |
| `concurrency` | integer | No | `8` | Ad pages loaded at the same time (1-32) |

```json
{
    "startUrls": [
        { "url": "https://www.linkedin.com/ad-library/search?accountOwner=apify&countries=US&dateOption=last-30-days" },
        { "url": "https://www.linkedin.com/company/nvidia/" },
        { "url": "https://www.linkedin.com/ad-library/detail/1600269964" }
    ],
    "resultsLimit": 100,
    "skipDetails": false
}
```

### Output example

One single image ad with details (lists shortened):

```json
{
    "adId": "1600269964",
    "adUrl": "https://www.linkedin.com/ad-library/detail/1600269964",
    "advertiserName": "Microsoft",
    "advertiserUrl": "https://www.linkedin.com/company/1035",
    "advertiserId": "1035",
    "advertiserLogo": "https://media.licdn.com/dms/image/v2/D560BAQH32RJQCl3dDQ/company-logo_100_100/B56ZYQ0mrGGoAU-/0/1744038948046/microsoft_logo?e=1793836800&v=beta&t=AL2OIJZ6o8r3RRAi17N7JqUObdnVb6ixUcvRMZbLb2k",
    "paidBy": "ZENITH UK (MEDIA) LIMITED",
    "format": "SINGLE_IMAGE",
    "adType": "Single Image Ad",
    "creativeType": "SPONSORED_STATUS_UPDATE",
    "availability": { "start": "2026-10-14", "end": "2026-10-18" },
    "impressions": "<1k",
    "impressionsPerCountry": [
        { "country": "Netherlands", "impressions": "91%" },
        { "country": "Belgium", "impressions": "8%" },
        { "country": "Luxembourg", "impressions": "<1%" }
    ],
    "targeting": { "language": "Nederlands", "location": "Benelux" },
    "targetingParameters": [
        { "parameter": "Audience", "targeted": true, "excluded": false },
        { "parameter": "Company", "targeted": false, "excluded": true },
        { "parameter": "Job", "targeted": true, "excluded": false }
    ],
    "headline": "Beveilig, beheer en schaal AI op",
    "body": "Van pilot naar productie: kom naar de Microsoft Frontier Tour in Utrecht voor een dag over de architectuur, beveiliging en governance achter AI voor ondernemingen.\n\nEchte implementatiepatronen, lessen uit de praktijk en directe toegang tot Microsoft-experts.\n\n10 december 2026\nUtrecht, Nederland\n\nVraag deelname aan.",
    "description": null,
    "clickUrl": "https://aitour.microsoft.com/flow/microsoft/utrecht27/citylanding/page/cityhome?wt.mc_id=3084764_QSG_PD_SCL_675381_imga",
    "ctas": ["Registreren"],
    "imageUrl": "https://media.licdn.com/dms/image/v2/D4D10AQFkx_1c2JlL7w/image-shrink_1280/B4DaE1ppf5HoAc-/0/1791901473042/EMEA_FrontierTour_Utrecht_IMGajpg?e=2147483647&v=beta&t=ueLgAOg35AP1vSRYU1RoRmvaebXifY_yTWtKbRSEvRg",
    "videoUrl": null,
    "carouselCards": [],
    "document": null,
    "event": null,
    "message": null,
    "hashtags": [],
    "hasDetails": true,
    "startUrl": "https://www.linkedin.com/ad-library/search?accountOwner=microsoft",
    "scrapedAt": "2026-10-18T07:59:35Z"
}
```

Format-specific fields (`carouselCards`, `document`, `event`, `article`, `message`, `job`, `videoUrl`) are filled for their formats and empty otherwise. Download the dataset in JSON, CSV, Excel, XML or HTML from the **Output** tab.

### Use the LinkedIn Ads Library Scraper API

Start the actor and read its results from your own code with the Apify API clients. Find your token in [Apify Console → Settings → Integrations](https://console.apify.com/settings/integrations).

**Python** ([apify-client](https://docs.apify.com/api/client/python/)):

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("parsebird/linkedin-ads-library-scraper").call(run_input={
    "startUrls": [{"url": "https://www.linkedin.com/ad-library/search?accountOwner=hubspot&countries=DE&dateOption=last-30-days"}],
    "resultsLimit": 200,
})
for ad in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(ad["format"], ad["headline"], ad["impressions"], ad["clickUrl"])
```

**JavaScript** ([apify-client](https://docs.apify.com/api/client/js/)):

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: '<YOUR_APIFY_TOKEN>' });
const run = await client.actor('parsebird/linkedin-ads-library-scraper').call({
    startUrls: [{ url: 'https://www.linkedin.com/company/salesforce/' }],
    resultsLimit: 500,
    skipDetails: true,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((ad) => console.log(ad.advertiserName, ad.format, ad.body));
```

### Use cases

- **Competitor research:** see every LinkedIn ad a competitor runs, with copy, creative, CTA and landing page.
- **B2B ad inspiration:** collect headlines, hooks and formats that companies in your market use.
- **Agency reporting:** track which agencies (`paidBy`) run ads for which brands.
- **Reach analysis:** compare impressions and country splits across ads and advertisers.
- **Targeting insight:** see which languages, locations and targeting types advertisers choose.
- **Monitoring:** schedule a run to catch new ads from the companies you follow.

### How it works

1. Each search URL is run as it is, with all its filters. Company URLs are turned into a search by the company's LinkedIn id.
2. The actor pages through the results (24 ads per page) and removes duplicates across URLs.
3. Unless **Skip details** is on, it opens each ad's page for the full copy, media, run dates, impressions and targeting.
4. Ads are saved and charged as they come in. LinkedIn blocks datacenter IPs from the Ad Library, so the actor uses residential proxies; that cost is included in the price.

### FAQ

**Why do some ads have no impressions, run dates or targeting?**
LinkedIn shows impressions, the run period and targeting only for some ads. In our tests about a third of ads had them (172 of 500 across Microsoft and Salesforce); the rest show only the creative and the advertiser. The actor returns this data whenever the ad page has it.

**What does Skip details change?**
With **Skip details** on, the actor reads only the search results. You get the format, advertiser name and logo, headline, image or video cover and the start of the ad copy (search results cut it at about 100 characters). Run dates, impressions, targeting, `paidBy`, `advertiserUrl`, landing page and video files are only on the ad page. In our tests on Apify, 1,000 ads without details took about 3.5 minutes, and 500 ads with details about 8 minutes.

**Can I filter by country or date when I use a company URL?**
Not with the company URL itself. Instead, search for the company in the Ad Library, set the filters there and paste that search URL.

**Why is `clickUrl` empty for some ads?**
Some ads don't link out from the Ad Library preview (for example message ads, or ads whose button LinkedIn shows without a link). The actor returns the landing page whenever the ad shows one.

**Why do message ads contain %FIRSTNAME%?**
These are LinkedIn's personalization placeholders. The ad copy is returned exactly as the advertiser wrote it.

**Can I schedule runs and connect them to other tools?**
Yes. Use [Apify Schedules](https://docs.apify.com/platform/schedules) for recurring runs and [integrations](https://docs.apify.com/platform/integrations) for Google Sheets, Slack, Zapier, Make, n8n or webhooks. Results are also available through the [API](https://apify.com/parsebird/linkedin-ads-library-scraper/api).

**Something doesn't work or a field is missing?**
Open an issue on the actor's **Issues** tab with the input you used, and we'll look into it.

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

This actor collects ad information that LinkedIn publishes in its public Ad Library. Message ads can show the sender's name and photo, which are personal data, so if you process them, make sure you have a lawful basis under the privacy laws that apply to you (for example the GDPR), and respect LinkedIn's terms of use. Scraping public data is generally lawful, but you are responsible for how you use it. Read more in Apify's blog post [Is web scraping legal?](https://blog.apify.com/is-web-scraping-legal/), and ask a lawyer if you're unsure.

### Other ad library and LinkedIn scrapers

| Actor | What it does |
|-------|-------------|
| [Meta | Facebook Ads Library Scraper](https://apify.com/parsebird/facebook-ads-library-scraper) | Facebook and Instagram ads from the Meta Ad Library |
| [Google Ads Transparency Center Scraper](https://apify.com/parsebird/google-ads-transparency-scraper) | Ads from the Google Ads Transparency Center by domain, keyword or advertiser |
| [TikTok Top Ads Scraper](https://apify.com/parsebird/tiktok-top-ads-scraper) | Top-performing TikTok ads from TikTok Creative Center |
| [LinkedIn Company Scraper Bulk](https://apify.com/parsebird/linkedin-company-scraper) | LinkedIn company profiles in bulk |
| [LinkedIn Jobs Scraper](https://apify.com/parsebird/linkedin-jobs-scraper) | LinkedIn job postings with salaries and details |
| [LinkedIn B2B Phone Number Scraper](https://apify.com/parsebird/linkedin-b2b-phone-number-scraper) | Phone numbers and business emails from public LinkedIn pages |

# Changelog

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

# Actor input Schema

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

Paste LinkedIn Ad Library search URLs (e.g. https://www.linkedin.com/ad-library/search?accountOwner=apify\&countries=US\&dateOption=last-30-days), single ad URLs (https://www.linkedin.com/ad-library/detail/...) or company pages (https://www.linkedin.com/company/nvidia/). Search URLs keep all their filters: advertiser, keyword, payer, countries, dates and impressions. A company URL returns all of that company's ads, without country or date filters.

## `resultsLimit` (type: `integer`):

Maximum number of ads to return per start URL. Leave empty to get every ad the search returns.

## `skipDetails` (type: `boolean`):

Read only the search results instead of opening each ad. Much faster and billed at the lower per-ad price, but there are no run dates, impressions, targeting, paid-by entity, advertiser link or video files, and long ad copy may be cut off.

## `concurrency` (type: `integer`):

Number of ad pages to load at the same time. Leave empty to use the default (8).

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.linkedin.com/ad-library/search?accountOwner=apify&countries=US&dateOption=last-30-days"
    }
  ],
  "resultsLimit": 20,
  "skipDetails": false
}
```

# Actor output Schema

## `dataset` (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?accountOwner=apify&countries=US&dateOption=last-30-days"
        }
    ],
    "resultsLimit": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("parsebird/linkedin-ads-library-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "startUrls": [{ "url": "https://www.linkedin.com/ad-library/search?accountOwner=apify&countries=US&dateOption=last-30-days" }],
    "resultsLimit": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("parsebird/linkedin-ads-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?accountOwner=apify&countries=US&dateOption=last-30-days"
    }
  ],
  "resultsLimit": 20
}' |
apify call parsebird/linkedin-ads-library-scraper --silent --output-dataset

```

## MCP server setup

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