# i n Scraper ⭐ (`jupri/linkedin`) Actor

💼 Scrape Linkedin.com

- **URL**: https://apify.com/jupri/linkedin.md
- **Developed by:** [cat](https://apify.com/jupri) (community)
- **Categories:** Jobs, Social media
- **Stats:** 16 total users, 0 monthly users, 100.0% runs succeeded, 2 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?

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

## Welcome to LinkedIn Scraper

![don't be sad readme is here](https://raw.githubusercontent.com/JupriGH/resources/main/cats/catframe.png)

### About LinkedIn.com

<img height="128" src="https://upload.wikimedia.org/wikipedia/commons/a/aa/LinkedIn_2021.svg">

**LinkedIn**  ([/lɪŋktˈɪn/](https://en.wikipedia.org/wiki/Help:IPA/English "Help:IPA/English")) is a business and employment-focused  [social media platform](https://en.wikipedia.org/wiki/Social_media_platform "Social media platform")  that works through websites and mobile apps. It was launched on May 5, 2003 by  [Reid Hoffman](https://en.wikipedia.org/wiki/Reid_Hoffman "Reid Hoffman")  and  [Eric Ly](https://en.wikipedia.org/wiki/Eric_Ly "Eric Ly").[\[6\]](https://en.wikipedia.org/wiki/LinkedIn#cite_note-about-6)  Since December 2016, LinkedIn has been a wholly owned subsidiary of  [Microsoft](https://en.wikipedia.org/wiki/Microsoft "Microsoft").[\[7\]](https://en.wikipedia.org/wiki/LinkedIn#cite_note-7)  The platform is primarily used for professional networking and career development, and allows jobseekers to post their  [CVs](https://en.wikipedia.org/wiki/Curriculum_vitae "Curriculum vitae")  and employers to post jobs. From 2015, most of the company's revenue came from  [selling access to information about its members](https://en.wikipedia.org/wiki/Information_broker "Information broker")  to recruiters and sales professionals.[\[8\]](https://en.wikipedia.org/wiki/LinkedIn#cite_note-8)  LinkedIn has more than 1 billion registered members from over 200 countries and territories.[\[9\]](https://en.wikipedia.org/wiki/LinkedIn#cite_note-9)

LinkedIn allows members (both workers and employers) to create profiles and connect with each other in an online social network which may represent real-world professional relationships. Members can invite anyone (whether an existing member or not) to become a connection. LinkedIn can also be used to organize offline events, join groups, write articles, publish job postings, post photos and videos, and more.[\[10\]](https://en.wikipedia.org/wiki/LinkedIn#cite_note-Help.linkedin.com-10)

### 📎About This Actor

<img width="240" src="https://www.healthprochiro.com/wp-content/uploads/2022/09/under-const.jpg">

### 📎Required `COOKIES`

#### *👉 Google Chrome*

1. Login to **Linkein.com**
2. Open Chrome Developer Tools *(Ctrl + Shift + I)*
3. Open **Application** Tab
4. On left panel, go to: `Storage > Cookies > https://www.linkedin.com`
5. Find cookie named **`li_at`**
6. Copy & paste in:  **`☢️ Advanced Options > HTTP Cookies`**

#### 👉 Example `INPUT` with `Cookies`

```yaml
{
	"query": [ ... ],
	"limit": 10,
    "dev_custom_cookies": [
        { "key": "li_at", 	"value": "XXXXXXXXXXXXXXXXXXXXXX" }
    ]
}
```

### 📎Tutorial

#### 👉 Basic Usage

#### 👉 LinkedIn Query Language (LQL)

```html
[ <COMMAND>: | # | @ ] [ <NAME> | <ID> | <KEYWORD> | <URL> ] [ /<SECTION> ]  
```

#### 👉 Possible `Query` Values

| Format | Examples | Description |
|-|-|-|
| **@<*USER*>** | `@williamhgates` | ***User Data*** |
| `/info` | `@williamhgates/info` | User info |
| `/posts` | `@williamhgates/posts` | User posts |
| `/comments` | `@williamhgates/comments` | User comments |
| `/reactions` | `@williamhgates/reactions` | User reactions |
| `/images` | `@williamhgates/images` | User images |
| `/videos` | `@williamhgates/videos` | User videos |
| `/documents` | `@williamhgates/documents` | User documents |
| `/articles` | `@williamhgates/articles` | User articles |
| `/newsletter` | `@williamhgates/newsletter` | User newsletters |
| **https:<*URL*>** | `https://www.linkedin.com/...` | ***Start URL*** |

### 📎Input Examples

### 📎Output Examples

### 📎Support

<img height="240" src="https://media.tenor.com/M5SonVIGcOMAAAAe/rascal-almost-there.png">

# Actor input Schema

## `query` (type: `array`):

💡 Search Terms, Query or URL

## `limit` (type: `integer`):

💡 Number of results (per-query)

## `dev_proxy_config` (type: `object`):

💡 <b>Supported protocol:</b><br><br><b>HTTP(S), SOCKS5</b><br><code>{http|socks5}://{user:pass}@{hostname|ip-address}:port</code><br><br><b>Example</b>: <code>socks5://example.com:9000</code>

## `dev_custom_headers` (type: `array`):

💡 Additional HTTP Headers

## `dev_custom_cookies` (type: `array`):

💡 Additional HTTP Cookies

## `dev_transform_fields` (type: `array`):

💡 <b>Transform the resulting output. Select only needed fields.</b><br><br>For nested object use <b>DOT</b>. For example: <pre>address.streetAddress</pre><br>For nested array use <b>NUMBER</b> <i>(index of array element starting from index=0)</i>. For example: <pre>images.0.url</pre>

## `dev_dataset_name` (type: `string`):

💡 <b>Save results into custom named Dataset, use mask to customize dataset name</b><br><br><code>{ACTOR} = actor name<br>{DATE} = date (YYYYMMDD)<br>{TIME} = time (HHMMSS)</code><br><br>This masks can be used to autogenerate Dataset Name.<br><br>example: <i><code>data-{DATE}</code></i><br>Depending on today date the dataset name will be: <code>data-20230603</code><i><br><br>default: <code>data-{ACTOR}-{DATE}-{TIME}</code></i>

## `dev_dataset_clear` (type: `boolean`):

Clear Dataset before insert/update.

## `dev_no_strip` (type: `boolean`):

💡 Keep/Save empty values <i><code>(NULL, FALSE, empty ARRAY, empty OBJECT, empty STRING)</code></i>

## Actor input object example

```json
{
  "query": [
    "https://www.linkedin.com/in/williamhgates/",
    "@williamhgates/videos"
  ],
  "limit": 5,
  "dev_custom_cookies": [
    {
      "key": "li_at",
      "value": ""
    }
  ]
}
```

# 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 = {
    "query": [
        "https://www.linkedin.com/in/williamhgates/",
        "@williamhgates/videos"
    ],
    "limit": 5,
    "dev_custom_cookies": [
        {
            "key": "li_at",
            "value": ""
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("jupri/linkedin").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 = {
    "query": [
        "https://www.linkedin.com/in/williamhgates/",
        "@williamhgates/videos",
    ],
    "limit": 5,
    "dev_custom_cookies": [{
            "key": "li_at",
            "value": "",
        }],
}

# Run the Actor and wait for it to finish
run = client.actor("jupri/linkedin").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 '{
  "query": [
    "https://www.linkedin.com/in/williamhgates/",
    "@williamhgates/videos"
  ],
  "limit": 5,
  "dev_custom_cookies": [
    {
      "key": "li_at",
      "value": ""
    }
  ]
}' |
apify call jupri/linkedin --silent --output-dataset

```

## MCP server setup

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

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/PvQOXv6ADoD1AqD2K/builds/EVqD74pPCukRccXE4/openapi.json
