# LinkedIn B2B Ad Intelligence — File Import (`afkdigital/linkedin-b2b-ad-intelligence`) Actor

Compare authorized customer ad exports. Import JSON, CSV or HTML files with ad copy, creative variants and landing pages. Includes a labeled synthetic demo.

- **URL**: https://apify.com/afkdigital/linkedin-b2b-ad-intelligence.md
- **Developed by:** [AFK Digital](https://apify.com/afkdigital) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.50 / 1,000 unique processed ad records

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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 B2B Ad Intelligence — File Import

Compare ad copy, creatives and destinations in customer-supplied LinkedIn advertising records. This Actor processes exports your organization has permission to use. Company names and URLs filter the supplied records. No LinkedIn connection, advertiser discovery, media download or login is included.

### Quick start

Run the prefilled example for a synthetic three-row export. It yields two distinct image variants. All example URLs are placeholders. Replace adsFile with {"format":"csv","content":"advertiserName,adId,adText\nExample,123,Sample copy"} to import a real export. Paste UTF-8 content, not a URL or local path. JSON content must encode an array of objects. HTML accepts one table with field names in its header and literal text values in its cells. Scripts are never executed and links are never followed.

Use advertiserName and at least one of adId, adText or creativeReferenceUrl per row. Supported columns include advertiserUrl, creativeType, landingPageUrl, sourceUrl, sourceReportedStartDate and sourceReportedEndDate. Use string IDs, HTTP(S) URLs and ISO calendar dates. Optional impressions and targeting are copied only when supplied. Invalid inputs fail validation before dataset writes.

companyNames matches advertiser names ignoring case. companyUrls and sourceUrls select matching URLs. keywords matches any substring of adText ignoring case. Filters across categories combine. dateFrom and dateTo select overlapping reported dates inclusively. When only one endpoint exists, the filter uses that known day. Undated rows are included only without date filters. maxAds caps distinct output variants in input order.

### Interpretation and billing

observedAt, firstObservedAt and lastObservedAt describe processing of the supplied snapshot in this run, not live ad sightings or a cross-run history. Source-reported dates retain their separate meaning. Ad visibility provides no evidence of spend, conversions or performance. Missing source fields are null and listed. Evidence records the input row numbers, available source URLs and a stable recordKey. Deduplication compares advertiser identity, ad ID, copy, creative type, creative URL and destination. Changed creative references or copy produce separate records. Missing identifiers or differently encoded URLs can limit matching.

The intended paid event is one unique processed ad variant written to the default dataset. A duplicate within the same input does not produce a second result. The Actor checkpoints writes and stops on an ambiguous incomplete write to avoid replay charges. Starting a new run processes a new snapshot. For HTTP retries when starting a run, reuse the same Apify run idempotency key where supported, or persist the original run ID and poll it.

### Automation examples

- n8n: read the CSV as text, construct adsFile, run the Actor, wait for success, retrieve default dataset items, then upsert by evidence.recordKey in your reporting table.
- Make: read the export, map its content to adsFile.content and its format to adsFile.format, run the Actor with Apify, get dataset items, then map each landingPageUrl and creativeReferenceUrl into Google Sheets.
- Clay: start one run per export through your workflow, fetch the completed dataset as CSV and import it into a Clay table. Use advertiserUrl for company matching and evidence.recordKey for ad-level identity. Do not start one run per row of the same export.

Example output from the synthetic fixture is included in example-output.json. No affiliation with LinkedIn.

# Actor input Schema

## `adsFile` (type: `object`):

Paste file contents with format json, csv or html.

## `companyNames` (type: `array`):

Optional filter applied to the supplied export.

## `companyUrls` (type: `array`):

Optional filter applied to the supplied export.

## `sourceUrls` (type: `array`):

Optional filter applied to the supplied export.

## `keywords` (type: `array`):

Optional filter applied to the supplied export.

## `dateFrom` (type: `string`):

Inclusive reported date filter, YYYY-MM-DD.

## `dateTo` (type: `string`):

Inclusive reported date filter, YYYY-MM-DD.

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

Output limit after deduplication.

## Actor input object example

```json
{
  "adsFile": {
    "format": "json",
    "content": "[\n  {\n    \"advertiserName\": \"North Pier Demo\",\n    \"adId\": \"DEMO-106\",\n    \"adText\": \"Compare the sample dashboard.\",\n    \"creativeType\": \"image\",\n    \"creativeReferenceUrl\": \"https://example.org/demo/a.png\",\n    \"landingPageUrl\": \"https://example.org/demo\",\n    \"sourceUrl\": \"https://example.org/demo/export\",\n    \"sourceReportedStartDate\": \"2026-01-12\"\n  },\n  {\n    \"advertiserName\": \"North Pier Demo\",\n    \"adId\": \"DEMO-106\",\n    \"adText\": \"Compare the sample dashboard.\",\n    \"creativeType\": \"image\",\n    \"creativeReferenceUrl\": \"https://example.org/demo/a.png\",\n    \"landingPageUrl\": \"https://example.org/demo\",\n    \"sourceUrl\": \"https://example.org/demo/export\",\n    \"sourceReportedStartDate\": \"2026-01-12\"\n  },\n  {\n    \"advertiserName\": \"North Pier Demo\",\n    \"adId\": \"DEMO-106\",\n    \"adText\": \"Compare the sample dashboard.\",\n    \"creativeType\": \"image\",\n    \"creativeReferenceUrl\": \"https://example.org/demo/b.png\",\n    \"landingPageUrl\": \"https://example.org/demo\",\n    \"sourceUrl\": \"https://example.org/demo/export\",\n    \"sourceReportedStartDate\": null\n  }\n]"
  },
  "maxAds": 1000
}
```

# Actor output Schema

## `ads` (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 = {
    "adsFile": {
        "format": "json",
        "content": "[\n  {\n    \"advertiserName\": \"North Pier Demo\",\n    \"adId\": \"DEMO-106\",\n    \"adText\": \"Compare the sample dashboard.\",\n    \"creativeType\": \"image\",\n    \"creativeReferenceUrl\": \"https://example.org/demo/a.png\",\n    \"landingPageUrl\": \"https://example.org/demo\",\n    \"sourceUrl\": \"https://example.org/demo/export\",\n    \"sourceReportedStartDate\": \"2026-01-12\"\n  },\n  {\n    \"advertiserName\": \"North Pier Demo\",\n    \"adId\": \"DEMO-106\",\n    \"adText\": \"Compare the sample dashboard.\",\n    \"creativeType\": \"image\",\n    \"creativeReferenceUrl\": \"https://example.org/demo/a.png\",\n    \"landingPageUrl\": \"https://example.org/demo\",\n    \"sourceUrl\": \"https://example.org/demo/export\",\n    \"sourceReportedStartDate\": \"2026-01-12\"\n  },\n  {\n    \"advertiserName\": \"North Pier Demo\",\n    \"adId\": \"DEMO-106\",\n    \"adText\": \"Compare the sample dashboard.\",\n    \"creativeType\": \"image\",\n    \"creativeReferenceUrl\": \"https://example.org/demo/b.png\",\n    \"landingPageUrl\": \"https://example.org/demo\",\n    \"sourceUrl\": \"https://example.org/demo/export\",\n    \"sourceReportedStartDate\": null\n  }\n]"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("afkdigital/linkedin-b2b-ad-intelligence").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 = { "adsFile": {
        "format": "json",
        "content": """[
  {
    \"advertiserName\": \"North Pier Demo\",
    \"adId\": \"DEMO-106\",
    \"adText\": \"Compare the sample dashboard.\",
    \"creativeType\": \"image\",
    \"creativeReferenceUrl\": \"https://example.org/demo/a.png\",
    \"landingPageUrl\": \"https://example.org/demo\",
    \"sourceUrl\": \"https://example.org/demo/export\",
    \"sourceReportedStartDate\": \"2026-01-12\"
  },
  {
    \"advertiserName\": \"North Pier Demo\",
    \"adId\": \"DEMO-106\",
    \"adText\": \"Compare the sample dashboard.\",
    \"creativeType\": \"image\",
    \"creativeReferenceUrl\": \"https://example.org/demo/a.png\",
    \"landingPageUrl\": \"https://example.org/demo\",
    \"sourceUrl\": \"https://example.org/demo/export\",
    \"sourceReportedStartDate\": \"2026-01-12\"
  },
  {
    \"advertiserName\": \"North Pier Demo\",
    \"adId\": \"DEMO-106\",
    \"adText\": \"Compare the sample dashboard.\",
    \"creativeType\": \"image\",
    \"creativeReferenceUrl\": \"https://example.org/demo/b.png\",
    \"landingPageUrl\": \"https://example.org/demo\",
    \"sourceUrl\": \"https://example.org/demo/export\",
    \"sourceReportedStartDate\": null
  }
]""",
    } }

# Run the Actor and wait for it to finish
run = client.actor("afkdigital/linkedin-b2b-ad-intelligence").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 '{
  "adsFile": {
    "format": "json",
    "content": "[\\n  {\\n    \\"advertiserName\\": \\"North Pier Demo\\",\\n    \\"adId\\": \\"DEMO-106\\",\\n    \\"adText\\": \\"Compare the sample dashboard.\\",\\n    \\"creativeType\\": \\"image\\",\\n    \\"creativeReferenceUrl\\": \\"https://example.org/demo/a.png\\",\\n    \\"landingPageUrl\\": \\"https://example.org/demo\\",\\n    \\"sourceUrl\\": \\"https://example.org/demo/export\\",\\n    \\"sourceReportedStartDate\\": \\"2026-01-12\\"\\n  },\\n  {\\n    \\"advertiserName\\": \\"North Pier Demo\\",\\n    \\"adId\\": \\"DEMO-106\\",\\n    \\"adText\\": \\"Compare the sample dashboard.\\",\\n    \\"creativeType\\": \\"image\\",\\n    \\"creativeReferenceUrl\\": \\"https://example.org/demo/a.png\\",\\n    \\"landingPageUrl\\": \\"https://example.org/demo\\",\\n    \\"sourceUrl\\": \\"https://example.org/demo/export\\",\\n    \\"sourceReportedStartDate\\": \\"2026-01-12\\"\\n  },\\n  {\\n    \\"advertiserName\\": \\"North Pier Demo\\",\\n    \\"adId\\": \\"DEMO-106\\",\\n    \\"adText\\": \\"Compare the sample dashboard.\\",\\n    \\"creativeType\\": \\"image\\",\\n    \\"creativeReferenceUrl\\": \\"https://example.org/demo/b.png\\",\\n    \\"landingPageUrl\\": \\"https://example.org/demo\\",\\n    \\"sourceUrl\\": \\"https://example.org/demo/export\\",\\n    \\"sourceReportedStartDate\\": null\\n  }\\n]"
  }
}' |
apify call afkdigital/linkedin-b2b-ad-intelligence --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,afkdigital/linkedin-b2b-ad-intelligence"
        }
    }
}
```

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/VAI1eXENyGjjahXP1/builds/Y4V5QFDhdM3XbeBRZ/openapi.json
