# Linkedin Profile Scraper (`devwithbobby/linkedin-profile-scraper`) Actor

Linkedin User Profile and Company Scraper

- **URL**: https://apify.com/devwithbobby/linkedin-profile-scraper.md
- **Developed by:** [Dev with Bobby](https://apify.com/devwithbobby) (community)
- **Categories:** Automation, Lead generation, Social media
- **Stats:** 21 total users, 0 monthly users, 93.6% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 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.

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 Profile & Company Scraper

Extract public LinkedIn profile and company data with advanced anti-detection measures. Just enter usernames or URLs and get structured data instantly.

### Features

- **Simple Input** - Accepts usernames, full URLs, or mixed formats
- **Profile Data** - Name, headline, location, about, followers, connections, profile picture
- **Company Data** - Name, tagline, about, followers, website
- **Anti-Detection** - Browser fingerprinting, stealth headers, popup dismissal
- **Graceful Degradation** - Returns partial data when full access is blocked

### Usage

#### Input Formats

Enter LinkedIn profiles or companies in any format (one per line or comma-separated):

````

williamhgates
https://www.linkedin.com/in/satyanadella
linkedin.com/company/microsoft

````

#### Input Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `profiles` | String | LinkedIn URLs or usernames (required) |
| `proxyType` | String | Proxy group to use: `BUYPROXIES94952` (Datacenter), `RESIDENTIAL`, or `StaticUS3` |
| `maxConcurrency` | Integer | Parallel pages (1-5, default: 2) |
| `maxRequestsPerMinute` | Integer | Rate limit (5-30, default: 15) |
| `cookies` | String | Optional LinkedIn session cookies as JSON array for authenticated scraping |

#### Authentication (Optional but Recommended)

For higher success rates, provide your LinkedIn session cookies:

1. Log into LinkedIn in your browser
2. Use a browser extension like "Cookie-Editor" to export cookies
3. Paste the JSON array in the `cookies` field

Format:
```json
[
  {"name": "li_at", "value": "YOUR_SESSION_TOKEN", "domain": ".linkedin.com"},
  {"name": "JSESSIONID", "value": "YOUR_JSESSION_ID", "domain": ".linkedin.com"}
]
````

### Output

#### Successful Scrape

```json
{
  "inputUrl": "https://www.linkedin.com/in/williamhgates",
  "scrapedUrl": "https://www.linkedin.com/in/williamhgates",
  "type": "profile",
  "name": "Bill Gates",
  "headline": "Chair, Gates Foundation and Founder, Breakthrough Energy",
  "location": "Seattle, Washington, United States",
  "about": "Chair of the Gates Foundation. Founder of Breakthrough Energy...",
  "followers": 40000000,
  "connections": 8,
  "profilePicture": "https://media.licdn.com/dms/image/...",
  "website": null,
  "industry": "Chair, Gates Foundation and Founder, Breakthrough Energy",
  "scrapedAt": "2026-01-26T08:27:06.315Z",
  "dataSource": "devwithbobby/li-profile-scraper",
  "isPartialData": false
}
```

#### Partial Data (Auth Wall)

When LinkedIn blocks full access, the scraper returns available meta data:

```json
{
  "inputUrl": "https://www.linkedin.com/in/someuser",
  "scrapedUrl": "https://www.linkedin.com/authwall?...",
  "type": "profile",
  "name": "Some User",
  "headline": "Software Engineer at Company",
  "isPartialData": true,
  "scrapedAt": "2026-01-26T08:30:00.000Z"
}
```

### Technical Details

#### Anti-Detection Measures

- **Browser Fingerprinting** - Realistic Chrome/desktop fingerprints via `useFingerprints`
- **Stealth Headers** - Proper `Sec-Ch-Ua`, `Sec-Fetch-*` headers matching real Chrome
- **WebDriver Masking** - Overrides `navigator.webdriver` and other automation indicators
- **Human-like Behavior** - Random delays, scrolling, variable viewport sizes
- **Popup Dismissal** - Automatically closes LinkedIn auth modals and popups

#### Limitations

- **Public profiles only** - Private profiles cannot be scraped without authentication
- **Rate limiting** - LinkedIn may block after many requests from the same IP
- **Auth walls** - Some profiles trigger login requirements regardless of settings

#### Best Practices

1. **Use Residential Proxies** for higher success rates on difficult profiles
2. **Keep concurrency low** (1-2) to avoid triggering rate limits
3. **Provide cookies** for authenticated scraping when possible
4. **Space out runs** to avoid IP-based blocks

### Proxy Options

| Option | Description | Best For |
|--------|-------------|----------|
| `BUYPROXIES94952` | Datacenter proxies (default) | Cost-effective general scraping |
| `RESIDENTIAL` | Residential proxies | Higher success rate, premium |
| `StaticUS3` | Static US IPs | Consistent identity across requests |

### Cost Estimation

- Datacenter proxy: ~$0.25 per 1000 requests
- Residential proxy: ~$12.50 per 1000 requests (higher success rate)
- Compute: ~$0.10 per 100 profiles

### Support

For issues or feature requests, contact the author or open an issue on the actor's page.

# Actor input Schema

## `profiles` (type: `string`):

LinkedIn URLs or usernames (one per line or comma-separated). Examples: williamhgates, https://www.linkedin.com/in/williamhgates, https://www.linkedin.com/company/microsoft

## `proxyType` (type: `string`):

Select the proxy type to use. Datacenter is cost-effective for most scraping.

## `maxConcurrency` (type: `integer`):

Maximum number of parallel pages. Keep low to avoid blocks.

## `maxRequestsPerMinute` (type: `integer`):

Rate limiting.

## `cookies` (type: `string`):

Optional: JSON array of cookies for authenticated scraping.

## Actor input object example

```json
{
  "profiles": "williamhgates",
  "proxyType": "BUYPROXIES94952",
  "maxConcurrency": 2,
  "maxRequestsPerMinute": 15
}
```

# Actor output Schema

## `overview` (type: `string`):

Quick overview of scraped profiles with key metrics

## `detailed` (type: `string`):

Full data for all scraped profiles

## `allData` (type: `string`):

Complete raw JSON data

# 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 = {
    "profiles": "williamhgates"
};

// Run the Actor and wait for it to finish
const run = await client.actor("devwithbobby/linkedin-profile-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 = { "profiles": "williamhgates" }

# Run the Actor and wait for it to finish
run = client.actor("devwithbobby/linkedin-profile-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 '{
  "profiles": "williamhgates"
}' |
apify call devwithbobby/linkedin-profile-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Linkedin Profile Scraper",
        "description": "Linkedin User Profile and Company Scraper",
        "version": "1.0",
        "x-build-id": "o2iVtKEdSx3yuntSV"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/devwithbobby~linkedin-profile-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-devwithbobby-linkedin-profile-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/devwithbobby~linkedin-profile-scraper/runs": {
            "post": {
                "operationId": "runs-sync-devwithbobby-linkedin-profile-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/devwithbobby~linkedin-profile-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-devwithbobby-linkedin-profile-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": [
                    "profiles"
                ],
                "properties": {
                    "profiles": {
                        "title": "LinkedIn Profiles/Companies",
                        "type": "string",
                        "description": "LinkedIn URLs or usernames (one per line or comma-separated). Examples: williamhgates, https://www.linkedin.com/in/williamhgates, https://www.linkedin.com/company/microsoft"
                    },
                    "proxyType": {
                        "title": "Proxy Type",
                        "enum": [
                            "BUYPROXIES94952",
                            "RESIDENTIAL",
                            "StaticUS3"
                        ],
                        "type": "string",
                        "description": "Select the proxy type to use. Datacenter is cost-effective for most scraping.",
                        "default": "BUYPROXIES94952"
                    },
                    "maxConcurrency": {
                        "title": "Max Concurrency",
                        "minimum": 1,
                        "maximum": 5,
                        "type": "integer",
                        "description": "Maximum number of parallel pages. Keep low to avoid blocks.",
                        "default": 2
                    },
                    "maxRequestsPerMinute": {
                        "title": "Max Requests Per Minute",
                        "minimum": 5,
                        "maximum": 30,
                        "type": "integer",
                        "description": "Rate limiting.",
                        "default": 15
                    },
                    "cookies": {
                        "title": "LinkedIn Cookies (Optional)",
                        "type": "string",
                        "description": "Optional: JSON array of cookies for authenticated scraping."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
