# LinkedIn Ads Library Scraper (`sfoln/linkedin-ads-search`)

Search the LinkedIn Ad Library by keyword, company name or ID, or look up ad URLs: advertiser, headline, body, CTA, landing URL, media, run dates, impressions and targeting, one row per ad. $1.50 per 1,000 ads + $0.004 per results page.

- Family: Ad intelligence
- Categories: Social media, Lead generation, Ecommerce
- Availability: on request (private on Apify). Email contact@sfoln.com with subject "Access request: LinkedIn Ads Library Scraper (sfoln/linkedin-ads-search)" before calling; calls fail until it is public.
- JSON: https://www.sfoln.com/actors/linkedin-ads-search.json
- MCP: https://mcp.apify.com?tools=sfoln/linkedin-ads-search
- REST (sync): POST https://api.apify.com/v2/actors/sfoln~linkedin-ads-search/run-sync-get-dataset-items
- REST (async): POST https://api.apify.com/v2/actors/sfoln~linkedin-ads-search/runs

LinkedIn Ads Library Scraper searches the LinkedIn Ad Library by keyword, company name or company ID – or looks up ad URLs directly – and returns one dataset record per ad: advertiser and company page, ad type, headline, body text, call to action, landing URL, image / video / carousel media, run dates, impressions range, targeting summary and impressions by country. Filter by countries and date range. Built for B2B competitive research, ABM and demand-gen teams, agencies and AI agents.

## Price per delivered record

| Event | Price | Per 1,000 | Charged for |
| --- | --- | --- | --- |
| LinkedIn ad (`linkedin-ad`) | $0.0015 | $1.5 / 1,000 | Charged once per ad record delivered from the LinkedIn Ad Library (recordType ad). Duplicates, query summary rows and failed requests are not charged. |
| LinkedIn Ad Library request (`linkedin-ads-query`) | $0.004 | $4 / 1,000 | Charged once per Ad Library results page fetched and once per ad URL looked up. A page without new ads is charged only when the upstream provider billed it. Failed requests are not charged. |
| LinkedIn ad details (`linkedin-ad-details`) | $0.005 | $5 / 1,000 | Optional (includeAdDetails). Charged once per searched ad enriched from its ad page (impressions by country, full targeting, dates). Not charged when the details request fails. |

Pay-per-event, USD, billed by Apify; no platform usage charge. Only records with status `ok` are charged. Cap a run with `maxTotalChargeUsd`. Apify free plan: up to 10 per run.

## Run

```bash
curl -X POST "https://api.apify.com/v2/actors/sfoln~linkedin-ads-search/run-sync-get-dataset-items" \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"companies":["Microsoft"],"maxAdsPerQuery":10}'
```

MCP client configuration:

```json
{
  "mcpServers": {
    "apify": {
      "type": "http",
      "url": "https://mcp.apify.com?tools=sfoln/linkedin-ads-search"
    }
  }
}
```

Example prompt: List the 20 most recent LinkedIn ads run by Microsoft and summarize their headlines, calls to action and landing pages.

## Input

Search the LinkedIn Ad Library by keyword, company name or company ID, or look up ad URLs. Each query returns one dataset record per ad plus one summary record.

