# Linkden Scraper (`xyzmahdi420/linkden-scraper`) Actor

A blazing‑fast LinkedIn Scraper that extracts professional data for lead generation, recruitment, and business growth.
Includes a free script for basic scraping and an extended paid version with advanced automation features.

- **URL**: https://apify.com/xyzmahdi420/linkden-scraper.md
- **Developed by:** [Mahdi Hasan](https://apify.com/xyzmahdi420) (community)
- **Categories:** Automation, Lead generation, Social media
- **Stats:** 24 total users, 1 monthly users, 94.7% runs succeeded, 1 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/platform/actors/running/actors-in-store#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 Scraper

Extract comprehensive LinkedIn profile data including experience, education, skills, and contact information in structured JSON format.

### Features ✨

- **Complete Profile Data**: Scrape full names, headlines, locations, about sections, and more
- **Work Experience**: Detailed employment history with company names, roles, dates, and locations
- **Contact Information**: Email addresses and personal websites
- **Network Stats**: Follower counts and connection counts
- **Company Logos**: Direct URLs to company logo images
- **Fast & Reliable**: Optimized scraping with minimal API calls
- **Structured Output**: Clean JSON format ready for analysis or integration

### What You Get 📊

For each LinkedIn profile, the scraper extracts:

#### Basic Information

- Full name (first name + last name)
- Professional headline
- Location (city, country, country code)
- About/bio section
- Profile URL and public identifier
- Premium status
- Creator mode status
- "Open to work" status

#### Contact Details

- Email address (if publicly available)
- Personal websites and social links

#### Network Information

- Total connections
- Follower count

#### Work Experience

For each position:

- Job title
- Company name
- Employment type (Full-time, Part-time, Contract, etc.)
- Work arrangement (Remote, Hybrid, On-site)
- Location
- Start and end dates (with month/year breakdown)
- Duration
- Current position indicator
- Company LinkedIn URL
- Company logo URL
- Company ID

### How to Use 🚀

#### 1. Get Your LinkedIn Cookies

You need valid LinkedIn session cookies to use this scraper:

1. Log into LinkedIn in your browser
2. Open Developer Tools (F12)
3. Go to Application > Cookies > https://www.linkedin.com
4. Copy the entire cookie string or at minimum these two cookies:
   - `li_at` (your session token)
   - `JSESSIONID` (session ID)

**Example cookie format:**

```
li_at=YOUR_TOKEN_HERE; JSESSIONID=ajax:1234567890; bcookie=v=2&abc123...
```

⚠️ **Important**: Keep your cookies private! They provide access to your LinkedIn account.

#### 2. Prepare Profile List

Add the LinkedIn profiles you want to scrape. You can use:

- Usernames: `williamhgates`
- Profile URLs: `https://linkedin.com/in/williamhgates`
- Mix of both

**Example input:**

```json
{
  "profiles": [
    "williamhgates",
    "satyanadella",
    "https://linkedin.com/in/jeff-weiner"
  ],
  "cookies": "li_at=YOUR_COOKIE_HERE; JSESSIONID=ajax:123456789"
}
```

#### 3. Run the Actor

Click "Start" and wait for the scraper to collect all profile data. Results are saved to the dataset in JSON format.

### Output Format 📝

```json
{
  "basic_info": {
    "fullname": "Bill Gates",
    "first_name": "Bill",
    "last_name": "Gates",
    "headline": "Co-chair, Bill & Melinda Gates Foundation",
    "public_identifier": "williamhgates",
    "profile_url": "https://linkedin.com/in/williamhgates",
    "about": "Co-chair of the Bill & Melinda Gates Foundation...",
    "location": {
      "country": "United States",
      "full": "Seattle, Washington, United States",
      "city": "Seattle, Washington",
      "country_code": "US"
    },
    "is_creator": false,
    "is_premium": true,
    "open_to_work": false,
    "is_remembrance": false,
    "urn": "ACoAAAB1234",
    "follower_count": 37500000,
    "connection_count": 500,
    "email": "info@gatesventuresllc.com",
    "websites": [
      "https://www.gatesnotes.com",
      "https://www.gatesfoundation.org"
    ]
  },
  "experience": [
    {
      "title": "Co-chair",
      "company": "Bill & Melinda Gates Foundation",
      "employment_type": "Full-time",
      "location": "Seattle, Washington",
      "work_type": "On-site",
      "duration": "Jan 2000 - Present · 25 yrs",
      "start_date": {
        "year": 2000,
        "month": 1
      },
      "is_current": true,
      "company_linkedin_url": "https://www.linkedin.com/company/bill-&-melinda-gates-foundation",
      "company_logo_url": "https://media.licdn.com/dms/image/.../logo.png",
      "company_id": "12345"
    }
  ],
  "scraped_at": "2024-02-15T10:30:00.000Z",
  "scrape_status": "success"
}
```

### Use Cases 💼

- **Recruitment**: Find and evaluate potential candidates
- **Lead Generation**: Build targeted prospect lists for B2B sales
- **Market Research**: Analyze industry professionals and trends
- **Competitive Intelligence**: Research competitors' team composition
- **Network Analysis**: Study professional networks and connections
- **Data Enrichment**: Enhance CRM records with LinkedIn data
- **Academic Research**: Study career patterns and professional mobility

### Pricing 💰

This actor charges based on compute units used. Typically:

- \~0.001-0.003 compute units per profile
- 1,000 profiles ≈ $0.25-$0.75 USD

Exact cost depends on profile complexity and network conditions.

### Important Notes ⚠️

#### Legal & Ethical Considerations

- **LinkedIn Terms of Service**: Web scraping may violate LinkedIn's Terms of Service. Use at your own risk.
- **Rate Limits**: Don't scrape too aggressively. LinkedIn may block your account.
- **Personal Data**: Respect privacy. Only scrape public information.
- **Cookie Security**: Never share your LinkedIn cookies publicly.
- **Commercial Use**: Check local laws regarding commercial use of scraped data.

#### Best Practices

1. **Start Small**: Test with 5-10 profiles first
2. **Use Proxy**: Consider using Apify proxy to avoid detection
3. **Rotate Cookies**: Use different accounts if scraping large volumes
4. **Respect Privacy**: Only use data ethically and legally
5. **Fresh Cookies**: Cookies expire - update them regularly

#### Limitations

- Requires valid LinkedIn session cookies
- Can only access public profile information
- Cannot scrape profiles you don't have permission to view
- LinkedIn may rate-limit or block suspicious activity
- Skills, education, certifications require additional API calls (coming in v2.0)

### Troubleshooting 🔧

#### "Failed to fetch LinkedIn data"

- Your cookies may have expired - get fresh cookies
- LinkedIn may have detected scraping activity
- Profile may be private or restricted

#### "Could not extract FSD profile ID"

- Profile username may be incorrect
- Profile may not exist
- Cookies may be invalid

#### No email or websites returned

- These fields are only available if the user has made them public
- Check the profile manually to verify visibility

### Support 📧

Need help? Found a bug? Have a feature request?

- Open an issue on GitHub
- Contact us through Apify support
- Check the Apify community forum

### Changelog 📅

#### v1.0.0 (February 2024)

- Initial release
- Extract basic profile information
- Extract work experience with full details
- Contact information scraping
- Company logo URLs

### Roadmap 🗺️

Planned features for future versions:

- Education history
- Skills and endorsements
- Certifications and licenses
- Recommendations
- Publications and patents
- Volunteer experience
- Languages
- Honors and awards

### FAQ ❓

**Q: Is this legal?**
A: Web scraping exists in a legal gray area. LinkedIn's ToS prohibits automated scraping, but public data scraping may be protected in some jurisdictions. Consult a lawyer for your specific use case.

**Q: Can I scrape private profiles?**
A: No, you can only scrape profiles that are publicly visible with your LinkedIn account.

**Q: How do I get more data like education and skills?**
A: These features are coming in version 2.0. Subscribe to updates!

**Q: Can I use this for commercial purposes?**
A: Check your local laws and LinkedIn's ToS. We don't provide legal advice.

**Q: Will this get my LinkedIn account banned?**
A: There's always a risk with scraping. Use responsibly, don't scrape aggressively, and consider using dedicated accounts.

### License 📄

This actor is provided as-is without warranty. Use at your own risk.

***

**Developed with ❤️ for the Apify community**

*Last updated: February 2024*

# Actor input Schema

## `profiles` (type: `array`):

List of LinkedIn profile URLs or usernames to scrape

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

Your LinkedIn session cookies. Required for authentication. Get these from your browser's developer tools (Application > Cookies). Include li\_at and JSESSIONID at minimum.

## Actor input object example

```json
{
  "profiles": [
    "williamhgates",
    "satyanadella",
    "https://linkedin.com/in/jeff-weiner"
  ],
  "cookies": "li_sugr=7348712c-9a42-41dd-a729-9a5804d9ccb6; bcookie='v=2&d2816cc2-dd9e-4bf4-858b-2e1788609db3'; bscookie='v=1&202511180659209a02b0ed-c49a-4397-8a58-ce23c3491a72AQHPECPsY1sD361pirTJaM4MJ_Vl7X0n'; li_gc=MTswOzE3NjU4MjA5OTU7MjswMjH6+tAGXFV3q+UQuJJwElK6gQymKe09njvdTHBhnQ5T6w==; li_rm=AQG8oT1EFjRNwwAAAZs15xP02yOk-WgFtwIl7-NCnag6UH2X2QwniJs9mZNSmb_T6cG8bmWdFVsJAXHYUG51rdV-lU0qa8eIhnbzbo9_xWTh_SLnSSrULsdS; JSESSIONID='ajax:6743718318432579422'; li_theme=light; li_theme_set=app; _guid=14cae7b6-d3e2-4b98-ba2f-e4ffcfa90d5a; dfpfpt=1d9e39af48754befb3fe1a387f686d29; AnalyticsSyncHistory=AQJfmIF6OrV-vQAAAZxddPo5jAHPFTt5ghROjUHIOmh6TkfOiJ2KKEpGGCAflkJnZsbG27-LUZPXLl05pb71wA; g_state={'i_l':0}; lang=v=2&lang=en-us; liap=true; li_at=AQEDAV_ElYwEVBBPAAABnGArpJ0AAAGchDgonU0AwHDqbfrOOMUonGSY20ht4SCVCkdGuHxV2b5274Or2bqWFNCiB4p5805XoCndJ3mHAOPwV81M_G4HZxIFhQQPhVsAkG6ro-0ZzPgDnCUrKCJKwuJ1; sdui_ver=sdui-flagship:0.1.27657+SduiFlagship0; timezone=Asia/Dhaka; fptctx2=taBcrIH61PuCVH7eNCyH0FFaWZWIHTJWSYlBtG47cVvx4mn5Ze8nwAMI3sr%252b6epxEnFdDadVrtc7Vi6jMirAPZWkOcXkleGfMTkTxcWYiP9ruoLGnxZl3s0wQbTvAwaWDOXqa3FjkQO7h4XqHv2wiQRdHFHde84geGZIWleo%252ft%252b99czvvaAyb9ChtdY8AFTN7shDgFJ4HciOYUGmd%252fOI5w5qrotNnFOHIYX7HlZK9XhH9pKigsbfnnXDCbPPyoLUpJ4oZKg2yRXd2g8QfKpntPJMPh4uhWUQnRbzdyxSNfMPMw5aKQtC%252fSpq1YYxYQvmdomaZ%252bw%252biYZpUJNl0c0ZoeqpLRmmuReV7A2e%252bVHkXUc%253d; __cf_bm=3U5i4NbpaMB.MUl0T1eERo4ZgQm115E0phDS8GMz.uA-1771140031-1.0.1.1-DuIA3gAJhvsS2lvtiYXNszk4vOb4u_uHV9ySIzQdGaBMEqGLiPE29IseWQrccCtJJiHwKdkQEahIgHx9WJvOXypm5BkW0OG3hbvsYqeA58g; UserMatchHistory=AQIabLGzmc9TCwAAAZxgLXR8BdjvUjNKGyOrUkqpU6K67HuzKobuN0UCC-Y5zoB6iV4yPqOS_cgndw; lms_ads=AQGhO11nXEZaDgAAAZxgLXW1zB7pgJhb0rowoChvRnbfQPd0hRxyCXPJEzaovEYIzhcdZ4jtGRztDi_7wnBPBWeFUDGcIcd2; lms_analytics=AQGhO11nXEZaDgAAAZxgLXW1zB7pgJhb0rowoChvRnbfQPd0hRxyCXPJEzaovEYIzhcdZ4jtGRztDi_7wnBPBWeFUDGcIcd2; lidc='b=OB60:s=O:r=O:a=O:p=O:g=3736:u=4:x=1:i=1771140118:t=1771177244:v=2:sig=AQHjimxgfWUOmv0cGJWwacT6gXeObG0n'"
}
```

# 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",
        "satyanadella"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("xyzmahdi420/linkden-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",
        "satyanadella",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("xyzmahdi420/linkden-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",
    "satyanadella"
  ]
}' |
apify call xyzmahdi420/linkden-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/qfgWlegxPBPc0NgMH/builds/ddzLhrYJuXzBevMkS/openapi.json
