# LinkedIn Company Custom Headcount Scraper (`khadinakbar/linkedin-company-custom-headcount-scraper`) Actor

Count employees at a public LinkedIn company by keyword, location, function, skill, or school. Returns official LinkedIn employeeCount plus a cookieless public-profile sample for custom filters. No login. MCP-ready.

- **URL**: https://apify.com/khadinakbar/linkedin-company-custom-headcount-scraper.md
- **Developed by:** [Khadin Akbar](https://apify.com/khadinakbar) (community)
- **Categories:** Lead generation, Social media, MCP servers
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 1,000 company headcount results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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 Custom Headcount Scraper

Turn one or more public LinkedIn company pages into a headcount record. Paste `https://www.linkedin.com/company/apple` and get official `employeeCount`, size band, industry, and headquarters. Add keyword, location, function, skill, or school filters to attach a cookieless public `/in/` sample; `customHeadcount` then equals that sample size, while `employeeCount` stays the LinkedIn-published census. No LinkedIn login or cookies.

Built for B2B sales, recruiting, and market-research teams who need TAM and team-composition signals without a Sales Navigator seat. Pair it with [LinkedIn Company by Domain Scraper](https://apify.com/khadinakbar/linkedin-company-by-domain-scraper) when you start from a website instead of a company URL, then continue with [LinkedIn Company Search Scraper](https://apify.com/khadinakbar/linkedin-company-search-scraper) when the starting point is a keyword rather than a known page.

### Best fit for this Actor

- Strongest starting condition: a public `/company/` URL or vanity slug such as `apple`.
- Useful output: one dataset row per company with official `employeeCount` and, when filters are set, a public-profile sample.
- For people lists instead of counts, start with [LinkedIn Profile Search Scraper](https://apify.com/khadinakbar/linkedin-profile-search-scraper) and pass title plus company filters.

### Who it is for (and why it matters)

- **Account executives** — size a target account before outreach and see whether engineering or sales talent shows up in public profiles.
- **Recruiters** — compare official LinkedIn headcount with a public sample of people matching a role and location.
- **Market researchers** — bulk-count a competitor set without logging into LinkedIn.
- **AI agents** — one tool call with `companyUrls` returns structured headcount rows, `countMethod`, and `OUTPUT.outcome`.

### Input reference

| Field | Type | Default | What it controls |
|---|---|---|---|
| `companyUrls` | array (required) | 1 Apple URL | Public `/company/` URLs or vanity slugs, up to 100 |
| `keywords` | string | empty | Extra people-search phrase such as `software engineer` |
| `locations` | string array | empty | Where they live, e.g. `United States` |
| `functions` | string array | empty | What they do, e.g. `Engineering` |
| `skills` | string array | empty | Skill phrases such as `Python` |
| `schools` / `fieldsOfStudy` | string arrays | empty | Education phrases |
| `whereTheyLive` / `whatTheyDo` / … | integer arrays | empty | Optional LinkedIn IDs mapped to labels when known |
| `includeSampleProfiles` | boolean | true | Attach matching public `/in/` rows when filters are set |
| `maxSampleProfiles` | integer | 10 | Cap on the custom sample (1–50) |
| `maxCompanies` | integer | 25 | Cap on billed company rows this run |
| `includeSubsidiaries` | boolean | false | Accepted for compatibility; subsidiaries are not expanded |
| `providerOrder` | enum | `scrapecreators-first` | Public-data provider priority |

#### Quick start input

```json
{
    "companyUrls": ["https://www.linkedin.com/company/apple"],
    "maxCompanies": 1
}
```

That input selects one well-known public company page so the run stays inside the five-minute quality window and still returns a real official headcount.

#### Example input — custom filter sample

```json
{
    "companyUrls": ["https://www.linkedin.com/company/apple"],
    "keywords": "software engineer",
    "locations": ["San Francisco"],
    "functions": ["Engineering"],
    "maxSampleProfiles": 5,
    "maxCompanies": 1
}
```

Human-readable filters are the agent-friendly path. Known LinkedIn IDs such as `whatTheyDo: [8]` (Engineering) and `whereTheyLive: [103644278]` (United States) are mapped to the same labels.

### What data you receive

One dataset item is one company. Official census fields always come from the public company page. Custom filters change `customHeadcount` to the public-sample size and set `countMethod` to `public_profile_sample`.

```json
{
    "inputCompany": "https://www.linkedin.com/company/apple",
    "companyName": "Apple",
    "companyUrl": "https://www.linkedin.com/company/apple/",
    "companyId": "162479",
    "employeeCount": 212408,
    "employeeRange": "10,001+ employees",
    "customHeadcount": 212408,
    "countMethod": "linkedin_company_page",
    "industry": "Computers and Electronics Manufacturing",
    "headquarters": "Cupertino, California, United States",
    "outcome": "FOUND",
    "provider": "scrapecreators",
    "scrapedAt": "2026-08-21T00:00:00.000Z"
}
```

Filtered example keeps the official census and adds the sample:

```json
{
    "companyName": "Apple",
    "employeeCount": 212408,
    "customHeadcount": 5,
    "countMethod": "public_profile_sample",
    "hasMore": true,
    "searchQuery": "site:linkedin.com/in \"Apple\" \"software engineer\" \"San Francisco\" Engineering",
    "sampleCount": 5,
    "outcome": "FOUND"
}
```

Every terminal run also writes `OUTPUT` and `RUN_SUMMARY` with a named `outcome`, per-company counters, and billing.

### Workflow story: from a competitor list to TAM and team-shape signals

A sales-ops lead keeps 12 competitor domains in a sheet. She first resolves them with [LinkedIn Company by Domain Scraper](https://apify.com/khadinakbar/linkedin-company-by-domain-scraper), then feeds the returned `/company/` URLs here with `functions: ["Engineering"]` and `locations: ["United States"]`. Each row comes back with official `employeeCount` for TAM and a public engineering sample she can skim. She exports the overview view, sorts by `employeeCount`, and schedules a weekly run so the census stays current.

### Use through the API

```bash
curl -X POST "https://api.apify.com/v2/acts/khadinakbar~linkedin-company-custom-headcount-scraper/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "companyUrls": ["https://www.linkedin.com/company/apple"],
    "maxCompanies": 1
  }'
```

Results land in the run's default dataset. The same Actor is exposed through Apify MCP as `apify--linkedin-company-custom-headcount-scraper`.

### Use with AI agents through Apify MCP

> Given these LinkedIn company URLs, return official employeeCount, industry, and headquarters. If I also pass a function and location, attach a public-profile sample and set customHeadcount to that sample size. Inspect OUTPUT.outcome and keep companyUrl as the source identifier.

Connect through [Apify MCP](https://mcp.apify.com). Cap `maxCompanies` so spend stays predictable. Treat `NOT_FOUND` as a completed empty lookup for that slug, not a reason to retry the same input.

### Connect the workflow

- Start from a website domain with [LinkedIn Company by Domain Scraper](https://apify.com/khadinakbar/linkedin-company-by-domain-scraper), then pass `linkedinCompanyUrl` into `companyUrls` here.
- Search by keyword with [LinkedIn Company Search Scraper](https://apify.com/khadinakbar/linkedin-company-search-scraper) when you do not already have company URLs.
- After you have matching `/in/` URLs from the sample, continue with [LinkedIn Profile Details Scraper](https://apify.com/khadinakbar/linkedin-profile-details-scraper) for the public about view.

### Pricing

This Actor uses Pay per event plus Apify platform usage. Open the live Pricing tab for current event details, and use Apify's run cost controls to keep the workflow aligned with your budget.

| Event | Price | Charged when |
|---|---|---|
| Actor start | $0.00005 | Once per run (scaled by memory) |
| `headcount-result` | $0.01 | One found company headcount row |

Invalid URLs, unknown company slugs, and provider-empty lookups are not billed as `headcount-result`.

| Run | Found rows | Event cost (approx.) |
|---|---|---|
| 1 company, official count | 1 | ~$0.01 |
| 12 competitors, official count | 12 | ~$0.12 |
| 12 competitors with engineering filter | 12 | ~$0.12 |

Platform usage is billed on top at Apify's rates — the live [Pricing tab](https://apify.com/khadinakbar/linkedin-company-custom-headcount-scraper/pricing) is the current source of truth.

### Best results

- Provide canonical `/company/` URLs. Vanity slugs such as `apple` work; `/in/`, `/school/`, and `/showcase/` pages are rejected.
- Use human-readable `locations` and `functions` for new jobs. LinkedIn numeric IDs are compatibility-only and skip unknown values.
- Keep `maxSampleProfiles` small. The sample is a public-index slice, not a Recruiter census.
- `includeSubsidiaries` is recorded as requested and left unexpanded because public cookieless data does not expose a subsidiary graph.
- Confirm `countMethod` before you compare numbers across companies: `linkedin_company_page` is the official census; `public_profile_sample` is the filtered sample size.

### Builder's note

I built this after probing ScrapeCreators and SociaVault live on 2026-08-21. Neither provider exposes a LinkedIn people-search count, and Google Search returns organic hits without `totalResults`. The honest public path is therefore the company-page `employeeCount` (Apple returned 212408) plus an optional `site:linkedin.com/in` sample for custom filters. That is why `customHeadcount` equals the official census when filters are empty, and equals the public sample size when filters are present, instead of inventing a Recruiter-style intersection count.

### Responsible use

Use this Actor on public LinkedIn company pages you are authorized to process for legitimate sales, recruiting, or research. It reads **public company pages and public web search results only**. It does not log into LinkedIn, does not use your cookies, and is not a private org-chart or Recruiter dump. Follow GDPR, CCPA, LinkedIn's terms, and any local law that applies to your workflow.

This tool is provided for lawful public-data collection. You are responsible for how you use the output.

# Actor input Schema

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

Public LinkedIn company pages to count. Accepts full URLs such as https://www.linkedin.com/company/apple or vanity slugs such as apple. One company per line, up to 100. NOT person /in/ URLs, /school/ pages, or /showcase/ pages.

## `keywords` (type: `string`):

Free-text keywords used to filter public people results, such as software engineer or account executive. Combined with the company name in a Google site:linkedin.com/in search. Leave empty to return only the official LinkedIn employeeCount. NOT a LinkedIn Recruiter boolean string.

## `locations` (type: `array`):

Location labels to AND into the custom filter, such as United States or San Francisco. Human-readable text is preferred for agents. This is not a LinkedIn geo ID field — use whereTheyLive for numeric IDs.

## `functions` (type: `array`):

Job-function labels such as Engineering or Sales. These become extra quoted phrases on the public people search. Use whatTheyDo if you already have LinkedIn function IDs from another tool.

## `skills` (type: `array`):

Skill labels such as Python or Java. Applied only to the public-profile sample, not to LinkedIn Recruiter skill facets.

## `schools` (type: `array`):

School names such as Stanford University. Used as public-search phrases. This is not a private alumni roster.

## `fieldsOfStudy` (type: `array`):

Field-of-study labels such as Computer Science. Combined with other custom filters on the public people search.

## `whereTheyLive` (type: `array`):

Optional LinkedIn geo IDs for compatibility with other headcount tools. Known IDs such as 103644278 (United States) are mapped to labels; unknown IDs are skipped and listed on the row. Prefer the locations text field for new jobs.

## `whatTheyDo` (type: `array`):

Optional LinkedIn function IDs. 8 is Engineering, 25 is Sales, 18 is Operations. Unknown IDs are skipped rather than guessed.

## `whatTheyAreSkilledAt` (type: `array`):

Optional LinkedIn skill IDs. Only a small public map is supported; unmapped IDs are recorded as unresolved. Prefer the skills text field.

## `whereTheyStudied` (type: `array`):

Optional LinkedIn school IDs. Known examples: 2584 Stanford, 3084 Harvard. Unknown IDs are skipped.

## `whatTheyStudied` (type: `array`):

Optional LinkedIn field-of-study IDs. Prefer fieldsOfStudy text labels when the ID map does not contain the value.

## `includeSampleProfiles` (type: `boolean`):

When custom filters are set, attach a small public LinkedIn /in/ sample that matched the filter. Defaults to true. Disable to keep only official employeeCount plus a zero customHeadcount. Sample profiles are not billed separately.

## `maxSampleProfiles` (type: `integer`):

How many matching public profiles to keep when filters are on. Default 10, maximum 50. This caps the customHeadcount sample; it is not a LinkedIn Recruiter census.

## `maxCompanies` (type: `integer`):

Maximum number of company pages to process and bill this run. Default 25. Extra URLs beyond the cap are ignored. Prefill is 1 so quality tests finish quickly.

## `includeSubsidiaries` (type: `boolean`):

Requested for compatibility with other headcount tools. Public cookieless data does not expand a subsidiary graph, so the Actor still counts only the requested company and records a warning. Default false.

## `providerOrder` (type: `string`):

Which public-data provider to try first for the company page and optional people sample. The other provider is the automatic fallback. Keep the default unless you have a reason to prefer SociaVault.

## Actor input object example

```json
{
  "companyUrls": [
    "https://www.linkedin.com/company/apple"
  ],
  "includeSampleProfiles": true,
  "maxSampleProfiles": 5,
  "maxCompanies": 1,
  "includeSubsidiaries": false,
  "providerOrder": "scrapecreators-first"
}
```

# Actor output Schema

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

Dataset items containing company identity, official employeeCount, customHeadcount, countMethod, and optional matching public profiles.

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

Run summary including outcome, foundRows, countsByOutcome, and chargedEventCounts.

## `runSummary` (type: `string`):

Machine-readable RUN\_SUMMARY record for integrations that read RUN\_SUMMARY directly.

# 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 = {
    "companyUrls": [
        "https://www.linkedin.com/company/apple"
    ],
    "includeSampleProfiles": true,
    "maxSampleProfiles": 5,
    "maxCompanies": 1,
    "includeSubsidiaries": false
};

// Run the Actor and wait for it to finish
const run = await client.actor("khadinakbar/linkedin-company-custom-headcount-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 = {
    "companyUrls": ["https://www.linkedin.com/company/apple"],
    "includeSampleProfiles": True,
    "maxSampleProfiles": 5,
    "maxCompanies": 1,
    "includeSubsidiaries": False,
}

# Run the Actor and wait for it to finish
run = client.actor("khadinakbar/linkedin-company-custom-headcount-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 '{
  "companyUrls": [
    "https://www.linkedin.com/company/apple"
  ],
  "includeSampleProfiles": true,
  "maxSampleProfiles": 5,
  "maxCompanies": 1,
  "includeSubsidiaries": false
}' |
apify call khadinakbar/linkedin-company-custom-headcount-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,khadinakbar/linkedin-company-custom-headcount-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/SKieGIBBTTja963EM/builds/mLVhUFGKvNZKPdjr0/openapi.json
