# LinkedIn 公司动态 API (linkedin.company_posts)

- Canonical page: https://everyinfra.com/linkedin-api/company_posts
- Endpoint: POST /api/v1/social with {"platform": "linkedin", "action": "company_posts", "params": {...}}
- Price: $0.002319 per call ($2.32 per 1,000 requests); failed and empty results are not charged
- Returns: list, default 10, max 50 per call (larger values are capped)
- Mode: sync; add "mode": "async" for slow tasks

领英公司动态按 `company` 读取一家公司在 LinkedIn 主页上发布的帖子，从新到旧，带正文、发布时间、互动数，以及帖子附带的文章链接卡片 `attachment`。它回答「这家公司最近在对外说什么」：新品发布、融资、招聘和活动消息，往往最先出现在公司主页上。市场团队用它做竞品动态监测，投资和销售团队用它捕捉公司近况，作为跟进客户的由头。

`company` 只认 LinkedIn 公司主页的短名或链接，工商注册名查不到。默认读 10 条，最多 50 条，传更大的数也只按 50 条返回。个人动态那一页按个人主页读一个人，返回的字段和这一页相同。`posted_at` 和 `url` 可以直接用来排时间线、回看原帖。

## Health

- Live health (24h percent, hourly and daily trends): https://api.everyinfra.com/api/v1/social/availability?platform=linkedin&action=company_posts

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| company | not declared | yes | not declared | 要读动态的公司：LinkedIn 公司主页 /company/ 后面那段短名（如 stripe），或完整主页链接；不认工商注册名和带空格的名称。 |
| limit | integer (1–50) | no | 10 | 这次调用最多返回的条数，整数，1–50；不传按默认值，实际返回可能少于这个数。超过上限照收，按上限返回。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| id | 该记录在原平台上的唯一标识。仅在同一平台内唯一，跨平台可能重复。 |
| url | 该记录在原平台上的可访问链接。 |
| text | 正文内容，已去除 HTML 标签，全文返回、不截断（个别平台的列表结果本身只有摘要，以该平台的字段说明为准）。 |
| author_name | 作者昵称（显示名）。 |
| author_username | 作者用户名（@handle），通常可用于拼 URL。 |
| author_headline | 内容作者的 headline（帖子/评论里用）。 |
| author_id | 帖子作者的数字成员 ID（search）。 |
| author_url | 作者在原平台的主页链接。 |
| author_avatar_url | 帖子作者头像链接（search）。 |
| author_type | 帖子作者类型：profile（个人）/ company（公司）。 |
| reactions | 各类反应数（search）：每项 type（like、appreciation、empathy 等）与 count。 |
| attachment | 帖子附带的卡片（search）：type（如 job、article）、title、description、subtitle、url、image_url。 |
| like_count | 点赞数。null 表示该平台或该接口不公开此数据，不等于 0。 |
| comment_count | 评论数。null 表示不公开，不等于 0。 |
| share_count | 帖子被转发的次数。 |
| hashtags | 公司/帖子的话题标签列表。 |
| is_reshare | 帖子是否为转发。 |
| posted_at | 发布时间，ISO 8601 格式、UTC 时区（如 2026-08-07T12:34:56+00:00）。平台只给非标准字符串时原样透传，解析前建议做容错。null 表示平台未公开。 |
| platform | 数据来源平台标识，与请求里的 platform 一致（如 xiaohongshu、tiktok）。 |

## Example

```bash
curl -X POST 'https://api.everyinfra.com/api/v1/social' \
  -H "Authorization: Bearer $EVERYINFRA_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "platform": "linkedin",
  "action": "company_posts",
  "params": {
    "company": "google"
  }
}'
```

```python
import os
import requests

response = requests.post(
    "https://api.everyinfra.com/api/v1/social",
    headers={"Authorization": f"Bearer {os.environ['EVERYINFRA_API_KEY']}"},
    json={
        "platform": "linkedin",
        "action": "company_posts",
        "params": {
            "company": "google",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

No real sample for these example parameters yet: structure only, every value is a placeholder (…).

```text
{
  "id": "req_…",
  "platform": "linkedin",
  "action": "company_posts",
  "results": [
    {
      "id": …,
      "url": …,
      "text": …,
      "author_name": …,
      "author_username": …,
      "author_headline": …,
      "author_id": …,
      "author_url": …,
      "author_avatar_url": …,
      "author_type": …,
      "reactions": …,
      "attachment": …,
      "like_count": …,
      "comment_count": …,
      "share_count": …,
      "hashtags": …,
      "is_reshare": …,
      "posted_at": …,
      "platform": …
    }
  ],
  "count": …,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## FAQ

### `company` 应该填什么？

填 LinkedIn 公司主页链接里 /company/ 后面那段短名，比如主页是 linkedin.com/company/stripe 就填 stripe，也可以直接贴整条主页链接。中文名、工商注册名或带空格的名称认不出来，会在扣费前被拒。这一页读公司，个人主页 /in/ 后面那段要交给个人动态那一页，两种名字要分开填。示例里填的是 google，也就是主页链接 /company/ 后面那一段。

### 为什么 `author_headline` 经常是空的？

公司主页发的帖子，作者就是公司本身，没有个人头衔，所以 `author_headline` 通常为空；`author_name` 是公司名称，`author_url` 指向公司主页。合并多家公司的数据时，用 `author_type` 区分发帖方是公司还是个人。统计公司自己发了多少原创内容时，先把 `is_reshare` 为真的帖子去掉，那些是转发别人的。`text` 是去掉 HTML 标签的全文，不截断，可以直接拿去做关键词统计，也可以和 `hashtags` 对照着归类。

### 帖子里附带的文章链接怎么取？

看 `attachment`：帖子带文章链接时，这里给出那张链接卡片的类型、标题和简介；纯文字、图片或视频帖没有这一项。另外 `hashtags` 多数时候为空，按话题给帖子归类时，以 `text` 正文为准更可靠。卡片的类型除了文章还可能是职位（job），按类型能把带职位卡片的帖子单独挑出来，看这家公司最近在招什么；卡片里另有链接和配图地址。把这些帖子按 `posted_at` 排开，就是一条招聘时间线。

## Also

- Capability catalog (no key): https://api.everyinfra.com/api/v1/social/catalog?platform=linkedin
- OpenAPI: https://everyinfra.com/openapi.json · Agents guide: https://everyinfra.com/agents.md
