# LinkedIn Scraper (`codingfrontend/linkedin-scraper`) Actor

General LinkedIn scraper that can search for jobs, companies, people, and posts. Supports multiple search modes with full data extraction, pagination, and filtering.

- **URL**: https://apify.com/codingfrontend/linkedin-scraper.md
- **Developed by:** [Coding Frontned](https://apify.com/codingfrontend) (community)
- **Categories:** Jobs, Lead generation, Social media
- **Features:** Limited permissions
- **Stats:** 45 total users, 3 monthly users, 81.3% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.99 / 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.

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 Scraper

Search LinkedIn in four bounded modes:

- `jobs` uses LinkedIn's public guest jobs HTML and does not require a login.
- `companies`, `people`, and `posts` use an authorized `li_at` cookie supplied through the secret input field. The cookie is applied before navigation and is never logged or stored.

The Actor stores only usable, canonical LinkedIn records in the default dataset. Invalid inputs, authentication walls, verification challenges, request failures, and zero-result failures are reported in the `OUTPUT` key rather than as billable result rows.

### Input

| Field | Required | Default | Notes |
|---|---:|---:|---|
| `query` | yes | — | 1–200 printable characters |
| `searchMode` | yes | `jobs` | `jobs`, `companies`, `people`, or `posts` |
| `location` | no | `United States` | Applied to jobs mode |
| `maxItems` | no | `50` | Integer from 1 to 500 |
| `datePosted` | no | `anyTime` | Jobs filter: `anyTime`, `pastMonth`, `pastWeek`, `past24Hours` |
| `jobType` | no | any | Jobs filter: `F`, `P`, `C`, `T`, or `I` |
| `scrapeDetails` | no | `true` | In jobs mode, attempts public description enrichment |
| `linkedinCookie` | protected modes | — | Secret `li_at` value for a LinkedIn account you are authorized to use |
| `proxyConfiguration` | no | direct | Optional Apify proxy configuration |

Cookie-authorized modes are intentionally rejected before navigation if no cookie is provided. Users are responsible for complying with LinkedIn's terms, applicable law, and account permissions.

### Output

Every dataset row is a unique usable result with explicit success semantics:

- `recordType`, `found`, `dataAvailable`, and `error`
- `position`, `type`, `title`, canonical `url`
- optional visible `subtitle`, `location`, `description`, `imageUrl`, and null-free `metadata`
- `searchQuery`, `searchMode`, `sourceUrl`, `sourceDomain`, `page`, and `scrapedAt`
- `detailAvailable` when public job enrichment was requested

`OUTPUT` contains a run summary or a bounded diagnostic. The Actor does not solve CAPTCHAs, alter browser fingerprints, rotate user agents, bypass login controls, or fabricate missing values.

### Example

```json
{
  "query": "software engineer",
  "searchMode": "jobs",
  "location": "United States",
  "datePosted": "pastWeek",
  "maxItems": 10,
  "scrapeDetails": false
}
```

### Development

```sh
npm ci
npm test
apify run --purge --input-file qa-inputs/local-public.json
npm run validate
```

# Changelog

This Actor's version history is a separate document: https://apify.com/codingfrontend/linkedin-scraper/changelog.md

# Actor input Schema

## `searchMode` (type: `string`):

Jobs are public; companies, people, and posts require an authorized LinkedIn cookie.

## `query` (type: `string`):

One printable search query from 1 to 200 characters.

## `location` (type: `string`):

Location filter used by public jobs search.

## `maxItems` (type: `integer`):

Hard cap across all requested pages.

## `datePosted` (type: `string`):

Restrict public job results by their posted age.

## `jobType` (type: `string`):

Optional LinkedIn employment-type code used only by jobs mode.

## `scrapeDetails` (type: `boolean`):

For jobs mode, visit each accepted public job page and add its description when available.

## `linkedinCookie` (type: `string`):

Required only for companies, people, and posts. It is used for navigation and is never logged or stored.

## `proxyConfiguration` (type: `object`):

Optional Apify proxy settings.

## Actor input object example

```json
{
  "searchMode": "jobs",
  "query": "software engineer",
  "location": "United States",
  "maxItems": 50,
  "datePosted": "anyTime",
  "jobType": "",
  "scrapeDetails": true
}
```

# Actor output Schema

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

No description

## `runSummary` (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 = {
    "query": "software engineer"
};

// Run the Actor and wait for it to finish
const run = await client.actor("codingfrontend/linkedin-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 = { "query": "software engineer" }

# Run the Actor and wait for it to finish
run = client.actor("codingfrontend/linkedin-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 '{
  "query": "software engineer"
}' |
apify call codingfrontend/linkedin-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,codingfrontend/linkedin-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/9ySjux7BqAoI0Phh8/builds/hp2F5gQaHpmaG9iBy/openapi.json
