# LinkedIn Related User Scraper (`thenetaji/linkedin-related-user-scraper`) Actor

Extract related LinkedIn profile suggestions from one or more seed profiles, with optional full profile enrichment for each related user.

- **URL**: https://apify.com/thenetaji/linkedin-related-user-scraper.md
- **Developed by:** [The Netaji](https://apify.com/thenetaji) (community)
- **Categories:** Lead generation, Social media, Automation
- **Stats:** 2 total users, 1 monthly users, 70.6% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.50 / 1,000 results

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/platform/actors/running/actors-in-store#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 Related User Scraper

The Actor expands one or more seed LinkedIn profiles into the people LinkedIn displays alongside them — the "More profiles for you" set — and returns one record per related person, deduplicated across seeds. Each record can optionally be enriched with that person's full profile. No LinkedIn account or session cookie is required.

Because the related set is LinkedIn's own association of one member with others, it surfaces people of comparable role, employer, or seniority without requiring a search query to describe them.

### Accepted input

| Field | Type | Default | Description |
|---|---|---|---|
| `username` | array of strings | — | Required. Seed LinkedIn usernames or `/in/` profile URLs. |
| `maxItems` | integer | `100` | Maximum related profiles saved. `0` removes the limit. |
| `enrichProfile` | boolean | `false` | Fetches the full profile for each related person. |

```json
{
  "username": [
    "williamhgates",
    "https://www.linkedin.com/in/satyanadella/"
  ],
  "maxItems": 100,
  "enrichProfile": false
}
```

Seed values may be bare usernames or profile URLs; a URL is reduced to its `/in/` segment before use. Seeds that reduce to the same username are deduplicated before any request is issued.

### Response fields

One record per related person.

| Field | Contents |
|---|---|
| `name` | Name of the related member |
| `headline` | Headline shown in the related list |
| `url` | Profile URL of the related member |
| `username` | Username extracted from that profile URL |
| `source_username` | Seed profile this person was found through |
| `source_name` | Name on the seed profile |
| `source_url` | URL of the seed profile |
| `enriched` | Whether the full profile was fetched |
| `profile` | The complete profile record, present only when enrichment succeeded |

```json
{
  "name": "Satya Nadella",
  "headline": "Chairman and CEO at Microsoft",
  "url": "https://www.linkedin.com/in/satyanadella",
  "username": "satyanadella",
  "source_username": "williamhgates",
  "source_name": "Bill Gates",
  "enriched": false
}
```

The four `source_*` fields make the origin of every row explicit, which matters when several seeds are supplied in one run: two seeds frequently surface the same person, and the retained row records which seed reached them first.

### Deduplication and limits

Related people are deduplicated across the whole run, keyed on username where present and falling back to profile URL, then to the combination of seed and name. A person appearing in the related list of three seeds is therefore saved once, and the `source_*` fields on the saved row name the first seed that reached them.

Each seed contributes as many related profiles as LinkedIn publishes for it, which is a small fixed set rather than an open-ended list. `maxItems` bounds the total across all seeds; increasing it does not cause any individual seed to yield more.

### Behaviour on partial results

Seeds are fetched one request each. A seed that cannot be retrieved — a private, removed, or unreachable profile — is logged as a warning and skipped, and the run proceeds to the next seed. A seed that is retrieved but publishes no related profiles contributes no rows and is not an error.

Enrichment is applied per related person and issues one additional request each. A failed enrichment leaves that row with its list-level fields, `enriched` set to `false`, and no `profile` object; it is not charged, and the run continues.

### Frequently asked questions

**What determines who appears in the related set?**
LinkedIn does. The set is the "More profiles for you" panel rendered on a public profile, and its composition and size are LinkedIn's, not configurable here. It typically favours people sharing an employer, role, or industry with the seed.

**How many related profiles does one seed produce?**
A small fixed number, set by LinkedIn per profile rather than by this Actor. Raising `maxItems` does not increase the yield of a single seed; supplying more seeds is the only way to collect more rows.

**Why are there fewer rows than seeds multiplied by the per-seed count?**
Deduplication. Overlapping seeds — people in the same company or field — surface many of the same individuals, and each is saved once. Heavy overlap is itself a signal that the seeds occupy the same professional cluster.

**What does `enrichProfile` add, and what does it cost?**
It attaches the full profile record under `profile`: headline, location, about, experience, education, and activity. Each related person costs one additional request and one additional billed event. On a run with many seeds this dominates the cost, so a first pass with enrichment off, followed by [LinkedIn Profile Scraper](https://apify.com/thenetaji/linkedin-profile-scraper) over the usernames actually wanted, is usually cheaper.

**How does this differ from the `related_profiles` field on a profile record?**
[LinkedIn Profile Scraper](https://apify.com/thenetaji/linkedin-profile-scraper) returns that list as one nested field on the seed's own record. This Actor expands the list into one row per person, deduplicates across every seed in the run, attributes each row to its source, and can enrich each person. Use that Actor when the seed is the subject; use this one when the related people are.

**Is a LinkedIn account or session cookie required?**
No. Only publicly visible profiles are read, and no credentials or logged-in session are supplied.

### Related Actors

| Actor | Purpose |
|---|---|
| [LinkedIn Profile Scraper](https://apify.com/thenetaji/linkedin-profile-scraper) | Full profile details for a known username or URL |
| [LinkedIn Company Scraper](https://apify.com/thenetaji/linkedin-company-scraper) | Company page details by handle or URL |
| [LinkedIn Post Scraper](https://apify.com/thenetaji/linkedin-post-scraper) | Post, activity, and article details by URL |
| [LinkedIn Jobs Scraper](https://apify.com/thenetaji/linkedin-jobs-scraper) | Job search by keyword and location |

# Actor input Schema

## `username` (type: `array`):

Seed LinkedIn profile usernames or /in/ profile URLs to find related profiles for.

## `maxItems` (type: `integer`):

Maximum number of related profiles to save across all seed profiles. Set 0 for unlimited.

## `enrichProfile` (type: `boolean`):

Fetch the full LinkedIn profile for each related profile and attach it under profile.

## Actor input object example

```json
{
  "username": [
    "satyanadella"
  ],
  "maxItems": 20,
  "enrichProfile": false
}
```

# Actor output Schema

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

All records scraped by this run

# 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 = {
    "username": [
        "satyanadella"
    ],
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("thenetaji/linkedin-related-user-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 = {
    "username": ["satyanadella"],
    "maxItems": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("thenetaji/linkedin-related-user-scraper").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 '{
  "username": [
    "satyanadella"
  ],
  "maxItems": 20
}' |
apify call thenetaji/linkedin-related-user-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/U8aczi6NUO9h3Trzy/builds/4tek5T3WkpfTbA4Bc/openapi.json
