# LinkedIn Shared & Mutual Connections Scraper (`simpleapi/linkedin-shared-mutual-connections-scraper`) Actor

🔍 LinkedIn Shared & Mutual Connections Scraper extracts shared & mutual connection data to fuel smarter lead gen and networking. ⚡ Fast, targeted insights for sales, partnerships & recruiting. 📈 Spend less time searching—find warm connections quicker.

- **URL**: https://apify.com/simpleapi/linkedin-shared-mutual-connections-scraper.md
- **Developed by:** [SimpleAPI](https://apify.com/simpleapi) (community)
- **Categories:** Lead generation, Social media, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.99 / 1,000 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/platform/actors/running/actors-in-store#pay-per-event

## 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.md):

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

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.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/platform/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 Shared & Mutual Connections Scraper

Find out **who you both know.** Paste any LinkedIn profile URL (or a whole bulk list) and this Actor returns the **shared / mutual connections** between your account and that profile — names, headlines, locations, degree of connection, and direct profile links — as clean, structured data.

Perfect for **warm-intro prospecting, account-based sales, recruiting, and network mapping.**

---

### ⭐ Why Choose This Actor?

- **🎯 Bulk input** — process dozens of profiles in a single run.
- **🛡️ Smart anti-block ladder** — connects directly first, then transparently escalates to a datacenter proxy, then a sticky residential proxy if LinkedIn pushes back. You see every switch in the log.
- **💾 Live results** — connections are saved the instant they're found, so a long run never loses progress.
- **📂 Per-profile sections** — each profile's connections also land in their own dataset for easy separation.
- **🆕 "Only new" mode** — skip everyone you already pulled in earlier runs.
- **🧹 Clean schema** — output maps 1:1 to a tidy table, ready for CRM import.

---

### ✨ Key Features

| Feature | Description |
|--------|-------------|
| 🎯 Bulk profiles | Submit one or many LinkedIn profile URLs |
| 🌐 Network filter | 1st + 2nd degree, or also 3rd+/out-of-network |
| 🛡️ Proxy fallback | direct → datacenter → residential (sticky) |
| 🔁 Auto-retry | Up to 3 attempts with backoff on blocks/timeouts |
| 📄 Pagination | Walks every result page up to your page limit |
| 💾 Incremental save | Every connection pushed live to the dataset |

---

### 📥 Input

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `urls` | array | ✅ | LinkedIn profile URLs (bulk supported) |
| `li_at` | string (secret) | ✅* | Your `li_at` session cookie value |
| `cookies` | array | ⬜ | Full exported cookie session (overrides `li_at`) |
| `network` | string | ⬜ | `F,S` (1st+2nd) or `F,S,O` (+3rd/out-of-network) |
| `getOnlyNew` | boolean | ⬜ | Return only connections not seen in previous runs |
| `maxPages` | integer | ⬜ | Max result pages per profile (default 10) |
| `requestDelay` | number | ⬜ | Base delay between page requests in seconds |
| `proxyConfiguration` | object | ⬜ | Apify proxy settings (enables the fallback ladder) |

\* Provide **either** `li_at` **or** a `cookies` array containing `li_at`.

#### Example input

```json
{
  "urls": [
    { "url": "https://www.linkedin.com/in/contact-mahfuz/" }
  ],
  "network": "F,S",
  "li_at": "AQEDA...your-session-cookie...",
  "getOnlyNew": false,
  "maxPages": 10,
  "proxyConfiguration": { "useApifyProxy": true }
}
````

#### 🔑 How to get your `li_at` cookie

1. Log into LinkedIn in your browser.
2. Open **DevTools → Application → Cookies → https://www.linkedin.com**.
3. Copy the **value** of the `li_at` cookie.
4. Paste it into the `li_at` field (it is stored as a secret).

***

### 📤 Output

Each row is one mutual connection:

```json
{
  "urn_li_member": "ACoAADMVI0YBVVgJVoOiWFf1CU6b_EQtHVmaiYA",
  "network_distance": "1",
  "full_name": "Raisul Islam",
  "linkedin": "https://www.linkedin.com/in/contact-raisul",
  "is_premium": false,
  "jobtitle": "Designing scalable web data systems...",
  "location": "Chattogram, Chattogram, Bangladesh",
  "mutual_connections_link": "https://www.linkedin.com/search/results/people/?facetNetwork=...",
  "mutual_connections": "",
  "followers": "",
  "source_profile": "https://www.linkedin.com/in/contact-mahfuz/"
}
```

| Field | Description |
|-------|-------------|
| `full_name` | Connection's display name |
| `network_distance` | `1` = 1st, `2` = 2nd, `3` = 3rd degree |
| `jobtitle` | Headline / current role |
| `location` | Location text |
| `linkedin` | Direct profile URL |
| `is_premium` | Whether the profile shows a Premium badge |
| `mutual_connections` | Count text where LinkedIn exposes it |
| `mutual_connections_link` | Canned LinkedIn search for the shared network |
| `urn_li_member` | LinkedIn member URN (`ACoAA...`) |
| `source_profile` | Which input profile this connection came from |

***

### 🚀 How to Use (Apify Console)

1. Log in at [console.apify.com](https://console.apify.com) → **Actors**.
2. Open the **LinkedIn Shared & Mutual Connections Scraper**.
3. Paste your profile URL(s) and your `li_at` cookie.
4. (Optional) Pick the network filter and proxy settings.
5. Click **Start** and watch connections stream into the log in real time.
6. Open the **Output** tab when the run finishes and export to JSON / CSV / XLSX.

### 🤖 Use via API

```bash
curl -X POST "https://api.apify.com/v2/acts/<ACTOR_ID>/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
     -H "Content-Type: application/json" \
     -d '{
       "urls": [{ "url": "https://www.linkedin.com/in/contact-mahfuz/" }],
       "network": "F,S",
       "li_at": "YOUR_COOKIE",
       "proxyConfiguration": { "useApifyProxy": true }
     }'
