# Linkedin Company Audience Builder (`advantageous_subcontra/linkedin-audience-builder`) Actor

Turns a list of website domains into a company list ready to upload in LinkedIn Campaign Manager Audience Manager. This is a great tool to plan ABM campaigns.

- **URL**: https://apify.com/advantageous\_subcontra/linkedin-audience-builder.md
- **Developed by:** [Fabian Maume](https://apify.com/advantageous_subcontra) (community)
- **Categories:** Lead generation
- **Stats:** 2 total users, 1 monthly users, 83.3% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-usage

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js/docs.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## LinkedIn Company Audience Builder

This Actor turns a list of **website domains** into a company list ready to upload in **LinkedIn Campaign Manager audience manager**.

### What does LinkedIn Audience Builder do?

Give it a list of company domains (`apify.com`, `linkedin.com`, `netflix.com`, …) — either pasted directly or read from a **public Google Sheet column**. It resolves each domain to the company's LinkedIn page, pulls the company's industries and locations from LinkedIn, and emits one row per **(company × industry × location)** combination. The dataset uses the exact field names that LinkedIn Campaign Manager expects, so the CSV export from the Apify Console can be uploaded as a **Company List audience** with no post-processing.

Under the hood, the Actor chains up to three Apify Store scrapers:

1. (optional) [`advantageous_subcontra/public-google-sheet-scraper`](https://apify.com/advantageous_subcontra/public-google-sheet-scraper) — reads domains from a Google Sheet column.
2. [`vdrmota/contact-info-scraper`](https://apify.com/vdrmota/contact-info-scraper) — crawls each domain and extracts the LinkedIn company URL from the site.
3. [`harvestapi/linkedin-company`](https://apify.com/harvestapi/linkedin-company) — enriches each LinkedIn page with company name, website, industries, and locations.


### Why use LinkedIn Audience Builder?

- **Skip manual CSV construction.** LinkedIn's audience template demands very specific column names — this Actor produces them for you.
- **Cover every industry × location.** LinkedIn's ad targeting matches against the audience row-by-row, so expanding one company into multiple rows widens the match surface.
- **Enrich data at scale.** This Actor does the heavy lifting for you. So you can quickly build audience lists for your ABM campaign.
  
### How to build a LinkedIn Company List audience

1. Open the Actor's **Input** tab.
2. Provide domains in **either** of these ways (or both — they get merged and deduplicated):
    - Paste them into **Website domains** (bare `apify.com` and full URLs both work).
    - Set **Google Sheet URL** to a **public** sheet and **Google Sheet column name** to the header of the column that holds the domains.
3. (Optional) In **Advanced**, set **Max total charge** in USD to cap spend.
4. Click **Start**. The sub-Actor Runs appear in your Apify Console as the pipeline advances.
5. When the Run finishes, open the **Storage → Dataset** tab and click **Download → CSV**.
6. Upload the CSV into LinkedIn Campaign Manager → Plan → Audiences → Create → Upload a list → Company list.

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `domains` | `array<string>` | *empty* | Website domains to enrich. `["apify.com", "linkedin.com"]`. Required if no Google Sheet URL is provided. |
| `googleSheetUrl` | string | *empty* | URL of a **public** Google Sheet. Rows are read via [`advantageous_subcontra/public-google-sheet-scraper`](https://apify.com/advantageous_subcontra/public-google-sheet-scraper). |
| `googleSheetColumnName` | string | `domain` | Header of the column in the sheet that holds the domains. Required when a sheet URL is given. |
| `maxDepth` | integer | `1` | How deep the contact-info scraper crawls on each domain hunting for the LinkedIn footer link. |
| `maxRequestsPerStartUrl` | integer | `5` | Cap on pages the contact-info scraper visits per input domain. |

You must provide at least one of `domains` or `googleSheetUrl`. When both are set, the two lists are merged and deduplicated before enrichment.

The cost cap is **not** an input field — set it when triggering the Run (Apify Console → Advanced → **Max total charge**, or `maxTotalChargeUsd` via the API/SDK).

### Output

The default dataset holds rows whose field names match LinkedIn's audience template exactly:

```json
{
    "companyname": "Netflix",
    "companywebsite": "https://www.netflix.com",
    "companyemaildomain": "netflix.com",
    "linkedincompanypageurl": "https://www.linkedin.com/company/netflix",
    "stocksymbol": "",
    "industry": "Entertainment Providers",
    "city": "Los Gatos",
    "state": "California",
    "companycountry": "US",
    "zipcode": "95032"
}
````

You can download the dataset in various formats such as JSON, HTML, CSV, or Excel — CSV is what LinkedIn Campaign Manager wants.

#### Data table

| Field | Source |
|---|---|
| `companyname` | LinkedIn company page — `name` |
| `companywebsite` | LinkedIn company page — `website` |
| `companyemaildomain` | derived from `companywebsite` (host without `www.`) |
| `linkedincompanypageurl` | LinkedIn company page — canonical URL |
| `stocksymbol` | left blank (LinkedIn's audience match ignores it in most cases) |
| `industry` | one entry from LinkedIn's `industries` array — one row per industry |
| `city` / `state` / `companycountry` / `zipcode` | one entry from LinkedIn's `locations` array — one row per location |

### Pricing / Cost estimation

The Actor bills you for the two paid sub-Actors it calls; the orchestrator itself is compute-only.

- `vdrmota/contact-info-scraper` — from **$1.05 / 1,000 pages**.
- `harvestapi/linkedin-company` — from **$3.00 / 1,000 companies**.

For 500 domains with a homepage-only crawl (`maxDepth: 0`, `maxRequestsPerStartUrl: 1`), a rough estimate is `500 * $0.00105 + 500 * $0.003 ≈ $2.03`. Set **Max total charge** slightly above your worst-case estimate to bind spend.

### Tips / Advanced options

- Lower `maxDepth` and `maxRequestsPerStartUrl` when your domains reliably surface the LinkedIn URL in the footer — this typically halves cost.
- The output row count is `Σ (industries_i × locations_i)` across enriched companies. Expect 3–15 rows per US company; LinkedIn's smaller international pages often produce a single row.
- To resume a failed Run, click **Resurrect** in the Apify Console — the orchestrator persists progress in the key-value store and reattaches to already-completed sub-Actor runs.

### FAQ, disclaimers, and support

- **A domain didn't produce any row.** The contact-info scraper found no LinkedIn URL on that site. Look in the Run log for a `No LinkedIn company URL found for domain: …` warning. Add the LinkedIn URL manually to LinkedIn's audience upload, or raise `maxDepth`.
- **My CSV has empty `state` / `zipcode` cells.** LinkedIn doesn't always return complete location details. Empty cells are safe — LinkedIn Audience Manager treats them as "any".
- **Is scraping LinkedIn allowed?** This Actor uses [`harvestapi/linkedin-company`](https://apify.com/harvestapi/linkedin-company), whose author is responsible for scrape compliance. Review LinkedIn's Terms of Service and your local law before large-scale use.

Found a bug or want a feature? Open an issue on this Actor's **Issues** tab.

# Actor input Schema

## `domains` (type: `array`):

Website domains to enrich into a LinkedIn audience. Bare domains ("apify.com") and full URLs are both accepted. Merged with any domains read from the Google Sheet.

## `googleSheetUrl` (type: `string`):

URL of a PUBLIC Google Sheet whose rows contain company domains. Use File → Share → Publish to web → Link (CSV) or set link sharing to "Anyone with the link". Leave empty to only use the Website domains field.

## `googleSheetColumnName` (type: `string`):

Header of the column in the sheet that contains the website domains. Required when a Google Sheet URL is provided.

## `maxDepth` (type: `integer`):

How many link levels deep the contact-info scraper follows on each domain while hunting for the LinkedIn company URL. 0 = homepage only.

## `maxRequestsPerStartUrl` (type: `integer`):

Maximum number of pages the contact-info scraper visits per input domain. Keeps cost bounded per domain.

## Actor input object example

```json
{
  "domains": [
    "apify.com",
    "linkedin.com"
  ],
  "googleSheetColumnName": "domain",
  "maxDepth": 1,
  "maxRequestsPerStartUrl": 5
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

## `subDatasets` (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 = {
    "domains": [
        "apify.com",
        "linkedin.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("advantageous_subcontra/linkedin-audience-builder").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 = { "domains": [
        "apify.com",
        "linkedin.com",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("advantageous_subcontra/linkedin-audience-builder").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "domains": [
    "apify.com",
    "linkedin.com"
  ]
}' |
apify call advantageous_subcontra/linkedin-audience-builder --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=advantageous_subcontra/linkedin-audience-builder",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Linkedin Company Audience Builder",
        "description": "Turns a list of website domains into a company list ready to upload in LinkedIn Campaign Manager Audience Manager. This is a great tool to plan ABM campaigns.",
        "version": "0.0",
        "x-build-id": "nIqdmPflun6PASPlW"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/advantageous_subcontra~linkedin-audience-builder/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-advantageous_subcontra-linkedin-audience-builder",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/advantageous_subcontra~linkedin-audience-builder/runs": {
            "post": {
                "operationId": "runs-sync-advantageous_subcontra-linkedin-audience-builder",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/advantageous_subcontra~linkedin-audience-builder/run-sync": {
            "post": {
                "operationId": "run-sync-advantageous_subcontra-linkedin-audience-builder",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "domains": {
                        "title": "Website domains",
                        "uniqueItems": true,
                        "type": "array",
                        "description": "Website domains to enrich into a LinkedIn audience. Bare domains (\"apify.com\") and full URLs are both accepted. Merged with any domains read from the Google Sheet.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "googleSheetUrl": {
                        "title": "Google Sheet URL (optional)",
                        "type": "string",
                        "description": "URL of a PUBLIC Google Sheet whose rows contain company domains. Use File → Share → Publish to web → Link (CSV) or set link sharing to \"Anyone with the link\". Leave empty to only use the Website domains field."
                    },
                    "googleSheetColumnName": {
                        "title": "Google Sheet column name",
                        "type": "string",
                        "description": "Header of the column in the sheet that contains the website domains. Required when a Google Sheet URL is provided.",
                        "default": "domain"
                    },
                    "maxDepth": {
                        "title": "Contact scraper: max depth",
                        "minimum": 0,
                        "maximum": 5,
                        "type": "integer",
                        "description": "How many link levels deep the contact-info scraper follows on each domain while hunting for the LinkedIn company URL. 0 = homepage only.",
                        "default": 1
                    },
                    "maxRequestsPerStartUrl": {
                        "title": "Contact scraper: max pages per domain",
                        "minimum": 1,
                        "maximum": 50,
                        "type": "integer",
                        "description": "Maximum number of pages the contact-info scraper visits per input domain. Keeps cost bounded per domain.",
                        "default": 5
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
