POST /v1/social/linkedin/{action} 以 JSON 读取公开的 LinkedIn 数据。用 {action} 选择要读取的内容。每次完成的请求消耗 0.5 积分。
请求
200 应答,结果在 response 中。仍在运行的任务以 202 应答,请轮询 GET /v1/async/task/{id} 或设置 webhook;参见异步任务。
操作
这四个操作读取公开的个人主页、帖子和职位。
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 条结果之前停止。
响应示例
结果字段
- 每个响应都会原样返回
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 页面。
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 广告资料库,广告主在 LinkedIn 上投放的广告
- Threads
- 引擎概览
- 积分与限制