# Linkedin Profile Scraper (`dead00/linkedin-profile-scrape`) Actor

A LinkedIn profile data scraper that scrapes complete professional profiles including work history, education, skills etc

- **URL**: https://apify.com/dead00/linkedin-profile-scrape.md
- **Developed by:** [Dead](https://apify.com/dead00) (community)
- **Categories:** Developer tools, Automation, Lead generation
- **Stats:** 27 total users, 0 monthly users, 0.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

$23.00/month + usage

To use this Actor, you pay a monthly rental fee to the developer. The rent is subtracted from your prepaid usage every month after the free trial period. You also pay for the Apify platform usage, which gets cheaper the higher Apify subscription plan you have.

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

## 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 Scraper

A robust LinkedIn profile scraper built as an Apify Actor that extracts comprehensive profile information including personal details, work experience, education, skills, and contact information.

### 🚀 Features

- **Complete Profile Data**: Extracts name, headline, summary, location, and profile picture
- **Work Experience**: Detailed job history with titles, companies, descriptions, and dates
- **Education Background**: Academic history including schools, degrees, and fields of study
- **Skills & Endorsements**: Professional skills with endorsement counts
- **Contact Information**: Email, phone, and other contact details (when available)
- **Robust Error Handling**: Graceful handling of missing data and API limitations
- **Clean Data Structure**: Well-formatted JSON output with consistent field names

### 📋 Requirements

- Valid LinkedIn account cookies (specifically `li_at` cookie)
- LinkedIn profile URLs to scrape
- Apify platform account (for deployment)

#### Apify Deployment

1. Upload the code to your Apify Actor
2. Configure the Actor with appropriate memory and timeout settings
3. Test with sample input data

### 📝 Input Configuration

The Actor expects the following input parameters:

```json
{
  "url": "https://www.linkedin.com/in/profile-username",
  "cookies": [
    {
      "name": "li_at",
      "value": "your-li-at-cookie-value",
      "domain": ".linkedin.com",
      "path": "/"
    },
    {
      "name": "JSESSIONID", 
      "value": "your-jsessionid-value",
      "domain": ".linkedin.com",
      "path": "/"
    }
  ],
  "timestamp": "2024-01-15T10:30:00Z"
}
```

#### Required Parameters

- **url** (string): The LinkedIn profile URL to scrape
- **cookies** (array): Array of cookie objects containing authentication data

#### Optional Parameters

- **timestamp** (string): ISO timestamp for when the scraping was initiated

### 🍪 Getting LinkedIn Cookies

⚠️ **Important**: Use only your own LinkedIn account cookies. Scraping other profiles without permission may violate LinkedIn's Terms of Service.

#### Method 1: Browser Developer Tools

1. Log into LinkedIn in your browser
2. Open Developer Tools (F12)
3. Go to Application/Storage tab
4. Navigate to Cookies → https://www.linkedin.com
5. Copy the `li_at` and `JSESSIONID` cookie values

#### Method 2: Browser Extensions

Use cookie export extensions to extract cookies in JSON format.

### 📊 Output Format

The scraper returns structured JSON data:

```json
{
  "firstName": "John",
  "lastName": "Doe", 
  "headline": "Software Engineer at Tech Company",
  "summary": "Experienced software engineer with expertise in...",
  "locationName": "San Francisco, CA",
  "profilePicture": "https://media.licdn.com/...",
  "experiences": [
    {
      "title": "Senior Software Engineer",
      "company": "Tech Company Inc.",
      "location": "San Francisco, CA",
      "description": "Led development of...",
      "start_date": "2022-01",
      "end_date": "2024-01",
      "duration": "2 years"
    }
  ],
  "education": [
    {
      "school": "University Name",
      "degree": "Bachelor of Science",
      "field_of_study": "Computer Science", 
      "start_date": "2018",
      "end_date": "2022",
      "description": "Relevant coursework..."
    }
  ],
  "skills": [
    {
      "name": "Python",
      "endorsements": 25
    }
  ],
  "contact_info": {
    "email": "john.doe@email.com",
    "phone": "+1234567890"
  },
  "scraped_at": "2024-01-15T10:30:00Z"
}
```

### 🔧 Configuration

#### Logging

The scraper includes custom logging configuration:

- **INFO**: General operation information
- **WARNING**: Non-critical issues
- **ERROR**: Critical errors that prevent operation

Apify-specific warnings are filtered out for cleaner logs.

#### Error Handling

- Invalid URLs are handled gracefully
- Missing profile sections don't crash the scraper
- Network errors are logged and reported
- Authentication failures are clearly identified

### 🚨 Usage Guidelines

#### Legal Considerations

- Only scrape profiles you have permission to access
- Respect LinkedIn's Terms of Service and robots.txt
- Use scraped data responsibly and in compliance with privacy laws
- Consider rate limiting to avoid being blocked

#### Best Practices

- Use your own LinkedIn account cookies only
- Don't scrape profiles too frequently
- Store cookies securely and rotate them regularly
- Handle sensitive data (emails, phone numbers) appropriately
- Implement proper data retention policies

### 🐛 Troubleshooting

#### Common Issues

**"li\_at cookie not found"**

- Ensure you've included the li\_at cookie in your cookies array
- Verify the cookie value is correct and not expired

**"Failed to initialize LinkedIn client"**

- Check that all required cookies are provided
- Ensure cookies are in the correct format
- Verify your LinkedIn session is still active

**"Invalid profile URL format"**

- Use the full LinkedIn profile URL
- Supported formats: `/in/username`, `/pub/username`
- Remove any query parameters or tracking codes

**Rate Limiting**

- If you encounter rate limits, reduce scraping frequency
- Use delays between requests
- Consider using different LinkedIn accounts for larger operations

#### Debug Mode

Enable debug logging by modifying the logging level:

```python
logging.basicConfig(level=logging.DEBUG)
```

### 📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

### ⚠️ Disclaimer

This tool is for educational and research purposes. Users are responsible for complying with LinkedIn's Terms of Service and applicable laws. The authors are not responsible for any misuse of this software.

# Actor input Schema

## `url` (type: `array`):

The LinkedIn profile URL to scrape (e.g., https://www.linkedin.com/in/username/)

## `cookies` (type: `array`):

LinkedIn session cookies exported from EditThisCookie extension. Must include li\_at cookie for authentication.

## Actor input object example

```json
{
  "url": [
    "https://www.linkedin.com/in/williamhgates/"
  ],
  "cookies": [
    {
      "domain": ".linkedin.com",
      "expirationDate": 1782315925.766654,
      "hostOnly": false,
      "httpOnly": false,
      "name": "lms_ads",
      "path": "/",
      "sameSite": "no_restriction",
      "secure": true,
      "session": false,
      "storeId": null,
      "value": "AQEPGtuZWmBJeAAAAZ5fz_FsYAk2DQYjjAY0-GU9be6GZwl6ervKLCLLGdtK53-wN0H9uujalTnfv1W7lNqBDLP283kGImj8"
    },
    {
      "domain": ".linkedin.com",
      "expirationDate": 1787499925.430571,
      "hostOnly": false,
      "httpOnly": false,
      "name": "_guid",
      "path": "/",
      "sameSite": "no_restriction",
      "secure": true,
      "session": false,
      "storeId": null,
      "value": "55e35203-7c76-4561-b346-734a5faa6814"
    },
    {
      "domain": ".linkedin.com",
      "expirationDate": 1811259929.254847,
      "hostOnly": false,
      "httpOnly": false,
      "name": "bcookie",
      "path": "/",
      "sameSite": "no_restriction",
      "secure": true,
      "session": false,
      "storeId": null,
      "value": "\"v=2&901a7cb7-73b7-4712-80c5-0ca1200b5fc9\""
    },
    {
      "domain": ".linkedin.com",
      "expirationDate": 1782315925.766914,
      "hostOnly": false,
      "httpOnly": false,
      "name": "lms_analytics",
      "path": "/",
      "sameSite": "no_restriction",
      "secure": true,
      "session": false,
      "storeId": null,
      "value": "AQEPGtuZWmBJeAAAAZ5fz_FsYAk2DQYjjAY0-GU9be6GZwl6ervKLCLLGdtK53-wN0H9uujalTnfv1W7lNqBDLP283kGImj8"
    },
    {
      "domain": ".linkedin.com",
      "hostOnly": false,
      "httpOnly": true,
      "name": "fptctx2",
      "path": "/",
      "sameSite": null,
      "secure": true,
      "session": true,
      "storeId": null,
      "value": "AQEwC3EzABnJGdKHjkPoHaE1akB9kS9uw7C4iKaB2O9%252fCAVnDrjxospvnetp7UUfuKvNeJz8UQC7OED%252fBHHGW%252bUuoEgmdcmw4gAec6B9AL822GygpkxzYZK77qkQ91LA8leVVhIjgsPaLp2q5fKBAef%252bso8KTdCn62c0CmmX8UkD41bWsNQH8NOmHv7wSkL8Q5hhgY5Kid8OQn5hZI9bE7Y4nns41YizoZShDnJD4e5W1kfETOB3d8Za2cVfhnY7RztXBoVpOZlSOTx1Qt7GhSEhHE9o%252bsaoYZPJA14SLneTx5%252b6XaYwS0FgR04yKlGtQ6ptu4dkonBExskyuRs8ovmAEbGy9%252b9sG1sbWs8q2dTkrJFAFD%252f2BATdZNflJyoIC5uPFAB6dU8r3k1RGQIC3qkm"
    },
    {
      "domain": ".www.linkedin.com",
      "expirationDate": 1811259921.07882,
      "hostOnly": false,
      "httpOnly": true,
      "name": "li_at",
      "path": "/",
      "sameSite": "no_restriction",
      "secure": true,
      "session": false,
      "storeId": null,
      "value": "AQEDAVnyITMB2HxEAAABnl_P3wsAAAGeg9xjC04AMC21q8QUFEowHyucw81DlaJLm81Vaww95EbyvJzg2aIbIUWj0E5b7Ztend0pvwDgWkjNf_NOKuD4msV-Eyl6h9jKt4qgqLUy8ht5FrJUNzoF6uJo"
    },
    {
      "domain": ".linkedin.com",
      "hostOnly": false,
      "httpOnly": false,
      "name": "lang",
      "path": "/",
      "sameSite": "no_restriction",
      "secure": true,
      "session": true,
      "storeId": null,
      "value": "v=2&lang=en-us"
    },
    {
      "domain": ".linkedin.com",
      "expirationDate": 1779808707.254995,
      "hostOnly": false,
      "httpOnly": false,
      "name": "lidc",
      "path": "/",
      "sameSite": "no_restriction",
      "secure": true,
      "session": false,
      "storeId": null,
      "value": "\"b=TB35:s=T:r=T:a=T:p=T:g=4349:u=49:x=1:i=1779723925:t=1779808704:v=2:sig=AQHQauNmaFmV2Ihx3arQ9Z1fsN7Apzu_\""
    },
    {
      "domain": ".linkedin.com",
      "expirationDate": 1782315925.322147,
      "hostOnly": false,
      "httpOnly": false,
      "name": "AnalyticsSyncHistory",
      "path": "/",
      "sameSite": "no_restriction",
      "secure": true,
      "session": false,
      "storeId": null,
      "value": "AQKr9D2FboK88gAAAZ5fz--4fyC-6Lkh3tGpk2GaL7SKBfZrw8AlLgAU4I3547wBn_1wgRaUwB7ZkyyiSgJlVw"
    },
    {
      "domain": ".www.linkedin.com",
      "expirationDate": 1811259929.254924,
      "hostOnly": false,
      "httpOnly": true,
      "name": "bscookie",
      "path": "/",
      "sameSite": "no_restriction",
      "secure": true,
      "session": false,
      "storeId": null,
      "value": "\"v=1&202604231759201de6bee3-ae60-4382-8748-8edca7ec361dAQEwSgnFFWu9nt-dC0b8XcY3pLYvQPNK\""
    },
    {
      "domain": ".linkedin.com",
      "expirationDate": 1811259925.733693,
      "hostOnly": false,
      "httpOnly": true,
      "name": "dfpfpt",
      "path": "/",
      "sameSite": null,
      "secure": true,
      "session": false,
      "storeId": null,
      "value": "8227aecdffe14c5abb6fcb7c946176e1"
    },
    {
      "domain": ".www.linkedin.com",
      "hostOnly": false,
      "httpOnly": false,
      "name": "JSESSIONID",
      "path": "/",
      "sameSite": "no_restriction",
      "secure": true,
      "session": true,
      "storeId": null,
      "value": "ajax:2307654763225983374"
    },
    {
      "domain": ".linkedin.com",
      "expirationDate": 1787499926.426292,
      "hostOnly": false,
      "httpOnly": false,
      "name": "li_sugr",
      "path": "/",
      "sameSite": "no_restriction",
      "secure": true,
      "session": false,
      "storeId": null,
      "value": "a51d4753-afe1-45c3-a9c8-a683b9ed2c02"
    },
    {
      "domain": ".www.linkedin.com",
      "expirationDate": 1795275923,
      "hostOnly": false,
      "httpOnly": false,
      "name": "li_theme",
      "path": "/",
      "sameSite": null,
      "secure": true,
      "session": false,
      "storeId": null,
      "value": "light"
    },
    {
      "domain": ".www.linkedin.com",
      "expirationDate": 1795275923,
      "hostOnly": false,
      "httpOnly": false,
      "name": "li_theme_set",
      "path": "/",
      "sameSite": null,
      "secure": true,
      "session": false,
      "storeId": null,
      "value": "app"
    },
    {
      "domain": ".www.linkedin.com",
      "expirationDate": 1780933523,
      "hostOnly": false,
      "httpOnly": false,
      "name": "timezone",
      "path": "/",
      "sameSite": null,
      "secure": true,
      "session": false,
      "storeId": null,
      "value": "Asia/Calcutta"
    },
    {
      "domain": ".linkedin.com",
      "expirationDate": 1782315925.322052,
      "hostOnly": false,
      "httpOnly": false,
      "name": "UserMatchHistory",
      "path": "/",
      "sameSite": "no_restriction",
      "secure": true,
      "session": false,
      "storeId": null,
      "value": "AQKIwY7eaZGYfgAAAZ5fz--4KJuW--xvlVRwlfMMjMcTSjU-ZLWtdG2JVIujkszFKc-4WjeSPXjsoD_Ckye86FEuysFB7rxWOJymzq2AqKdBPikEfItK9DIXh-xYzYwzHIRFcBsZsylYNEMWLaEIum-xhBgGF4pKNKfelozEmi9QvLxJiCUXcROUdWBjcndm7FzyGGMwEMD5YKIyTkgDFTbl0ftEkjBln4fipJ52FM9StRtTHHm44cUkz1IBAC4XRNjKjqWnUCfcm9cjUgUUBkTIRhY7LeMn1jf6F_3J7sFzPHbHtkKDdygmHAyEw9_kX0TMo8ehZIq8TXMQf6_09v3zJfJ6Or3qspmFZ1GdKm1qXwW-AQ"
    }
  ]
}
```

# 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 = {};

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

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

```

## MCP server setup

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

```

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/v6OGcFzPBvRWqFTug/builds/O5Igthw8SFrTcw3QD/openapi.json