```

***

### 💡 Best Use Cases

- **Warm-intro sales** — find who can introduce you to a target buyer.
- **Recruiting** — map shared connections to candidates for trusted referrals.
- **Network analysis** — understand overlap between you and key accounts.

***

### 💳 Pricing

This Actor uses the **Pay-Per-Event** model. You are billed per **mutual connection** returned, plus standard Apify platform usage (compute + proxy). The combined dataset is the unit of value — partial runs only bill for what was actually collected.

***

### ❓ FAQ

**Do I need a LinkedIn account?**
Yes. LinkedIn only shows shared connections to authenticated users, so a valid `li_at` cookie from your own account is required.

**Will this get my account banned?**
The Actor warms up like a real browser, throttles requests, and rotates proxies on blocks to stay gentle. Still, scraping always carries some risk — use a sensible `maxPages`, modest run frequency, and reasonable delays.

**Why are some fields empty?**
LinkedIn does not expose every field (e.g. `followers`, exact mutual counts) on every card. Empty strings mean LinkedIn didn't render that value for that result.

**Can I scrape profiles I'm not connected to?**
You can scan the shared connections that your account is permitted to see. Set `network` to `F,S,O` to widen the net to 3rd+/out-of-network where visible.

***

### 🛡️ Compliance & Caution

- Collect data only from sources **you are authorized to access** with your own account.
- You are responsible for compliance with LinkedIn's Terms, GDPR/CCPA, and anti-spam laws.
- Do not use collected data for harassment or unsolicited bulk outreach.

### 📨 Support & Feedback

Found a bug or want a new field? Open an issue on the Actor's **Issues** tab — real answers, fast.

# Actor input Schema

## `urls` (type: `array`):

One or more LinkedIn profile URLs (e.g. https://www.linkedin.com/in/contact-mahfuz/). You can paste a bulk list — every profile will be processed in a single run.

## `network` (type: `string`):

Which network distances to include: 1st + 2nd degree, or also 3rd+/out-of-network.

## `li_at` (type: `string`):

Your LinkedIn `li_at` session cookie value. Required for authenticated search. Find it in your browser DevTools → Application → Cookies → linkedin.com → li\_at. This value is treated as a secret.

## `getOnlyNew` (type: `boolean`):

Skip connections already collected in your previous runs of this actor (de-duplicates across runs).

## `maxPages` (type: `integer`):

Maximum number of search result pages to scan per profile (LinkedIn returns 10 connections per page).

## `proxyConfiguration` (type: `object`):

By default the actor connects directly. If LinkedIn blocks the request it automatically escalates to a datacenter proxy, then a residential proxy (sticky). Enable Apify Proxy to allow these fallbacks.

## Actor input object example

```json
{
  "urls": [
    "https://www.linkedin.com/in/contact-mahfuz/"
  ],
  "network": "F,S",
  "getOnlyNew": false,
  "maxPages": 10,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# 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 = {
    "urls": [
        "https://www.linkedin.com/in/contact-mahfuz/"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("simpleapi/linkedin-shared-mutual-connections-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 = {
    "urls": ["https://www.linkedin.com/in/contact-mahfuz/"],
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("simpleapi/linkedin-shared-mutual-connections-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 '{
  "urls": [
    "https://www.linkedin.com/in/contact-mahfuz/"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call simpleapi/linkedin-shared-mutual-connections-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "LinkedIn Shared & Mutual Connections Scraper",
        "description": "🔍 LinkedIn Shared & Mutual Connections Scraper extracts shared & mutual connection data to fuel smarter lead gen and networking. ⚡ Fast, targeted insights for sales, partnerships & recruiting. 📈 Spend less time searching—find warm connections quicker.",
        "version": "0.1",
        "x-build-id": "oysuOYuo6MfHJOsUO"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/simpleapi~linkedin-shared-mutual-connections-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-simpleapi-linkedin-shared-mutual-connections-scraper",
                "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/simpleapi~linkedin-shared-mutual-connections-scraper/runs": {
            "post": {
                "operationId": "runs-sync-simpleapi-linkedin-shared-mutual-connections-scraper",
                "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/simpleapi~linkedin-shared-mutual-connections-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-simpleapi-linkedin-shared-mutual-connections-scraper",
                "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",
                "required": [
                    "urls"
                ],
                "properties": {
                    "urls": {
                        "title": "🎯 LinkedIn Profile URLs",
                        "type": "array",
                        "description": "One or more LinkedIn profile URLs (e.g. https://www.linkedin.com/in/contact-mahfuz/). You can paste a bulk list — every profile will be processed in a single run.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "network": {
                        "title": "🌐 Connection Network Filter",
                        "enum": [
                            "F,S",
                            "F,S,O"
                        ],
                        "type": "string",
                        "description": "Which network distances to include: 1st + 2nd degree, or also 3rd+/out-of-network.",
                        "default": "F,S"
                    },
                    "li_at": {
                        "title": "🔑 LinkedIn Session Cookie (li_at)",
                        "type": "string",
                        "description": "Your LinkedIn `li_at` session cookie value. Required for authenticated search. Find it in your browser DevTools → Application → Cookies → linkedin.com → li_at. This value is treated as a secret."
                    },
                    "getOnlyNew": {
                        "title": "🆕 Only return NEW connections",
                        "type": "boolean",
                        "description": "Skip connections already collected in your previous runs of this actor (de-duplicates across runs).",
                        "default": false
                    },
                    "maxPages": {
                        "title": "📄 Max pages per profile",
                        "minimum": 1,
                        "maximum": 100,
                        "type": "integer",
                        "description": "Maximum number of search result pages to scan per profile (LinkedIn returns 10 connections per page).",
                        "default": 10
                    },
                    "proxyConfiguration": {
                        "title": "🛡️ Proxy Configuration",
                        "type": "object",
                        "description": "By default the actor connects directly. If LinkedIn blocks the request it automatically escalates to a datacenter proxy, then a residential proxy (sticky). Enable Apify Proxy to allow these fallbacks.",
                        "default": {
                            "useApifyProxy": true
                        }
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
