# Linkedin data scraper ( EVERY-THING ) (`muhammad_usama/linkedin-data-scraper-every-thing`) Actor

This actor can scrape anything from linkedin. Anything includes Person Data, Company Data, Person Posts, Company Posts, Search Jobs, Search People, Search Companies, Search Posts and much more. Cannot afford pricing? Contact us, we'll discuss a better pricing.

- **URL**: https://apify.com/muhammad_usama/linkedin-data-scraper-every-thing.md
- **Developed by:** [Muhammad Usama](https://apify.com/muhammad_usama) (community)
- **Categories:** Social media, Lead generation
- **Stats:** 1,872 total users, 19 monthly users, 98.9% runs succeeded, 72 bookmarks
- **User rating**: 2.15 out of 5 stars

## Pricing

from $1.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/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 data scraper AIO

This scraper can scrape anything from linkiedn. It has two input variables.

1. endpoint :  Select the endpoint you are interested in. e.g person-scraper
2. body : send the input data in json format. e.g { "url" : "https://www.linkedincom/in/ingmar-klein" }

## List of endpoints

Here is the list of all the endpoints along with the json body they accept (with examples).

### 1.Person Data

```
This endpoint scrapes all public data of a linkedin user
body : {
    "url" : String (url of any linkedin user's person profile)
}

Example 
body : {
    "url" : "https://www.linkedin.com/in/ingmar-klein"
  }
```

### 2.Multiple people data

```
This endpoint can scrape upto 50 people data in one actor run. Try to keep number of urls less tha 25 in each run for maximum performance  
body : {
    "urls" : Array (an array of urls of linkedin user profiles)
}

Example
body : {
    "urls" : [
        "http://www.linkedin.com/in/luke-sharp-b3838719a",
        "http://www.linkedin.com/in/hollie-smith-96ab44b5",
        "http://www.linkedin.com/in/jeannie-wyrick-b4760710a",
        "http://www.linkedin.com/in/rodneydbainjr",
        "http://www.linkedin.com/in/arielschmid",
        "http://www.linkedin.com/in/christopher-ambrose-3248a540",
        "http://www.linkedin.com/in/daniel-schmidt-611b15149",
        "http://www.linkedin.com/in/alexandra-birurakis-326ba692",
        "http://www.linkedin.com/in/paul-tomco-4b9709117",
        "http://www.linkedin.com/in/lindseystevenss"
    ]
}
```

### 3.Company Data

```
This endpoint scrapes a linkedin comapny data.
body : {
    "url" : String (url of any linkedin company's profile)
}

Example
body : {
    "url" : "https://www.linkedin.com/company/huzzle-app"
}
```

### 4.Multiple Companies data

```
This endpoint can scrape 50 linkedin companies data in one go. For best performance, try to keep maximum number of urls in one actor run less than 20.
body : {
    "urls" : Array (an array of urls of linkedin comapnies) 
}

Example
body : {
    "urls" : [
        "http://www.linkedin.com/company/aep-energy",
        "http://www.linkedin.com/company/johnson-&-johnson",
        "http://www.linkedin.com/company/ametek",
        "http://www.linkedin.com/company/insurance-commission-of-the-bahamas",
        "http://www.linkedin.com/company/chs",
        "http://www.linkedin.com/company/vitas-healthcare",
        "http://www.linkedin.com/company/citgo",
        "http://www.linkedin.com/company/mars",
        "http://www.linkedin.com/company/suffolk-construction",
        "http://www.linkedin.com/company/sumitomo-mitsui-banking-corporation",
    ]
}
```

### 5. Person Posts

```
This endpoint scrapes posts posted by a person on linkedin. It takes some optional filters for accurate and organized data.
body : {
    "url" : String (url of the user/person profile),
    "page": Number (a valid number that is greater than 0 and less than total_posts_of_a_person / 20, per page you get 20 posts),
    "paginationToken" : String (for page 1, pass it as empty string "". You'll get paginationToken in response of actor run with page 1. For page 2, send the paginationToken you get from page 1. For page 3 send paginationToken you get from page 2 and so on... )
}

Example 
body : {
    "url" : "https://www.linkedin.com/in/ingmar-klein",
    "page" : 1,
    "paginationToken" : ""
 }

For page 2, simply pass paginationToken you get from first actor run.
```

### 6. Company Posts

```
This endpoint donnot require any paginationToken. Simply pass company url and page number.
body : {
    "url" : String (url of the company),
    "page" : Number (a valid number greater than 0 and less than total_posts_of_the_company / 10. Per page you'll get 10 posts)
}

Example
body : {
    "url" : "https://www.linkedin.com/company/google",
    "page" : 2
} 
```

### 7. Search Jobs

```
The endpoint searchs jobs as per linkedin search engine. 
body : {
    "query" : String (Search terms),
    "page" : Number (a number between 1-100),
    "searchLocationId" : String --optional (It is an optonal filter. searchLocationId is the ID of the specific location you want to bound results from ( specially a country ). It should be the ID of the location you want results from ( Not the name ) . As per linkedin.com, you can filter this as a search bar side by side of search bar to "query". You can pass only 1 liocation ID per search. If you pass it as empty, location will be selected as worldwide. To get id for searchLocationId using a keywords, run endpoint #18 Suggestio Location),
    "easyApply" : String --optional ( Set "true" if want job apply type to be Easy Apply. Jobs with easyApply true, can be applied for using linkedin.com with 1 click),
    "experience" : String --optional (experience refers to the experience level required for a specific job. It could be one or more of (1,2,3,4,5,6). 1 = Internship, 2 = Entry level, 3 = Associate, 4 = Mid senior level, 5=Director, 6=Executive. For eaxmple experience=2,5 means experience=Entry level,Director),
    "jobType" : String --optional (Linkedin Job Type filter. It could be one or more of F,P,C,T,V,I,O. F=Full time, P=Part time, C=Contract, T=Temporary, V=Volunteer, I=Internship, O=Other),
    "postedAgo" : String --optional (Time jobs was posted ago. It should be in seconds. e.g postedAgo=3600 means all jobs from past 1 hour and so on),
    "workplaceType" : String --optional (It could be one or more of 1,2,3. 1=On-Site, 2=Remote, 3=Hybrid)
    "sortBy" : String --optional (Could be either DD ( most recent ) or R ( most relevent )),
    "companyIdsList" : String --optional (List of comapnies id separated by comma. To find a company's id using company url,run actor #3 Company Data. Note : "urn" is the id),
    "industryIdsList" : String --optional (List of industries separated by comma. To find a industry's id using keyword, run endpoint #17 Suggestion Industry. Note : "urn" is the id),
    "functionIdsList" : String --optional (List of funtions separated by comma. To find a funtion's id using keyword, run endpoint #16 Suggestion Function . Note : "urn" is the id) 
    "titleIdsList" : String --optional (List of job titles separated by comma. To find a job title's id using keyword, run endpoint #N/A. Note : "urn" is the id),
    "locationIdsList" : String --optional (List of location ids of cities/states of speficed searchLocationId country. To get ids of cities/states using keywords, run endpoint #18 Suggestion Location. Note : "urn" is the id),
}

Example 
body : {
    "query" : "Software engineer",
    "page" : 1
}
```

### 8. Search Posts

```
This endpoint works as per linkedin search engine. It takes some optional filters in order to get accurate results.
body : {
    "query" : String (search term),
    "page" : Number (a number between 1 and 100, per page you'll get 20 posts),
    "sort_by" : String --optional (It can take either of the following values (exclude text in brackets): 1.relevance ( Top match ), 2.date_posted ( Latest )),
    "author_job_title" : String --optional (If you open filters in linkedin seach engine search posts section, you will see Author Keywords input at the bottom. It actually takes a rough text value matching job title of the author. ( You can pass author job title as rough text e.g CEO )),
    "content_type" : String --optional (Type of content post must contain. Could of either of the following : 1.photos, 2.videos, 3.liveVideos, 4.collaborativeArticles, 5.documents),
    "from_member" : String --optional (Person who posted the post. It should be the urn of the person. To get urn of a person using his linkedin profile link, run endpoint #1 Person Data . For multiple values, separate values with comma. Person URN looks like this : ACoAACeIPPkBUymOGNvgfbBL_uhKc32Hg_g_haU),
    "from_organization" : String --optional (Organization who posted the post. It should be the id of the oganization/company. To get id of an oganization/company using his linkedin profile link, Run endpoint #3 Company Data. For multiple values, separate values with comma. Organization ID is a numerical value looks like this : 1441),
    "author_company" : String --optional (Id of the company the author of post works in. To get comapny ID from company profile link, run endpoint #3 Company Data. For multiple values, separate them with comma),
    "author_industry" : String --optional (Urn of the industry, author is connected with. To get URN of a industry, run actor #17 Suggestion Industry. For multiple values, separate them with comma),
    "mentions_member" : String --optional (URN of the person who is mentioned in the post. If you apply this filter, only those posts will be returned in which specified person is mentioned. To get person URN from his public profile, run endpoint #1 Person Data. For multiple values, separate them with comma),
    "mentions_organization" : String --optional (ID of the organization who is mentioned in the post. If you apply this filter, only those posts will be returned in which specified organization is mentioned. To get organization ID from his public profile, run endpoint #3 Company Data. For multiple values, separate them with comma)
}

Example 
body : {
    "query" : "Top 10",
    "page" : 1
}
```

### 9. Search People

```
This endpoint works as per linkedin search engine. It may return return results with name : "Linkedin Memeber" & navigationUrl : null. THis is because some profiles are out of our scraping accounts network and are hidden by linkedin.

body : {
    "query" : String (search term)
    "page" : Number (any number between 1 and 100 per page you will get 10 people),
    "title_free_text": --optional (If you open linkedin search engine to search people and open up filters, you will see 5 input bars at the bottom. "title_free_text" represents "Title"),
    "company_free_text": String --optional (If you open linkedin search engine to search people and open up filters, you will see 5 input bars at the bottom. "company_free_text" represents "Company"),
    "first_name": String --optional (If you open linkedin search engine to search people and open up filters, you will see 5 input bars at the bottom. "first_name" represents "First Name"),
    "last_name": String --optional (If you open linkedin search engine to search people and open up filters, you will see 5 input bars at the bottom. "last_name" represents "Last Name"),
    "school_free_text": String --option (If you open linkedin search engine to search people and open up filters, you will see 5 input bars at the bottom. "school_free_text" represents "School"),
    "current_company_list": String --optional (ids of the comapnies to filter results from separated by comma. To get id of a company using url, run endpoint #3 Company Data),
    "past_company_list":  String --optional (ids of the comapnies people used to work in, separated by comma. To get id of a company using url, run endpoint #3 Company Data),
    "location_list": String --optional (ids of the locations to filter resutls from, to get id of a location run endpoint #18 Suggestion Location),
    "language_list": String --optional (ids of the languges people speak, separated by comma. To get id of a language, run endpoint #N/A),
    "service_catagory_list": String --optional (ids of service catagories separated  by comma. To get service catagory id from keyword, run endpoint #20 ),
    "industry_list": String --optional (ids of industries separated  by comma. To get industry id from keyword, run endpoint #17 ),
    "school_list": String --optional (ids of schools separated  by comma. To get school id from keyword, run endpoint #19 )
}

Example 
body : {
    "query" : "Ingmar",
    "page" : 1
}
```

### 10. Search Company

```
This endpoint gets company results as per linkedin search engine.
body : {
    "query": String (Search term),
    "page": Number (any number between 1-100, per page you will get 10 resuts),
    "company_size_list": String --optional (could be 1 or more of the following (Note : for multiple values separte by comma. Ignore text in brackets): 1.B (1-10 employees), 2.C (11-50 employees), 3.D (51-200 employees), 4.E (201-500 employees), 5.F (501-1000 employees), 6.G (1001-5000 employees), 7.H (50001-10000 employees), 8.I (10000+ employees), ),
    "hasJobs": Boolean --optional (could be true or false),
    "location_list": String --optional (ids of locations separated  by comma. To get location id from keyword, run endpoint #18 ),
    "industry_list": String --optional (ids of industries separated  by comma. To get industry id from keyword, run endpoint #17 )
}

Example 
body : {
    "query" : "Google",
    "page" : 1
    }
```

### 11. Comments on a post

```
This endpoint scrapes comments on a specific post. 
body : {
    "commentsUrn" : String (You can get commentsUrn using any the following enpoints: #5 Person Posts, #6 Compaany Posts, #8 Search Posts. )
    "page" : Number (a number between 1 and number_of_comments_on_a_post/10, you will get 10 comments per run)
}

Example
body : {
    "commentsUrn" : "urn:li:fsd_socialDetail:(urn:li:activity:7184217964949258241,urn:li:activity:7184217964949258241,urn:li:highlightedReply:-)",
    "page" : 1
}
```

## 12. Reactions on a post

```
This endpoint scrapes reactions on a specific post. 
body : {
    "reactionsUrn" : String (You can get reactionsUrn using any the following enpoints: #5 Person Posts, #6 Compaany Posts, #8 Search Posts. )
    "page" : Number (a number between 1 and number_of_reactions_on_a_post/10, you will get 10 reactions per run)
}

Example
body : {
    "reactionsUrn" : "urn:li:activity:7187125138054610944",
    "page" : 1
}
```

## 13. Shares/reposts of a post

```
This endpoint scrapes shares / reposts data of a specific post. 
body : {
    "repostsUrn" : String (You can get repostsUrn using any the following enpoints: #5 Person Posts, #6 Compaany Posts, #8 Search Posts. )
    "page" : Number (a number between 1 and number_of_shares_of_a_post/10, you will get 10 reposts data per run)
}

Example
body : {
    "respostsUrn" : "urn:li:activity:7187125138054610944",
    "page" : 1
}
```

Below are the suggestion / autocomplete endpoint. These suggestions apear when you are typing in a filter input bar.

### 14. Suggestion Company (autocomplete)

```
This endpoint returns comapny suggestions per query
body : {
    "query" : String (search term)
}     

Example 
body : {
    "query" : "Google"
}
```

### 15. Suggestion person (autocomplete)

```
This endpoint returns person suggestions per query
body : {
    "query" : String (search term)
}     

Example 
body : {
    "query" : "Ingmar"
}
```

### 16. Suggestion FUnction (autocomplete)

```
This endpoint returns job function suggestions per query
body : {
    "query" : String (search term)
}     

Example 
body : {
    "query" : "Ad"
}
```

### 17. Suggestion Industry (autocomplete)

```
This endpoint returns industry suggestions per query
body : {
    "query" : String (search term)
}     

Example 
body : {
    "query" : "Ad"
}
```

### 18. Suggestion Location (autocomplete)

```
This endpoint returns location suggestions per query
body : {
    "query" : String (search term)
}     

Example 
body : {
    "query" : "Austr"
}
```

### 19. Suggestion School (autocomplete)

```
This endpoint returns school suggestions per query
body : {
    "query" : String (search term)
}     

Example 
body : {
    "query" : "University"
}
```

### 20. Suggestion Service Catagory (autocomplete)

```
This endpoint returns service catagory suggestions per query
body : {
    "query" : String (search term)
}     

Example 
body : {
    "query" : "Ad"
}
```

### 21. Company employee count per skill

```
This endpoint returns employee count of a company
body : {
    "url" : String (search term),
    "keywords" : Job title / skill keyword (separate miltiple keywords with comma),
    "skillExplicits" : String (skill code you want to exclude, separate multiple using comma),
}     

Example 
body : {
    "companyUrl" : "https://www.linkedin.com/company/flying-bark-productions", "skillExplicits" : "1840,1455", 
    "keyword" : "java"
}
```

### 22. Post Data

```
This endpoint returns post data using post url
body : {
    "url" : String (post url),
    }     

Example 
body : {
    "url" : "https://www.linkedin.com/feed/update/urn:li:activity:7219434359085252608"
}
```

Thats it, run the actor and do your stuff with outcome.

If you think something is missing in our actor, please open a new discussion with suitable title and we will add that up ASAP.

Thats it, run the actor and do your stuff with outcome.

If you think something is missing in our actor, please open a new discussion with suitable title and we will add that up ASAP.

# Actor input Schema

## `endpoint` (type: `string`):

Select the endpoint.

## `body` (type: `object`):

Feed body as json object according to selected endpoint.

## Actor input object example

```json
{
  "endpoint": "person-scraper",
  "body": {
    "url": "https://www.linkedin.com/in/ingmar-klein"
  }
}
```

# 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 = {
    "body": {
        "url": "https://www.linkedin.com/in/ingmar-klein"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("muhammad_usama/linkedin-data-scraper-every-thing").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 = { "body": { "url": "https://www.linkedin.com/in/ingmar-klein" } }

# Run the Actor and wait for it to finish
run = client.actor("muhammad_usama/linkedin-data-scraper-every-thing").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 '{
  "body": {
    "url": "https://www.linkedin.com/in/ingmar-klein"
  }
}' |
apify call muhammad_usama/linkedin-data-scraper-every-thing --silent --output-dataset

```

## MCP server setup

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

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/wqOnw5N2iEVIijAvo/builds/w44gl916xbJQjF88J/openapi.json
