mcpField
L
linkedin-post-research

linkedin-post-research

github.com/gooseworks-ai营销与增长1.3k60 次安装3 天前更新
代码仓库

关于 linkedin-post-research

linkedin-post-research 是通过 Apify 按关键词查找 LinkedIn 帖子的技能,可返回帖子、作者及互动数据,并支持排序、去重和多种输出格式。

主要功能

  1. 01通过 Apify 按关键词搜索
  2. 02按相关度或发布日期排序
  3. 03获取帖子、作者及互动数据
  4. 04跨关键词结果去重
  5. 05支持 JSON、CSV 和摘要输出

适用场景

  1. 01查找特定主题的高互动帖子
  2. 02发现发布相关主题的作者
  3. 03收集 LinkedIn 帖子以开展潜客研究

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/gooseworks-ai/goose-skills --skill linkedin-post-research

安装后在 Claude Code 中输入/linkedin-post-research确认已加载。

附带文件scripts/search_posts.pyskill.meta.json

详细介绍

LinkedIn 帖子研究

通过 Apify 按关键词搜索 LinkedIn 帖子。返回按互动量或日期排序的帖子,包含作者信息、全文、互动次数和直接链接。

无需 LinkedIn Cookie。无需登录。输入关键词,即可获取帖子。

自动加载时机

在以下情况加载此技能:

  • 用户说“搜索 LinkedIn 帖子”“LinkedIn 上大家对 X 有什么看法”或“查找关于……的 LinkedIn 内容”
  • 用户想查找某个主题下互动量较高的帖子
  • 用户想了解哪些人在发布特定主题的内容(发掘思想领袖)
  • 用户想查找帖子并提取评论者(潜在客户拓展渠道)

前提条件

Apify API Token

搜索 LinkedIn 帖子需要此 Token。在 .env 中设置:

APIFY_API_TOKEN=your_token_here

无需 LinkedIn Cookie、登录或会话 Token。只需完成这一项设置。


工作原理

  1. 接收一个或多个关键词
  2. 调用 apimaestro/linkedin-posts-search-scraper-no-cookies Apify Actor
  3. 返回包含作者、文本、互动指标、日期和 URL 的帖子
  4. 按 activity_id 对不同关键词的搜索结果去重
  5. 按互动量(反应总数)降序排序,或按日期排序

快速开始

# Single keyword search
python3 skills/capabilities/linkedin-post-research/scripts/search_posts.py \
  --keyword "AI sourcing" --max-items 20

# Multiple keywords
python3 skills/capabilities/linkedin-post-research/scripts/search_posts.py \
  --keyword "AI sourcing" --keyword "recruiting automation" --max-items 30

# Sort by date (most recent first)
python3 skills/capabilities/linkedin-post-research/scripts/search_posts.py \
  --keyword "AI agents" --sort-by date_posted --max-items 20

# Output as CSV
python3 skills/capabilities/linkedin-post-research/scripts/search_posts.py \
  --keyword "AI agents" --output csv --output-file results.csv

# Summary table
python3 skills/capabilities/linkedin-post-research/scripts/search_posts.py \
  --keyword "AI agents" --output summary

CLI 参考

标志默认值说明
--keyword、-k必填要搜索的关键词(可重复指定以搜索多个关键词)
--max-items50每个关键词最多返回的帖子数
--sort-byrelevance排序方式:relevance 或 date_posted
--output、-ojson输出格式:json、csv、summary
--output-filestdout将输出写入文件
--token环境变量Apify API Token(覆盖 APIFY_API_TOKEN 环境变量)
--timeout120等待 Apify 运行的最长秒数

Apify Actor 详情

Actor: apimaestro/linkedin-posts-search-scraper-no-cookies

API 调用:

curl -X POST "https://api.apify.com/v2/acts/apimaestro~linkedin-posts-search-scraper-no-cookies/runs?token=$APIFY_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "keyword": "AI agents",
    "maxItems": 50,
    "sortBy": "date_posted"
  }'

轮询结果:

# Check run status
curl "https://api.apify.com/v2/acts/apimaestro~linkedin-posts-search-scraper-no-cookies/runs/{RUN_ID}?token=$APIFY_API_TOKEN"

# When status is SUCCEEDED, fetch results
curl "https://api.apify.com/v2/datasets/{DATASET_ID}/items?token=$APIFY_API_TOKEN"

输出架构

{
  "author": "Jane Smith",
  "author_headline": "VP of Sales at Acme Corp",
  "author_profile_url": "https://www.linkedin.com/in/janesmith",
  "keyword": "AI sourcing",
  "reactions": 142,
  "comments": 28,
  "shares": 12,
  "reactions_by_type": {"LIKE": 100, "EMPATHY": 30, "PRAISE": 12},
  "date": "2026-04-01",
  "post_preview": "First 200 chars of the post text...",
  "full_text": "Complete post text...",
  "url": "https://www.linkedin.com/posts/...",
  "activity_id": "7447040447966826496",
  "hashtags": ["#AI", "#sales"],
  "is_repost": false,
  "content_type": "text"
}

输出列(CSV)

列说明
author帖子作者姓名
author_headline作者的 LinkedIn 个人简介
author_profile_url作者的 LinkedIn 个人资料 URL
keyword匹配的搜索关键词
reactions反应总数
comments评论数
shares分享数
date帖子日期(YYYY-MM-DD)
post_preview前约 200 个字符
urlLinkedIn 帖子的直接链接
activity_id帖子唯一标识符
hashtags以逗号分隔的主题标签

费用

Apify 按计算用量收费。抓取约 50 条帖子,费用约为 $0.01-0.05,具体取决于 Actor 的定价档位。每次运行后,脚本都会输出费用信息。

错误处理

错误解决方法
未设置 APIFY_API_TOKEN请用户将其添加到 .env
Apify 运行失败或超时重试一次。如果仍然失败,请尝试更宽泛的关键词。
结果为 0关键词可能过于具体。请尝试更宽泛的词。

评论

支持 Markdown