# LinkedIn Scraper

## Endpoint

```
POST https://api.crawlbyte.ai/api/tasks
```

## Basic Configuration (Required)

```json
{
  "type": "linkedin",
  "input": [
    "https://www.linkedin.com/in/some-person/",
    "https://www.linkedin.com/company/some-company/"
  ],
  "dataType": "profiles",
  "multithread": false,
  "cookie": "li_at=YOUR_COOKIE_HERE; JSESSIONID=YOUR_COOKIE_HERE"
}
```

### Parameters

| Field       | Type    | Description                                                       |
| ----------- | ------- | ----------------------------------------------------------------- |
| type        | string  | Always `"linkedin"`                                               |
| input       | array   | Array of full LinkedIn URLs                                       |
| dataType    | string  | Either `"profiles"` for people or `"companies"` for organizations |
| multithread | boolean | Use `true` for faster processing with multiple threads            |
| cookie      | string  | `key=value;`                                                      |

## Advanced Configuration (Optional)

```json
{
  "type": "linkedin",
  "input": [
    "https://www.linkedin.com/in/some-person/"
  ],
  "dataType": "profiles",
  "user_agent_preset": "chrome",
  "headers": "{\"X-Test\":\"abc\"}",
  "proxy": "http://username:password@ip:port"
}
```

### Optional Parameters

| Field               | Type   | Description                                                                                                          |
| ------------------- | ------ | -------------------------------------------------------------------------------------------------------------------- |
| user\_agent\_preset | string | Preset user-agent. Options: `chrome`, `firefox`, `edge`, `opera`, `safari`, `ios-safari`, `android-chrome`, `custom` |
| user\_agent\_custom | string | Used if `user_agent_preset` is `custom.`                                                                             |
| headers             | string | JSON-formatted string of headers.                                                                                    |
| proxy               | string | `http://username:password@ip:port`                                                                                   |

## Pricing

* **$0.0075 per successful task**\
  This is a pay-as-you-go pricing model — you're only charged when a LinkedIn task successfully returns public data.

You can view your current credit balance and usage history in the [Crawlbyte Dashboard](https://dash.crawlbyte.ai/).

## Response

The response contains metadata about the task. For linkedin type, the most important fields are `status` and `result`.

```json
{
  "id": "af3e12f2-8f45-43b0-8a7b-cabbbb94c1e9",
  "status": "completed",
  "result": "JSON_RESULT_HERE"
}
```

* If `result` is a **JSON object**, the data is already available — no polling needed.

### Status Types

| Status     | Meaning                                                        |
| ---------- | -------------------------------------------------------------- |
| queued     | Task was accepted and added to the processing queue.           |
| processing | Task is currently running.                                     |
| completed  | Task finished successfully.                                    |
| failed     | Task encountered an error (e.g. bad proxy, invalid URL, etc.). |

## Polling

If the initial `status` is `queued` or `processing`, you should poll for task completion.

```
GET https://api.crawlbyte.ai/api/tasks/:id
```

* You’ll receive the same structure with an updated `status`.
* Only poll until you receive `completed` or `failed`.
* Recommended interval: **every 2–3 seconds**.

## SDK Usage

You can run this task using any official **Crawlbyte SDK**:

* [Go SDK](https://github.com/crawlbyte/crawlbyte-sdk-go)
* [TypeScript SDK](https://github.com/crawlbyte/crawlbyte-sdk-ts)
* [Python SDK](https://github.com/crawlbyte/crawlbyte-sdk-py)

Each SDK provides a simple way to:

* Create the task
* Poll for status
* Handle the final result

Refer to the [SDKs section](/sdks.md) for installation, examples, and setup instructions.

## Notes

* This task supports all LinkedIn profiles and company pages.
* A session cookie is typically required. Use the [Crawlbyte Chrome Extension](https://developers.crawlbyte.ai/linkedin-scraper) to extract it.
* While a session cookie is typically needed, alternative handling may be available in advanced setups. Feel free to reach out to explore what works best for your use case.
* Make sure any session usage complies with Crawlbyte’s Terms of Service.
* You can safely run large batches using `multithread: true`.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.crawlbyte.ai/linkedin-scraper.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
