# LinkedIn Profile Scraper (`alpha-scraper/linkedin-profile-scraper`) Actor

LinkedIn Profile Scraper extracts public data from LinkedIn profiles and company pages. Get names, headlines, experience, education, skills, certifications, followers, plus company size, headquarters and website. Export to JSON, CSV or Excel for recruiting and sales prospecting.

- **URL**: https://apify.com/alpha-scraper/linkedin-profile-scraper.md
- **Developed by:** [Alpha Scraper](https://apify.com/alpha-scraper) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.50 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

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

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

### LinkedIn Profile Scraper

LinkedIn Profile Scraper turns public LinkedIn profile and company page URLs into structured data. Add profile links, company links or plain usernames, and the Actor returns one dataset item per entry with names, headlines, experience, education, skills, follower counts and company details.

It reads only what LinkedIn shows publicly, so you do not need a LinkedIn account, cookies or login. LinkedIn Profile Scraper is built for recruiters, sales teams, researchers and developers who need profile data in a clean format instead of copying it page by page.

LinkedIn profiles and companies can be mixed in the same run, because the Actor detects each page type automatically. Results export as JSON, CSV or Excel straight from Apify.

> **📌 LinkedIn Profile Scraper at a glance**
>
> - **Platform:** LinkedIn public profile and company pages
> - **Input:** profile URLs, company URLs and/or usernames
> - **Output:** one dataset item per input entry
> - **Login required:** no

### 🔹 LinkedIn Profile Scraper – Key Features

LinkedIn Profile Scraper keeps the input flexible and the output predictable:

- **Profiles and companies together** – paste person and company links in one list and let the Actor sort them out.
- **Usernames supported** – enter a LinkedIn username such as `williamhgates` instead of a full URL.
- **Custom IDs** – attach your own `id` to any LinkedIn URL so results match your records.
- **Rich LinkedIn profile data** – name, headline, summary, location, experience, education, skills, certifications and languages.
- **LinkedIn company data** – tagline, description, headquarters, founded year, specialities and follower count.
- **Duplicate handling** – a LinkedIn page listed twice is fetched once, and you still get one result for each entry.
- **Automatic retries** – a blocked request is retried up to 3 times before that LinkedIn URL is skipped.
- **Flexible export** – download LinkedIn data as JSON, CSV or Excel, or read it through the Apify API.

### 📊 LinkedIn Profile Scraper – What Data You Can Extract

LinkedIn Profile Scraper returns one of two record types, depending on the page. Missing values appear as empty fields or "N/A".

**Person profile fields**

| Group | Fields |
|---|---|
| Identity | `full_name`, `first_name`, `last_name`, `headline`, `summary` |
| Location | `country`, `city` |
| Background | `experiences`, `education`, `skills`, `certifications`, `languages` |
| Audience | `follower_count` |
| Images | `profile_pic_url`, `background_cover_image_url` |
| Current employer | `company_name`, `company_linkedin`, `company_industry`, `company_website`, `company_size` |
| Reference | `public_identifier`, `url`, `id` |

**Company page fields**

| Group | Fields |
|---|---|
| Identity | `name`, `tagline`, `description`, `founded_year` |
| Location | `hq` (city, state, country, address line, postal code) |
| Size and reach | `company_size`, `follower_count` |
| Links and images | `website`, `profile_pic_url`, `background_cover_image_url` |
| Details | `specialities`, `linkedin_internal_id` |
| Reference | `url`, `id` |

LinkedIn Profile Scraper keeps person and company records distinct, so you can load LinkedIn profiles and LinkedIn companies into separate tables.

> **🌟 Why use LinkedIn Profile Scraper?**
>
> - **Public data only** – no LinkedIn account to manage and no cookies to refresh.
> - **Mixed input** – LinkedIn profiles, company pages and usernames in a single run.
> - **Predictable output** – the same LinkedIn field names on every run.
> - **Clear costs** – you pay per saved result.

### 🚀 How to Use LinkedIn Profile Scraper

You can run LinkedIn Profile Scraper from the Apify Console in a few minutes:

- **Step 1:** Open the Actor and go to the **Input** tab.
- **Step 2:** Add LinkedIn profile or company URLs under **LinkedIn profile & company URLs**.
- **Step 3:** Optionally add usernames under **Profile usernames**. You need at least one entry in total.
- **Step 4:** Click **Start**. LinkedIn Profile Scraper visits each page and saves a record for it.
- **Step 5:** Open the **Output** tab to preview results and download them in your preferred format.

> **💡 Tip:** Use the full public URL of the profile or company page itself, not a sub-page such as `/details/experience`.

### 🎯 LinkedIn Profile Scraper – Use Cases

LinkedIn Profile Scraper helps wherever a list of LinkedIn pages needs to become a table:

- **Recruiting** – use LinkedIn Profile Scraper to collect headlines, experience and skills for candidates you already found on LinkedIn.
- **Sales prospecting** – use LinkedIn Profile Scraper to enrich a list of prospects with job titles, current employers and company details.
- **Company research** – compare headquarters, size, specialities and follower counts across LinkedIn company pages.
- **CRM enrichment** – let LinkedIn Profile Scraper add LinkedIn data to contacts and match it back with your own `id` values.
- **Market mapping** – build a dataset of companies in an industry from their LinkedIn pages.
- **Academic and trend research** – analyse career paths, education and skills across public LinkedIn profiles.

### 🧩 How LinkedIn Profile Scraper Works

LinkedIn Profile Scraper first validates every entry. URLs must point to LinkedIn profile or company pages, and usernames must have 3 to 100 letters, numbers or hyphens. Invalid entries are skipped and reported in the run log.

Next, the Actor downloads each unique LinkedIn page, detects whether it is a person or a company, and extracts the public details. Records are saved to the dataset in the same order as your input.

LinkedIn Profile Scraper builds a person record from the headline block, about text, experience, education and skills that LinkedIn includes in the public page. A company record uses the overview section, with headquarters, size, founded year and specialities.

If LinkedIn blocks a request, the Actor retries it up to 3 times. A page that still fails is skipped, and the run continues with the next one. Proxy handling is built in, so there is nothing for you to configure.

### 🔎 How to Scrape LinkedIn Profiles From URLs and Usernames

To scrape LinkedIn profiles and companies in one run, combine URLs and usernames as shown below. The optional `id` comes back unchanged in the output.

```json
{
  "startUrls": [
    { "url": "https://www.linkedin.com/in/williamhgates", "id": "lead-001" },
    { "url": "https://www.linkedin.com/company/microsoft" }
  ],
  "profileUsernames": ["tammyfarleyrmg"]
}
```

Without a custom `id`, the output `id` is the entry's position in the list. Usernames are numbered after all URLs, so with two URLs the first username gets id 3.

### ⚙️ LinkedIn Profile Scraper – Input

LinkedIn Profile Scraper has two input fields. Provide at least one of them, or the run stops with an error.

| Field | Type | What it does |
|---|---|---|
| `startUrls` | array | LinkedIn profile and company URLs. Each entry can be a plain URL or an object with `url` and an optional `id`. |
| `profileUsernames` | array | Usernames of person profiles, which are the last part of a profile URL. |

Usernames accept a leading `@`, and a pasted profile URL is reduced to its username. A profile listed as a URL and as a username is fetched once, but you still receive one result for each entry. Entries that only link to a remote file of URLs are not expanded.

> **⚠️ Good to know:** Only information that LinkedIn shows publicly can be returned, so some fields may be empty or "N/A". Company pages need `/company/` in the URL, and usernames work for person profiles only.

### 📦 LinkedIn Profile Scraper – Output

LinkedIn Profile Scraper saves one record per entry to the default dataset. When you submit both profiles and companies, they share one dataset. Person records have a `full_name` field and company records have a `name` field, which makes them easy to separate. Here is a shortened person example:

```json
{
  "full_name": "Jane Example",
  "first_name": "Jane",
  "last_name": "Example",
  "headline": "Product Manager at Example Corp",
  "summary": "Product leader with a focus on data tools...",
  "country": "United States of America",
  "city": "Seattle",
  "follower_count": 1800,
  "public_identifier": "jane-example",
  "skills": ["Product Management", "Analytics"],
  "certifications": [],
  "languages": ["English"],
  "experiences": [
    {
      "title": "Product Manager",
      "company": "Example Corp",
      "company_linkedin_profile_url": "https://www.linkedin.com/company/example-corp",
      "starts_at": "2021"
    }
  ],
  "education": [
    {
      "school": "Example University",
      "school_linkedin_profile_url": "N/A",
      "starts_at": "2012",
      "ends_at": "2016"
    }
  ],
  "company_name": "Example Corp",
  "company_industry": "Software Development",
  "company_size": "1,001-5,000",
  "url": "https://www.linkedin.com/in/jane-example",
  "id": "1"
}
```

And a shortened company example:

```json
[
  {
    "full_name": "Bill Gates",
    "first_name": "Bill",
    "last_name": "Gates",
    "headline": "Chair, Gates Foundation and Founder, Breakthrough Energy",
    "summary": "Chair of the Gates Foundation. Founder of Breakthrough Energy. Co-founder of Microsoft. Voracious reader. Avid traveler. Active blogger.",
    "country": "United States of America",
    "city": "Seattle",
    "profile_pic_url": "https://media.licdn.com/dms/image/v2/D5603AQF-RYZP55jmXA/profile-displayphoto-shrink_200_200/B56ZRi8g.aGsAY-/0/1736826818802?e=2147483647&v=beta&t=bKWfN6UwwtiCqFWsG7rBELbd48qJOAMLdxhBzzkJV0k",
    "follower_count": 40753937,
    "public_identifier": "williamhgates",
    "open_to_work": false,
    "show_verification_badge": false,
    "skills": [],
    "certifications": [],
    "experiences": [
      {
        "title": "Co-chair",
        "company": "Gates Foundation",
        "company_linkedin_profile_url": "https://www.linkedin.com/company/gates-foundation",
        "starts_at": "2000"
      },
      {
        "title": "Founder",
        "company": "Breakthrough Energy",
        "company_linkedin_profile_url": "https://www.linkedin.com/company/breakthrough-energy",
        "starts_at": "2015"
      },
      {
        "title": "Co-founder",
        "company": "Microsoft",
        "company_linkedin_profile_url": "https://www.linkedin.com/company/microsoft",
        "starts_at": "1975"
      }
    ],
    "education": [
      {
        "school": "Harvard University",
        "school_linkedin_profile_url": "https://www.linkedin.com/school/harvard-university",
        "starts_at": "1973",
        "ends_at": "1975"
      },
      {
        "school": "Lakeside School",
        "school_linkedin_profile_url": "https://www.linkedin.com/school/lakeside-school",
        "starts_at": null,
        "ends_at": null
      }
    ],
    "background_cover_image_url": "https://media.licdn.com/dms/image/v2/D5616AQEjhPbTCeblYg/profile-displaybackgroundimage-shrink_200_800/B56ZcytR5SGsAc-/0/1748902420393?e=2147483647&v=beta&t=a-tBeZkxzWTHWYY6MAjxt0oTEuxlW33EUkK3gm5_te4",
    "languages": [],
    "personal_emails": [],
    "personal_numbers": [],
    "company_name": "Gates Foundation",
    "company_industry": "N/A",
    "company_website": "https://www.linkedin.com/company/gates-foundation",
    "company_linkedin": "https://www.linkedin.com/company/gates-foundation",
    "company_size": "N/A",
    "url": "https://www.linkedin.com/in/williamhgates",
    "id": "1"
  },
  {
    "full_name": "Michael Walbert",
    "first_name": "Michael",
    "last_name": "Walbert",
    "headline": "*******",
    "summary": "******* ********* ******** ******** **************** undefined or By clicking Continue to join or sign in, you agree to LinkedIn’s , , and . New to LinkedIn? or By clicking Continue to join or sign in, you agree to LinkedIn’s , , and .",
    "country": "United States of America",
    "city": "Atlanta",
    "profile_pic_url": "https://media.licdn.com/dms/image/v2/C5603AQERgGipQDlptg/profile-displayphoto-shrink_200_200/profile-displayphoto-shrink_200_200/0/1516308864867?e=2147483647&v=beta&t=LYWAcYP2FcB-mFSUp_Ynp-yNengg3zxegXDdoo2euZA",
    "follower_count": 3825,
    "public_identifier": "mikewalbert",
    "open_to_work": false,
    "show_verification_badge": false,
    "skills": [],
    "certifications": [],
    "experiences": [],
    "education": [],
    "background_cover_image_url": "https://media.licdn.com/dms/image/v2/D4E16AQE_SUjytyAuLQ/profile-displaybackgroundimage-shrink_200_800/B4EZqXtWiVHcAU-/0/1763481841729?e=2147483647&v=beta&t=XpxsQb6TssXNEOKL_g4toGXsDgNNVntKVnTx7U3Xa1s",
    "languages": [],
    "personal_emails": [],
    "personal_numbers": [],
    "company_name": "N/A",
    "company_industry": "N/A",
    "company_website": "https://www.linkedin.com/company/atl-branch",
    "company_linkedin": "N/A",
    "company_size": "",
    "url": "https://www.linkedin.com/in/mikewalbert",
    "id": "2"
  },
  {
    "full_name": "Bill Gates",
    "first_name": "Bill",
    "last_name": "Gates",
    "headline": "Chair, Gates Foundation and Founder, Breakthrough Energy",
    "summary": "Chair of the Gates Foundation. Founder of Breakthrough Energy. Co-founder of Microsoft. Voracious reader. Avid traveler. Active blogger.",
    "country": "United States of America",
    "city": "Seattle",
    "profile_pic_url": "https://media.licdn.com/dms/image/v2/D5603AQF-RYZP55jmXA/profile-displayphoto-shrink_200_200/B56ZRi8g.aGsAY-/0/1736826818802?e=2147483647&v=beta&t=bKWfN6UwwtiCqFWsG7rBELbd48qJOAMLdxhBzzkJV0k",
    "follower_count": 40753937,
    "public_identifier": "williamhgates",
    "open_to_work": false,
    "show_verification_badge": false,
    "skills": [],
    "certifications": [],
    "experiences": [
      {
        "title": "Co-chair",
        "company": "Gates Foundation",
        "company_linkedin_profile_url": "https://www.linkedin.com/company/gates-foundation",
        "starts_at": "2000"
      },
      {
        "title": "Founder",
        "company": "Breakthrough Energy",
        "company_linkedin_profile_url": "https://www.linkedin.com/company/breakthrough-energy",
        "starts_at": "2015"
      },
      {
        "title": "Co-founder",
        "company": "Microsoft",
        "company_linkedin_profile_url": "https://www.linkedin.com/company/microsoft",
        "starts_at": "1975"
      }
    ],
    "education": [
      {
        "school": "Harvard University",
        "school_linkedin_profile_url": "https://www.linkedin.com/school/harvard-university",
        "starts_at": "1973",
        "ends_at": "1975"
      },
      {
        "school": "Lakeside School",
        "school_linkedin_profile_url": "https://www.linkedin.com/school/lakeside-school",
        "starts_at": null,
        "ends_at": null
      }
    ],
    "background_cover_image_url": "https://media.licdn.com/dms/image/v2/D5616AQEjhPbTCeblYg/profile-displaybackgroundimage-shrink_200_800/B56ZcytR5SGsAc-/0/1748902420393?e=2147483647&v=beta&t=a-tBeZkxzWTHWYY6MAjxt0oTEuxlW33EUkK3gm5_te4",
    "languages": [],
    "personal_emails": [],
    "personal_numbers": [],
    "company_name": "Gates Foundation",
    "company_industry": "N/A",
    "company_website": "https://www.linkedin.com/company/gates-foundation",
    "company_linkedin": "https://www.linkedin.com/company/gates-foundation",
    "company_size": "N/A",
    "url": "https://www.linkedin.com/in/williamhgates",
    "id": "3"
  },
  {
    "full_name": "Tammy Farley",
    "first_name": "Tammy",
    "last_name": "Farley",
    "headline": "***** *****",
    "summary": "***** ***** ***** ** ********* ** ********* ******* undefined or By clicking Continue to join or sign in, you agree to LinkedIn’s , , and . New to LinkedIn? or By clicking Continue to join or sign in, you agree to LinkedIn’s , , and . “If it weren't for Tammy and her great company, I wouldn't be such a great Revenue Manager.  As a vendor Tammy and her team take such good care of their clients and treat you with the utmost respect.  I've worked with Tammy for almost 6 years and it's been a pleasure!” 1 person has recommended Tammy",
    "country": "United States of America",
    "city": "Alpharetta",
    "profile_pic_url": "https://media.licdn.com/dms/image/v2/C4E03AQFfryfCM5M1pw/profile-displayphoto-shrink_200_200-alternative/profile-displayphoto-shrink_200_200-alternative/0/1529069485486?e=2147483647&v=beta&t=rzipLS-KbCdc42Pv1Tq42kqUeXsUptib3xzBEh7dT-Y",
    "follower_count": 2504,
    "public_identifier": "tammyfarleyrmg",
    "open_to_work": false,
    "show_verification_badge": false,
    "skills": [],
    "certifications": [],
    "experiences": [],
    "education": [],
    "background_cover_image_url": "https://media.licdn.com/dms/image/v2/C5116AQFXp7Xt0v6ARg/profile-displaybackgroundimage-shrink_200_800/profile-displaybackgroundimage-shrink_200_800/0/1516325534025?e=2147483647&v=beta&t=elSip8V4zzaOO1i0YqEKN7D79Z54BY7IjV0LS-WbUvg",
    "languages": [],
    "personal_emails": [],
    "personal_numbers": [],
    "company_name": "N/A",
    "company_industry": "N/A",
    "company_website": "https://www.linkedin.com/company/dress-for-success-georgia",
    "company_linkedin": "N/A",
    "company_size": "",
    "url": "https://www.linkedin.com/in/tammyfarleyrmg",
    "id": "4"
  }
]
```

> **📝 Field notes**
>
> - `personal_emails` and `personal_numbers` are always empty lists. The Actor does not collect contact details.
> - `open_to_work` and `show_verification_badge` are fixed to `false` and are not detected.
> - `company_size` for a company page is a two-number array built from the employee figure shown, or `[0, 0]` when none is shown.
> - The `company_*` fields of a person describe the first employer listed in their experience.

### 💰 LinkedIn Profile Scraper – Pricing

LinkedIn Profile Scraper is billed per result, so each profile or company record saved to the dataset counts toward your cost. The number of entries you submit is your main cost control.

See the Pricing tab on this Actor's page for the current rate. If you set a maximum cost per run in Apify, LinkedIn Profile Scraper stops once that cap is reached and keeps the results collected so far.

### ✅ Tips and Best Practices for LinkedIn Profile Scraper

> **Get cleaner results**
>
> - Run a small batch first to see which fields LinkedIn shows for your targets, since LinkedIn varies by profile.
> - Use the full public LinkedIn URL, without sub-pages or tracking parameters.
> - Add your own `id` values when you need to match results to a CRM or spreadsheet.
> - Check the run log for skipped entries after each run.
> - Split very large LinkedIn lists into several runs so you can check quality early.
> - Schedule LinkedIn Profile Scraper in Apify to refresh a watch-list on a regular basis.

Treat empty or "N/A" values as normal for public pages. LinkedIn Profile Scraper reports what the page shows, and public profiles often hide sections such as skills or certifications.

### ❓ Frequently Asked Questions

#### 🤔 What is LinkedIn Profile Scraper?

LinkedIn Profile Scraper is an Apify Actor that extracts public data from LinkedIn profile and company pages and returns it as structured records.

#### 👥 Who uses LinkedIn Profile Scraper?

Recruiters, sales and marketing teams, analysts, researchers and developers who need LinkedIn profile data in a structured format.

#### 🔐 Can I use LinkedIn Profile Scraper without logging in?

Yes. The Actor collects only what LinkedIn shows to logged-out visitors, so no account, cookies or password are needed.

#### 🔒 Can LinkedIn Profile Scraper scrape private LinkedIn profiles?

No. It returns only information that LinkedIn shows publicly, so hidden sections of a profile stay empty.

#### 🔢 How many profiles can LinkedIn Profile Scraper handle in one run?

The input has no fixed limit. Add as many LinkedIn URLs and usernames as you need, and keep in mind that cost grows with the number of saved results. Start with a small test batch.

#### 🛠️ What happens if a LinkedIn URL is invalid or blocked?

LinkedIn Profile Scraper skips invalid entries and logs the reason. A blocked page is retried up to 3 times and then skipped, while the run continues. If nothing at all can be scraped, the run ends with an error message.

#### 🏢 Can LinkedIn Profile Scraper scrape company pages?

Yes. Add company page URLs, which contain `/company/`. You can mix them with person profiles in one run.

#### 🔤 Can I use usernames instead of URLs?

Yes. Use **Profile usernames** for person profiles. Each username becomes a `linkedin.com/in/<username>` URL.

#### 🆔 How do I match results to my own records?

Give each URL an `id` in the input. LinkedIn Profile Scraper returns that value unchanged in the output, so you can join the results with your CRM or spreadsheet.

#### ✉️ Does LinkedIn Profile Scraper return email addresses or phone numbers?

No. The fields `personal_emails` and `personal_numbers` are returned as empty lists.

#### 🔎 Why are some LinkedIn fields empty or "N/A"?

LinkedIn shows less data to logged-out visitors, and some LinkedIn profiles hide sections. The Actor returns only what is visible.

#### 📁 Can I export LinkedIn Profile Scraper results to Excel or CSV?

Yes. Open the dataset and choose Excel, CSV, JSON or another format, or fetch the data through the Apify API.

#### 🔌 Can I start LinkedIn Profile Scraper through the Apify API?

Yes. Call the Actor with the JSON input shown above and read the dataset when the run finishes.

#### ⚖️ Is it allowed to scrape LinkedIn profile data?

The Actor collects only publicly visible information. Profile data can be personal data, so use it lawfully, respect privacy rules such as GDPR, and follow LinkedIn's terms.

### 📬 Support

Questions, feature requests or a LinkedIn page that does not parse as expected? Share the URL and your run link so the issue with LinkedIn Profile Scraper can be reproduced.

- Contact me by email: alphascraper69@gmail.com

# Actor input Schema

## `startUrls` (type: `array`):

The LinkedIn pages to scrape. Add as many URLs as you need and mix both types in one run:

- Person profile: https://www.linkedin.com/in/williamhgates
- Company page: https://www.linkedin.com/company/microsoft

Use the full public URL (starting with https://) of the profile or company page itself, not a sub-page such as /details/experience, because the last part of the URL is used as the profile's public identifier. Please list the URLs themselves: entries that only link to a remote file of URLs are not expanded by this Actor. Only information LinkedIn shows publicly (without logging in) can be returned, so some fields may be empty or "N/A".

Optional custom ID (JSON or API input): an entry can also be written as {"url": "https://www.linkedin.com/in/williamhgates", "id": "my-id-1"}. The id is returned unchanged in the output "id" field, which makes it easy to match results to your own records. If you leave it out, the id is the entry's position in this list (1, 2, 3, ...), for profiles and company pages alike.

## `profileUsernames` (type: `array`):

Prefer usernames over URLs? Enter the username of each person profile, which is the last part of its URL: for https://www.linkedin.com/in/williamhgates the username is williamhgates. Add as many as you need. Each one is turned into https://www.linkedin.com/in/<username>, so this field is for person profiles only (use the URL field above for company pages).

Usernames can be combined with the URLs above in the same run. A profile listed both ways is fetched only once, but you still get one result for each entry. A username has 3-100 letters, numbers or hyphens; a leading @ is ignored, and a pasted profile URL is reduced to its username. Invalid entries are skipped and reported in the log.

The output "id" of a username is its position counted after all the URLs: with 3 URLs, the first username gets id 4.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.linkedin.com/in/williamhgates"
    },
    {
      "url": "https://www.linkedin.com/in/mikewalbert"
    }
  ],
  "profileUsernames": [
    "williamhgates",
    "tammyfarleyrmg"
  ]
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

# 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 = {
    "startUrls": [
        {
            "url": "https://www.linkedin.com/in/williamhgates"
        },
        {
            "url": "https://www.linkedin.com/in/mikewalbert"
        }
    ],
    "profileUsernames": [
        "williamhgates",
        "tammyfarleyrmg"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("alpha-scraper/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 = {
    "startUrls": [
        { "url": "https://www.linkedin.com/in/williamhgates" },
        { "url": "https://www.linkedin.com/in/mikewalbert" },
    ],
    "profileUsernames": [
        "williamhgates",
        "tammyfarleyrmg",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("alpha-scraper/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 '{
  "startUrls": [
    {
      "url": "https://www.linkedin.com/in/williamhgates"
    },
    {
      "url": "https://www.linkedin.com/in/mikewalbert"
    }
  ],
  "profileUsernames": [
    "williamhgates",
    "tammyfarleyrmg"
  ]
}' |
apify call alpha-scraper/linkedin-profile-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,alpha-scraper/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/gjhfK2L8Qd6G1O5RG/builds/0t4yteQqLDIgs1aT1/openapi.json
