# LinkedIn Network Scraper (`scrapeengine/linkedin-network-scraper`) Actor

- **URL**: https://apify.com/scrapeengine/linkedin-network-scraper.md
- **Developed by:** [ScrapeEngine](https://apify.com/scrapeengine) (community)
- **Categories:** Automation, Lead generation, Social media
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.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 Network Scraper

> Export your LinkedIn 1st‑degree connections in seconds — names, headlines, profile URLs, pictures, and the exact date you connected. Clean JSON / CSV / XLSX, no manual export needed.

---

### ✨ Why Choose Us?

- 🍪 **Just paste your cookie** — no fragile email/password flows.
- 👥 **Bulk accounts supported** — pass multiple `li_at` cookies and the actor processes each account in turn.
- 📅 **Date filters** that actually stop early — only today's connections, or only since `2025‑01‑01`.
- 🛡️ **Smart proxy escalation** — direct first, datacenter on block, residential as last resort (with 3 retries).
- 💾 **Real‑time saving** — every page lands in the dataset immediately, so a hiccup mid‑run still leaves you with results.
- 🪶 **Lightweight** — pure HTTP (no headless browser), runs cheap and fast.

---

### 🚀 Key Features

| Feature | Detail |
|---|---|
| 🔗 1st‑degree export | Pulls *everyone* in your network, newest first |
| 🍪 Bulk cookies | Run multiple accounts in a single job |
| 📅 Date cutoff | `Today only` or `Since YYYY‑MM‑DD` |
| ⏱️ Friendly pacing | Configurable delay + jitter |
| 📦 Page size | 1–40 per request |
| 🛡️ Proxy fallback | none → datacenter → residential (3 retries) |
| 💾 Live dataset push | Partial results never lost |
| 📊 Table view | Pretty Apify Console output with profile pictures |

---

### 🧾 Input

```json
{
  "liAtCookies": [
    "AQEDAUjBCq4FO9swAAAB..."
  ],
  "startingPage": 1,
  "pageSize": 40,
  "maxConnections": 0,
  "waitingTime": 2.0,
  "dateFilterMode": "any",
  "dateLimit": "",
  "proxyConfiguration": { "useApifyProxy": false }
}
````

#### Field reference

| Field | Type | Meaning |
|---|---|---|
| `liAtCookies` | string\[] | One or more LinkedIn `li_at` cookies. Each cookie is one account. **Required.** |
| `startingPage` | integer | Page to start from (1 = newest). Default `1`. |
| `pageSize` | integer | Items per request, 1–40. Default `40`. |
| `maxConnections` | integer | Per‑cookie cap. `0` = no cap. Default `0`. |
| `waitingTime` | number | Base delay (seconds) between pages. Random jitter added in code. Default `2.0`. |
| `dateFilterMode` | enum | `any` / `today` / `sinceDate`. |
| `dateLimit` | string | ISO date (`YYYY‑MM‑DD`). Only used with `sinceDate`. |
| `proxyConfiguration` | object | Apify proxy config. Off by default. |

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

1. Sign in to [linkedin.com](https://www.linkedin.com).
2. Open **DevTools** → **Application** → **Cookies** → `https://www.linkedin.com`.
3. Copy the value of the `li_at` cookie.
4. Paste it into **`liAtCookies`**.

***

### 📤 Output

Each row in the dataset:

```json
{
  "vanityName": "sarafathossen",
  "firstName": "Sarafat",
  "lastName": "Hossen",
  "componentRef": "auto-component-72360a4e-59f5-464a-8206-7e55512cc5fd",
  "connection_date": "Connected on May 10, 2026",
  "formated_connection_date": "2026-05-10",
  "picture": "https://media.licdn.com/dms/image/v2/.../profile.jpg",
  "headline": "MERN Stack Developer | React, Node.js, MongoDB",
  "url": "https://www.linkedin.com/in/sarafathossen"
}
```

| Field | Description |
|---|---|
| `vanityName` | Public profile slug (`linkedin.com/in/<vanityName>`) |
| `firstName` / `lastName` | Display name |
| `componentRef` | Stable per‑row UUID (useful when joining data) |
| `connection_date` | Human‑readable: *"Connected on May 10, 2026"* |
| `formated_connection_date` | ISO date (`YYYY‑MM‑DD`) — easy to sort/filter |
| `picture` | Highest‑resolution profile photo URL (`null` if none) |
| `headline` | The contact's current headline |
| `url` | Full profile URL |

***

### 🚀 How to Use (Apify Console)

1. Log in at [console.apify.com](https://console.apify.com) → **Actors**.
2. Open this actor (**LinkedIn Network Scraper**).
3. Paste your `li_at` cookie in **🍪 LinkedIn li\_at Cookie(s)** (add more for bulk).
4. (Optional) Configure starting page, page size, max items, delay, date filter.
5. Click **Start** ▶️.
6. Watch the live log — connections stream in as they're scraped.
7. Open the **📂 Output** tab to preview / export as **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 '{
       "liAtCookies": ["AQEDAU..."],
       "pageSize": 40,
       "dateFilterMode": "any"
     }'
```

Asynchronous run:

```bash
curl -X POST "https://api.apify.com/v2/acts/<ACTOR_ID>/runs?token=$APIFY_TOKEN" \
     -H "Content-Type: application/json" \
     -d '{"liAtCookies": ["AQEDAU..."]}'
```

***

### 🎯 Best Use Cases

- 📇 **CRM enrichment** — push your network into HubSpot / Salesforce / Notion.
- 📧 **Outbound campaigns** — build segmented lists by headline / connection date.
- 📊 **Reporting** — see who you connected with this week / month / quarter.
- 🧠 **Personal knowledge graph** — back up your network outside LinkedIn.
- 🔍 **Recruiting** — surface relevant contacts by headline keywords.

***

### 💵 Pricing

This actor uses the **Pay‑Per‑Result** model on Apify Store. You only pay for the connections actually saved to your dataset — failed runs and skipped rows are free.

> Tip: lower the **Page Size** or raise the **Delay** if LinkedIn rate‑limits aggressively. Proxy escalation is automatic.

***

### ❓ Frequently Asked Questions

**Q: Do I need to log in via email/password?**
A: No — just paste your `li_at` cookie. It's the only credential the actor needs.

**Q: Is my cookie stored anywhere?**
A: It lives only in your run's input. Apify never logs cookie values in the run log.

**Q: Will this scrape *other people's* networks?**
A: No. LinkedIn's API only returns the connections of the account whose cookie is provided.

**Q: How many connections per minute?**
A: Roughly 40 per request, paced with a random delay (default ~2s). Adjustable.

**Q: What happens if LinkedIn blocks me?**
A: The actor escalates: direct → datacenter proxy → residential proxy (3 retries). It logs the switch transparently.

**Q: Why are some last names empty?**
A: LinkedIn returns `"undefined"` for accounts without a last name set — the actor normalizes this to an empty string (mirrors the source script).

***

### 🆘 Support & Feedback

Have an idea or need a custom version? 📧 **dev.scraperengine@gmail.com**

Found a bug? Open an issue on the actor page and include the run ID — we'll take a look.

***

### ⚖️ Cautions / Legal

- 📜 Use only with **accounts you own or are authorized to scrape**.
- 🛡️ Respect LinkedIn's [Terms of Service](https://www.linkedin.com/legal/user-agreement) and applicable laws (GDPR, CCPA).
- 🤝 The end user is responsible for compliance — please be a good citizen.

# Actor input Schema

## `startingPage` (type: `integer`):

Page number to start from (1 = newest). Useful to resume past a previous run. ⏩

## `waitingTime` (type: `number`):

Base delay between paginated requests. Random jitter is added automatically to look natural. 🧘 Higher = friendlier to LinkedIn.

## `todayDateLimit` (type: `boolean`):

🔘 Toggle ON to keep only connections made **today**. The run stops as soon as it hits an older one.

## `dateLimit` (type: `string`):

Only keep connections made **on or after** this date. ISO format `YYYY-MM-DD`. Leave empty for no date cutoff. ✨

## `liAtCookie` (type: `string`):

🔐 Your LinkedIn **`li_at`** session cookie — required to fetch follower counts via the authenticated Voyager API.

**🧭 How to get it:**

1. 🌐 Open [linkedin.com](https://www.linkedin.com) and sign in
2. 🛠️ Open DevTools (`F12`) → **Application** → **Cookies** → `https://www.linkedin.com`
3. 📋 Copy the **Value** of the cookie named `li_at`
4. 📌 Paste it here

🛡️ *The cookie is masked in the UI and never written to logs.*

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

Optional. ❌ Default: no proxy (direct connection). If LinkedIn rejects the request, the actor automatically tries a datacenter proxy → residential proxy (3 retries) and sticks with it. 🔄

## Actor input object example

```json
{
  "startingPage": 1,
  "waitingTime": 2,
  "todayDateLimit": false,
  "dateLimit": "",
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# 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 = {
    "liAtCookie": "",
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapeengine/linkedin-network-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 = {
    "liAtCookie": "",
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("scrapeengine/linkedin-network-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 '{
  "liAtCookie": "",
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call scrapeengine/linkedin-network-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "LinkedIn Network Scraper",
        "description": null,
        "version": "0.1",
        "x-build-id": "sfhygDNGdb9hWDy8f"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/scrapeengine~linkedin-network-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-scrapeengine-linkedin-network-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/scrapeengine~linkedin-network-scraper/runs": {
            "post": {
                "operationId": "runs-sync-scrapeengine-linkedin-network-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/scrapeengine~linkedin-network-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-scrapeengine-linkedin-network-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": [
                    "liAtCookie"
                ],
                "properties": {
                    "startingPage": {
                        "title": "📄 Starting page",
                        "minimum": 1,
                        "maximum": 1000,
                        "type": "integer",
                        "description": "Page number to start from (1 = newest). Useful to resume past a previous run. ⏩",
                        "default": 1
                    },
                    "waitingTime": {
                        "title": "⏱️ Waiting time between pages (seconds)",
                        "minimum": 0,
                        "maximum": 30,
                        "type": "number",
                        "description": "Base delay between paginated requests. Random jitter is added automatically to look natural. 🧘 Higher = friendlier to LinkedIn.",
                        "default": 2
                    },
                    "todayDateLimit": {
                        "title": "🗓️ Today date limit",
                        "type": "boolean",
                        "description": "🔘 Toggle ON to keep only connections made **today**. The run stops as soon as it hits an older one.",
                        "default": false
                    },
                    "dateLimit": {
                        "title": "📆 Select specific date",
                        "type": "string",
                        "description": "Only keep connections made **on or after** this date. ISO format `YYYY-MM-DD`. Leave empty for no date cutoff. ✨",
                        "default": ""
                    },
                    "liAtCookie": {
                        "title": "🍪 LinkedIn `li_at` Cookie",
                        "type": "string",
                        "description": "🔐 Your LinkedIn **`li_at`** session cookie — required to fetch follower counts via the authenticated Voyager API.\n\n**🧭 How to get it:**\n1. 🌐 Open [linkedin.com](https://www.linkedin.com) and sign in\n2. 🛠️ Open DevTools (`F12`) → **Application** → **Cookies** → `https://www.linkedin.com`\n3. 📋 Copy the **Value** of the cookie named `li_at`\n4. 📌 Paste it here\n\n🛡️ *The cookie is masked in the UI and never written to logs.*"
                    },
                    "proxyConfiguration": {
                        "title": "🛡️ Proxy configuration",
                        "type": "object",
                        "description": "Optional. ❌ Default: no proxy (direct connection). If LinkedIn rejects the request, the actor automatically tries a datacenter proxy → residential proxy (3 retries) and sticks with it. 🔄"
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
