> ## Documentation Index
> Fetch the complete documentation index at: https://docs.querying.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# LinkedIn API

> 以 JSON 读取公开的 LinkedIn 个人主页、帖子和职位，并按关键词、地点、发布时间、工作方式、职位类型和经验级别搜索职位。

通过 `POST /v1/social/linkedin/{action}` 以 JSON 读取公开的 LinkedIn 数据。用 `{action}` 选择要读取的内容。每次完成的请求消耗 **0.5 积分**。

## 请求

```bash theme={"theme":"css-variables"}
curl -X POST https://api.querying.ai/v1/social/linkedin/jobs-search \
  -H "Authorization: Bearer $QUERYING_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "query": "data engineer", "jobLocation": "United States", "postedWithin": "week", "limit": 1 }'
```

请求最多等待结果 290 秒，并以 `200` 应答，结果在 `response` 中。仍在运行的任务以 `202` 应答，请轮询 `GET /v1/async/task/{id}` 或设置 `webhook`；参见[异步任务](https://docs.querying.ai/zh/concepts/async-tasks.md)。

## 操作

| 路径 | 读取内容 | 必填 |
| - | - | - |
| `/v1/social/linkedin/profile` | 公开的个人主页及其最近的帖子和文章 | `username` 或 `url` |
| `/v1/social/linkedin/post` | 一条帖子及其评论预览 | `postId` 或 `url` |
| `/v1/social/linkedin/jobs-search` | 职位列表，逐页读取 | `query` 或 `jobLocation` |
| `/v1/social/linkedin/job` | 一个职位 | `jobId` 或 `url` |

这四个操作读取公开的个人主页、帖子和职位。

`username` 接受个人主页的 vanity 名称（`/in/` 之后的部分）或个人主页 URL，例如 `https://www.linkedin.com/in/williamhgates`。`postId` 接受帖子的 activity ID、帖子 URN（例如 `urn:li:activity:7530009142778941443`）或帖子 URL（`/posts/...` 或 `/feed/update/...`）。`jobId` 接受职位 ID 或职位 URL（`/jobs/view/...`）。`url` 接受与该操作对应的 URL。

## 参数

请求中如有其他操作的参数、下列以外的值或缺少必填字段，会在提交时被拒绝，并返回指明该字段的 `400 VALIDATION_ERROR`。

`jobs-search`：

* `query`：最多 200 个字符，且至少包含一个字母或数字。发送 `query`、`jobLocation` 或两者。
* `jobLocation`：最多 100 个字符，例如 `Seoul, South Korea` 或 `United States`。
* `postedWithin`：`day`、`week` 或 `month`。
* `workplace`：`onsite`、`remote` 或 `hybrid`。
* `jobType`：`full_time`、`part_time`、`contract`、`temporary`、`internship`、`volunteer` 或 `other`。
* `experience`：`internship`、`entry`、`associate`、`mid_senior`、`director` 或 `executive`。
* `limit`：可选，1 到 100 的整数，默认 10。
* `cursor`：上一页的 `nextCursor`，与相同的查询和筛选条件一起发送。LinkedIn 每页列出 10 个职位，在第 1,000 条结果之前停止。

## 响应示例

```json theme={"theme":"css-variables"}
{
  "platform": "linkedin",
  "action": "jobs_search",
  "jobs": [
    {
      "url": "https://www.linkedin.com/jobs/view/data-engineer-central-infraops-analytics-team-at-amazon-web-services-aws-4493232607",
      "jobId": "4493232607",
      "title": "Data Engineer, Central InfraOps Analytics Team",
      "company": {"url": "https://www.linkedin.com/company/amazon-web-services", "name": "Amazon Web Services (AWS)"},
      "benefits": "Actively Hiring",
      "location": "Herndon, VA",
      "position": 1,
      "postedAt": "2026-11-21",
      "postedText": "1 day ago"
    }
  ],
  "query": "data engineer",
  "hasMore": true,
  "provider": "linkedin_web",
  "nextCursor": "1",
  "jobLocation": "United States",
  "returnedCount": 1
}
```

## 结果字段

* 每个响应都会原样返回 `platform` 和 `action`，`provider` 表示数据的读取来源。由多个单词组成的 `action` 用下划线书写，路径 `/jobs-search` 对应 `jobs_search`。`jobs-search` 带有 `returnedCount`。
* `profile` 返回 `username`、`url`、`name`、`headline`、`location`、`countryCode`、`about`、`avatarUrl`、`followerCount`、`connectionsText`、`currentCompany`（`name`、`url`、`startDate`）、`jobTitles`、`previousCompanies` 和 `education`（`name`、`url`、`startDate`、`endDate`）。
  * `posts` 列出个人主页显示的最近 5 到 9 条帖子，每条包含 `postId`、`url`、`text`、`likeCount` 和 `publishedAt`。
  * `articles` 最多列出 10 篇文章，每篇包含 `url`、`title`、`likeCount` 和 `publishedAt`。
* `post` 返回 `postId`、`url`、`text`、`author`（`name`、`url`、`headline`、`followerCount`）、`publishedAt`、`likeCount`、`commentCount`、`sharedTitle`、`imageUrl`，视频帖子还会返回 `media`。`comments` 预览约 10 条评论，每条包含 `text`、`author`、`likeCount` 和 `publishedAt`。
* `jobs-search` 返回 `jobs`、`hasMore` 和 `nextCursor`，到列表末尾时该值为 `null`，并原样返回 `query` 和 `jobLocation`。职位包含 `jobId`、`url`、`title`、`company`（`name`、`url`）、`location`、`position`、`postedAt`、`postedText` 和 `benefits`。
* `job` 返回 `jobId`、`url`、`title`、`company`、`location`、保留换行的 `description`、`seniority`、`employmentType`、`industries`、按 LinkedIn 原文措辞的 `applicants` 和 `postedText`。`jobFunction` 和 `salary` 在职位显示时出现。
* 不存在或未公开的个人主页、帖子或职位会使任务以 `PAGE_UNAVAILABLE` 结束。只对完成的请求计费。

## HTML 页面

将 `include.html` 设为 `true`，结果会增加 `html`，即回答所读取的 LinkedIn 页面的链接，页面保存为可放进报告的文件。`html` 包含 `status`、`url` 和 `expiresAt`，说明见 [HTML 页面](https://docs.querying.ai/zh/engines/html-pages.md)。

* `include.html` 适用于 `profile` 和 `post`。
* 文件是 LinkedIn 为该页面发送的 HTML 文档，即脚本运行之前的状态。文件以一条备注注释开头，`Saved by querying.ai: the page LinkedIn served for task <id> at <UTC time>, the page as LinkedIn sent it, before any script ran, the address of the visit and its session ids masked.`
* 属于本次访问的值会替换为等长的零：Cookie 值、会话、请求和设备 ID、CSRF 及其他令牌、nonce，以及媒体地址中的签名。由于这些签名已被遮蔽，文件中的图片和视频链接无法加载。取决于访问来源的内容，例如媒体地址中的区域 CDN 主机名，保持 LinkedIn 发送时的样子。
* 文档的脚本以文本形式保留在文件中。提供该文件时会附带 Content-Security-Policy，不运行任何脚本，也不加载任何外部资源。
* LinkedIn 将主要内容以标记形式发送，因此打开的文件可以阅读。
* `profile` 和 `post` 保留公开页面。
* 其他所有操作（`jobs_search` 和 `job`）会在提交任务时返回 `422 EVIDENCE_UNSUPPORTED`，错误信息会说明原因。
* 页面不额外收费，请求仍为 0.5 积分。
* 无法保存页面时，仍会返回回答，`html` 为 `{ "status": "failed", "error": "EVIDENCE_FAILED" }`。重新提交任务即可再次尝试。

## 相关

* [LinkedIn 广告资料库](https://docs.querying.ai/zh/engines/linkedin-ad-library.md)，广告主在 LinkedIn 上投放的广告
* [Instagram](https://docs.querying.ai/zh/engines/instagram.md)
* [Threads](https://docs.querying.ai/zh/engines/threads.md)
* [引擎概览](https://docs.querying.ai/zh/engines/overview.md)
* [积分与限制](https://docs.querying.ai/zh/concepts/credits-and-limits.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.