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

请求

请求最多等待结果 290 秒,并以 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" }。重新提交任务即可再次尝试。

相关