# 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:** 20 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## 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 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(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "profiles": "williamhgates"
}' |
apify call devwithbobby/linkedin-profile-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,devwithbobby/linkedin-profile-scraper"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/9ehCeCmLXEy3wQ8dB/builds/o2iVtKEdSx3yuntSV/openapi.json