| Field | Type | Default | Meaning |
| --- | --- | --- | --- |
| `keywords` | array | — | Keywords: Keywords to search ad content for, one per line. Accounts on the Apify free plan can process up to 10 queries per run (keywords, companies, company IDs and ad URLs together). |
| `companies` | array | — | Company names: Advertiser company names (e.g. Microsoft), one per line. |
| `companyIds` | array | — | Company IDs: Numeric LinkedIn company IDs or linkedin.com/company/<id> URLs (most precise). |
| `adUrls` | array | — | Ad URLs: LinkedIn Ad Library ad URLs (https://www.linkedin.com/ad-library/detail/<id>) to look up directly. |
| `maxAdsPerQuery` | integer | `50` | Max ads per query: Maximum ads returned per keyword, company or company ID (1–500). |
| `countries` | array | — | Countries: Optional 2-letter country codes the ads were shown in (e.g. US, CA). |
| `startDate` | string | — | Shown from (YYYY-MM-DD): Optional; requires endDate. LinkedIn accepts dates from one year ago up to yesterday. |
| `endDate` | string | — | Shown until (YYYY-MM-DD): Optional; requires startDate. Must be yesterday or earlier. |
| `includeAdDetails` | boolean | `false` | Include ad details: Open every found ad's detail page for impressions by country, full targeting and dates. Adds one linkedin-ad-details event per ad. |
| `maxQueries` | integer | `100` | Max queries: Safety cap on keywords + companies + IDs + ad URLs processed in this run. |
| `concurrency` | integer | `4` | Concurrency: Queries processed in parallel (1–8). |
| `itemTimeoutSecs` | integer | `900` | Time limit per query (seconds): Pagination (and ad-detail calls) for one keyword, company or ID stops cleanly shortly before this limit (60–3600). Raise it for very large per-query limits. |
| `includeRaw` | boolean | `false` | Include raw upstream response: Attach the unmodified upstream ad object(s) to each ad record under `raw` (larger output). |

Example input:

```json
{
  "companies": [
    "Microsoft"
  ],
  "maxAdsPerQuery": 10
}
```

## Output

One record per input item with `status` (`ok` is charged; `not_found`, `error`, `skipped_*` are free) and `charged`. The run stores an `OUTPUT` summary record.

| Field | Type | Meaning |
| --- | --- | --- |
| `input` | string | object | Input: The input query this record belongs to. |
| `recordType` | string | Row type: ad (one per ad, charged linkedin-ad) \| query (one summary per query, free). |
| `status` | string | Status: ok \| not_found \| error \| skipped_invalid \| skipped_budget \| skipped_free_plan |
| `charged` | boolean | Charged: Whether this record incurred a pay-per-event charge. |
| `chargedEvent` | string | Charged event: Pay-per-event event charged for this record. |
| `source` | string | Source: Upstream data source (scrapecreators = ScrapeCreators API over the public ad library). |
| `fetchedAt` | string | Fetched at: ISO timestamp. |
| `error` | object | Error: code / message when status is not ok. |
| `warnings` | array | Warnings: Non-fatal notes (e.g. stopped early). |
| `query` | string | null | Query: Keyword, company, company ID or ad URL the row belongs to. |
| `queryType` | string | null | Query type: keyword \| company \| companyId \| adUrl. |
| `position` | integer | null | Position: 1-based position within the query results. |
| `adId` | string | null | Ad ID: LinkedIn Ad Library ad ID. |
| `adLibraryUrl` | string | null | Ad Library URL: Public LinkedIn Ad Library page of the ad. |
| `advertiser` | string | null | Advertiser: Advertiser (paying company). |
| `advertiserUrl` | string | null | Advertiser page: Advertiser's LinkedIn company page. |
| `poster` | string | null | Poster: Page or person shown as the poster. |
| `promotedBy` | string | null | Promoted by: Promoting page for thought-leader ads. |
| `adType` | string | null | Ad type: e.g. Single Image Ad, Video Ad, Carousel Ad, Document Ad. |
| `headline` | string | null | Headline: Ad headline. |
| `body` | string | null | Body: Ad introductory text. |
| `ctaText` | string | null | CTA text: Call-to-action button text. |
| `landingUrl` | string | null | Landing URL: Destination URL (LinkedIn trk tracking parameter removed). |
| `imageUrl` | string | null | Image URL: Creative image. |
| `videoUrl` | string | null | Video URL: Creative video. |
| `carouselImageUrls` | array | Carousel images: Carousel card images. |
| `startDate` | string | null | Start date: ISO date the ad started running (null when LinkedIn hides it). |
| `endDate` | string | null | End date: ISO date the ad stopped running. |
| `adDuration` | string | null | Run text: LinkedIn's run description, e.g. Ran from Aug 10, 2025 to Aug 10, 2025. |
| `totalImpressions` | string | null | Impressions: Impressions range, e.g. < 1k or 5k-10k. |
| `impressionsByCountry` | array | Impressions by country: Country and share of impressions (mostly from ad details). |
| `targeting` | object | null | Targeting: Targeting summary lines (language, location, audience, company…). |
| `detailsFetched` | boolean | null | Details fetched: Record comes from (or was enriched by) the ad detail page. |
| `detailsChargedEvent` | string | null | Details event: linkedin-ad-details when details were charged for this ad. |
| `adsDelivered` | integer | null | Ads delivered: Ads delivered for this query (summary rows). |
| `pagesFetched` | integer | null | Pages fetched: Upstream pages / lookups fetched (summary rows). |
| `queryFeesCharged` | integer | null | Request fees charged: linkedin-ads-query events charged (summary rows). |
| `adDetailsCharged` | integer | null | Details charged: linkedin-ad-details events charged (summary rows). |
| `totalResults` | integer | null | Total results: Total matching ads reported by LinkedIn (summary rows). |
| `stopReason` | string | null | Stop reason: limit \| end \| budget \| max_pages \| deadline \| error \| empty_pages (summary rows). |

Example record:

```json
{
  "input": {
    "kind": "company",
    "value": "Microsoft"
  },
  "recordType": "ad",
  "query": "Microsoft",
  "queryType": "company",
  "position": 1,
  "adId": "823975056",
  "adLibraryUrl": "https://www.linkedin.com/ad-library/detail/823975056",
  "advertiser": "Microsoft",
  "advertiserUrl": "https://www.linkedin.com/company/1035",
  "poster": "Microsoft",
  "promotedBy": null,
  "adType": "Single Image Ad",
  "headline": null,
  "body": "The countdown has begun – grab your discounted tickets now for #FabConEurope in Vienna! …",
  "ctaText": null,
  "landingUrl": "http://msft.it/6043sMFt3",
  "imageUrl": "https://media.licdn.com/dms/image/…",
  "videoUrl": null,
  "carouselImageUrls": [],
  "startDate": "2025-08-10T05:00:00.000Z",
  "endDate": "2025-08-10T05:00:00.000Z",
  "adDuration": "Ran from Aug 10, 2025 to Aug 10, 2025",
  "totalImpressions": "< 1k",
  "impressionsByCountry": [],
  "targeting": {
    "language": "Targeting includes English",
    "location": "Targeting includes Netherlands",
    "company": "Exclusion targeting applied"
  },
  "detailsFetched": false,
  "status": "ok",
  "charged": true,
  "chargedEvent": "linkedin-ad",
  "source": "scrapecreators",
  "fetchedAt": "2026-10-14T10:00:00.000Z"
}
```

## Related

- [Ad Library Scraper – Meta, Google & TikTok](https://www.sfoln.com/actors/ad-library-scraper.md) (`sfoln/ad-library-scraper`)
- [Facebook Ads Library Scraper](https://www.sfoln.com/actors/facebook-ads-search.md) (`sfoln/facebook-ads-search`)
- [Google Ads Transparency Scraper](https://www.sfoln.com/actors/google-ads-transparency.md) (`sfoln/google-ads-transparency`)
- [TikTok Ads Library Scraper](https://www.sfoln.com/actors/tiktok-ads-search.md) (`sfoln/tiktok-ads-search`)
- [LinkedIn Company Details Scraper (No Login)](https://www.sfoln.com/actors/linkedin-company-lookup.md) (`sfoln/linkedin-company-lookup`)

Publisher: SFOLN LLC, contact@sfoln.com. Catalogue: https://www.sfoln.com/catalog.json. Agent guide: https://www.sfoln.com/agents.md.
