social-scraping

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Social Media Scraping with StableSocial

借助StableSocial实现社交媒体数据抓取

Scrape profiles, posts, comments, followers, and search across TikTok, Instagram, X/Twitter, Facebook, Reddit, and LinkedIn. All endpoints cost $0.06 per call.
可抓取TikTok、Instagram、X/Twitter、Facebook、Reddit和LinkedIn平台的用户资料、帖子、评论、关注者数据,并支持跨平台搜索。所有接口单次调用费用均为$0.06。

Setup

安装设置

See rules/getting-started.md for installation and wallet setup.
安装及钱包设置请查看rules/getting-started.md文档。

How It Works: Async Two-Step Flow

工作原理:异步两步流程

Every request follows a trigger-then-poll pattern:
所有请求均遵循触发-轮询模式:

Step 1: Trigger (paid, $0.06)

步骤1:触发采集(付费,$0.06)

bash
npx agentcash fetch https://stablesocial.dev/api/x/profile -m POST -b '{"handle": "elonmusk"}'
Returns
202 Accepted
with a JWT token:
json
{"token": "eyJhbGciOiJIUzI1NiIs..."}
bash
npx agentcash fetch https://stablesocial.dev/api/x/profile -m POST -b '{"handle": "elonmusk"}'
返回
202 Accepted
状态码及JWT令牌:
json
{"token": "eyJhbGciOiJIUzI1NiIs..."}

Step 2: Poll (free)

步骤2:轮询结果(免费)

bash
npx agentcash fetch "https://stablesocial.dev/api/jobs?token=eyJhbGciOiJIUzI1NiIs..."
  • {"status": "pending"}
    — poll again in 3-5 seconds
  • {"status": "finished", "data": {...}}
    — data is ready
  • {"status": "failed", "error": "..."}
    — collection failed (not charged)
Tokens expire after 30 minutes. Jobs typically finish in 5-60 seconds.
bash
npx agentcash fetch "https://stablesocial.dev/api/jobs?token=eyJhbGciOiJIUzI1NiIs..."
  • {"status": "pending"}
    — 3-5秒后再次轮询
  • {"status": "finished", "data": {...}}
    — 数据已准备就绪
  • {"status": "failed", "error": "..."}
    — 采集失败(不收取费用)
令牌有效期为30分钟,任务通常在5-60秒内完成。

Quick Reference — TikTok

快速参考 — TikTok

TaskEndpointDepends On
Get profile
https://stablesocial.dev/api/tiktok/profile
Get posts
https://stablesocial.dev/api/tiktok/posts
profile
Post comments
https://stablesocial.dev/api/tiktok/post-comments
posts
Comment replies
https://stablesocial.dev/api/tiktok/comment-replies
post-comments
Followers
https://stablesocial.dev/api/tiktok/followers
profile
Following
https://stablesocial.dev/api/tiktok/following
profile
Search posts
https://stablesocial.dev/api/tiktok/search
Search hashtag
https://stablesocial.dev/api/tiktok/search-hashtag
Search profiles
https://stablesocial.dev/api/tiktok/search-profiles
Search by music
https://stablesocial.dev/api/tiktok/search-music
Input:
{"handle": "username"}
for profile/posts/followers.
{"query": "keyword"}
for search.
任务接口地址依赖项
获取用户资料
https://stablesocial.dev/api/tiktok/profile
获取帖子
https://stablesocial.dev/api/tiktok/posts
用户资料
获取帖子评论
https://stablesocial.dev/api/tiktok/post-comments
帖子
获取评论回复
https://stablesocial.dev/api/tiktok/comment-replies
帖子评论
获取关注者
https://stablesocial.dev/api/tiktok/followers
用户资料
获取关注列表
https://stablesocial.dev/api/tiktok/following
用户资料
搜索帖子
https://stablesocial.dev/api/tiktok/search
搜索话题标签
https://stablesocial.dev/api/tiktok/search-hashtag
搜索用户资料
https://stablesocial.dev/api/tiktok/search-profiles
按音乐搜索
https://stablesocial.dev/api/tiktok/search-music
输入参数: 获取资料/帖子/关注者时使用
{"handle": "username"}
;搜索时使用
{"query": "keyword"}

Quick Reference — Instagram

快速参考 — Instagram

TaskEndpointDepends On
Get profile
https://stablesocial.dev/api/instagram/profile
Get posts
https://stablesocial.dev/api/instagram/posts
profile
Post comments
https://stablesocial.dev/api/instagram/post-comments
posts
Comment replies
https://stablesocial.dev/api/instagram/comment-replies
post-comments
Followers
https://stablesocial.dev/api/instagram/followers
profile
Following
https://stablesocial.dev/api/instagram/following
profile
Stories
https://stablesocial.dev/api/instagram/stories
profile
Highlights
https://stablesocial.dev/api/instagram/highlights
profile
Search posts
https://stablesocial.dev/api/instagram/search
Search tags
https://stablesocial.dev/api/instagram/search-tags
Input:
{"handle": "username"}
for profile/posts/followers.
{"query": "keyword"}
for search.
任务接口地址依赖项
获取用户资料
https://stablesocial.dev/api/instagram/profile
获取帖子
https://stablesocial.dev/api/instagram/posts
用户资料
获取帖子评论
https://stablesocial.dev/api/instagram/post-comments
帖子
获取评论回复
https://stablesocial.dev/api/instagram/comment-replies
帖子评论
获取关注者
https://stablesocial.dev/api/instagram/followers
用户资料
获取关注列表
https://stablesocial.dev/api/instagram/following
用户资料
获取动态故事
https://stablesocial.dev/api/instagram/stories
用户资料
获取精选动态
https://stablesocial.dev/api/instagram/highlights
用户资料
搜索帖子
https://stablesocial.dev/api/instagram/search
搜索话题标签
https://stablesocial.dev/api/instagram/search-tags
输入参数: 获取资料/帖子/关注者时使用
{"handle": "username"}
;搜索时使用
{"query": "keyword"}

Quick Reference — X/Twitter

快速参考 — X/Twitter

TaskEndpointDepends On
Get profile
https://stablesocial.dev/api/x/profile
Get posts
https://stablesocial.dev/api/x/posts
profile
Post replies
https://stablesocial.dev/api/x/post-replies
posts
Post retweets
https://stablesocial.dev/api/x/post-retweets
posts
Quote tweets
https://stablesocial.dev/api/x/post-quotes
posts
Followers
https://stablesocial.dev/api/x/followers
profile
Following
https://stablesocial.dev/api/x/following
profile
Search posts
https://stablesocial.dev/api/x/search
Search profiles
https://stablesocial.dev/api/x/search-profiles
Input:
{"handle": "username"}
for profile/posts/followers.
{"query": "keyword"}
for search.
任务接口地址依赖项
获取用户资料
https://stablesocial.dev/api/x/profile
获取帖子
https://stablesocial.dev/api/x/posts
用户资料
获取帖子回复
https://stablesocial.dev/api/x/post-replies
帖子
获取帖子转发
https://stablesocial.dev/api/x/post-retweets
帖子
获取引用推文
https://stablesocial.dev/api/x/post-quotes
帖子
获取关注者
https://stablesocial.dev/api/x/followers
用户资料
获取关注列表
https://stablesocial.dev/api/x/following
用户资料
搜索帖子
https://stablesocial.dev/api/x/search
搜索用户资料
https://stablesocial.dev/api/x/search-profiles
输入参数: 获取资料/帖子/关注者时使用
{"handle": "username"}
;搜索时使用
{"query": "keyword"}

Quick Reference — Facebook

快速参考 — Facebook

TaskEndpointDepends On
Get profile
https://stablesocial.dev/api/facebook/profile
Get posts
https://stablesocial.dev/api/facebook/posts
profile
Post comments
https://stablesocial.dev/api/facebook/post-comments
posts
Comment replies
https://stablesocial.dev/api/facebook/comment-replies
post-comments
Followers
https://stablesocial.dev/api/facebook/followers
profile
Following
https://stablesocial.dev/api/facebook/following
profile
Search posts
https://stablesocial.dev/api/facebook/search
Search people
https://stablesocial.dev/api/facebook/search-people
Search pages
https://stablesocial.dev/api/facebook/search-pages
Search groups
https://stablesocial.dev/api/facebook/search-groups
Input:
{"handle": "username"}
or
{"profile_id": "id"}
for profile.
{"query": "keyword"}
for search.
任务接口地址依赖项
获取用户资料
https://stablesocial.dev/api/facebook/profile
获取帖子
https://stablesocial.dev/api/facebook/posts
用户资料
获取帖子评论
https://stablesocial.dev/api/facebook/post-comments
帖子
获取评论回复
https://stablesocial.dev/api/facebook/comment-replies
帖子评论
获取关注者
https://stablesocial.dev/api/facebook/followers
用户资料
获取关注列表
https://stablesocial.dev/api/facebook/following
用户资料
搜索帖子
https://stablesocial.dev/api/facebook/search
搜索用户
https://stablesocial.dev/api/facebook/search-people
搜索主页
https://stablesocial.dev/api/facebook/search-pages
搜索群组
https://stablesocial.dev/api/facebook/search-groups
输入参数: 获取资料时使用
{"handle": "username"}
{"profile_id": "id"}
;搜索时使用
{"query": "keyword"}

Quick Reference — Reddit

快速参考 — Reddit

TaskEndpointDepends On
Get post
https://stablesocial.dev/api/reddit/post
Post comments
https://stablesocial.dev/api/reddit/post-comments
post
Get comment
https://stablesocial.dev/api/reddit/comment
Search posts
https://stablesocial.dev/api/reddit/search
Search profiles
https://stablesocial.dev/api/reddit/search-profiles
Subreddit posts
https://stablesocial.dev/api/reddit/subreddit
Input:
{"post_id": "id"}
for post details.
{"query": "keyword"}
for search.
{"subreddit": "name"}
for subreddit.
任务接口地址依赖项
获取帖子
https://stablesocial.dev/api/reddit/post
获取帖子评论
https://stablesocial.dev/api/reddit/post-comments
帖子
获取评论
https://stablesocial.dev/api/reddit/comment
搜索帖子
https://stablesocial.dev/api/reddit/search
搜索用户资料
https://stablesocial.dev/api/reddit/search-profiles
获取子版块帖子
https://stablesocial.dev/api/reddit/subreddit
输入参数: 获取帖子详情时使用
{"post_id": "id"}
;搜索时使用
{"query": "keyword"}
;获取子版块帖子时使用
{"subreddit": "name"}

Quick Reference — LinkedIn

快速参考 — LinkedIn

TaskEndpointDepends On
Member profile
https://stablesocial.dev/api/linkedin/profile
Member posts
https://stablesocial.dev/api/linkedin/posts
profile
Company profile
https://stablesocial.dev/api/linkedin/company
Company posts
https://stablesocial.dev/api/linkedin/company-posts
company
Post comments
https://stablesocial.dev/api/linkedin/post-comments
posts
Comment replies
https://stablesocial.dev/api/linkedin/comment-replies
post-comments
Post reactors
https://stablesocial.dev/api/linkedin/post-reactors
posts
Search posts
https://stablesocial.dev/api/linkedin/search-posts
Search jobs
https://stablesocial.dev/api/linkedin/search-jobs
Search members
https://stablesocial.dev/api/linkedin/search-members
Search companies
https://stablesocial.dev/api/linkedin/search-companies
Search ads
https://stablesocial.dev/api/linkedin/search-ads
Input:
{"member_id": "username"}
for profile.
{"company_id": "company"}
for company.
{"query": "keyword"}
for search.
任务接口地址依赖项
获取个人资料
https://stablesocial.dev/api/linkedin/profile
获取个人帖子
https://stablesocial.dev/api/linkedin/posts
个人资料
获取企业资料
https://stablesocial.dev/api/linkedin/company
获取企业帖子
https://stablesocial.dev/api/linkedin/company-posts
企业资料
获取帖子评论
https://stablesocial.dev/api/linkedin/post-comments
帖子
获取评论回复
https://stablesocial.dev/api/linkedin/comment-replies
帖子评论
获取帖子互动者
https://stablesocial.dev/api/linkedin/post-reactors
帖子
搜索帖子
https://stablesocial.dev/api/linkedin/search-posts
搜索职位
https://stablesocial.dev/api/linkedin/search-jobs
搜索用户
https://stablesocial.dev/api/linkedin/search-members
搜索企业
https://stablesocial.dev/api/linkedin/search-companies
搜索广告
https://stablesocial.dev/api/linkedin/search-ads
输入参数: 获取个人资料时使用
{"member_id": "username"}
;获取企业资料时使用
{"company_id": "company"}
;搜索时使用
{"query": "keyword"}

Data Dependencies

数据依赖

Some endpoints require a prior collection. For example, to get followers you must first trigger the profile:
bash
undefined
部分接口需要先完成前置采集任务。例如,要获取关注者数据,必须先触发用户资料采集:
bash
undefined

1. Trigger profile collection

1. 触发用户资料采集

npx agentcash fetch https://stablesocial.dev/api/instagram/profile -m POST -b '{"handle": "natgeo"}'
npx agentcash fetch https://stablesocial.dev/api/instagram/profile -m POST -b '{"handle": "natgeo"}'

Poll until finished...

轮询直至任务完成...

2. Now fetch followers (depends on profile)

2. 现在可以获取关注者数据(依赖用户资料)

npx agentcash fetch https://stablesocial.dev/api/instagram/followers -m POST -b '{"handle": "natgeo"}'
npx agentcash fetch https://stablesocial.dev/api/instagram/followers -m POST -b '{"handle": "natgeo"}'

Poll until finished...

轮询直至任务完成...

undefined
undefined

Pagination

分页机制

When results are paginated, the response includes
page_info.has_next_page
and a
cursor
. Pass the cursor to fetch the next page (each page is a new paid POST):
bash
npx agentcash fetch https://stablesocial.dev/api/tiktok/followers -m POST -b '{"handle": "username", "cursor": "abc123"}'
当结果支持分页时,响应会包含
page_info.has_next_page
字段及
cursor
参数。传递该cursor参数即可获取下一页数据(每一页对应一次新的付费POST请求):
bash
npx agentcash fetch https://stablesocial.dev/api/tiktok/followers -m POST -b '{"handle": "username", "cursor": "abc123"}'

Key Parameters

核心参数

  • handle
    /
    profile_id
    /
    member_id
    /
    company_id
    — target account
  • max_page_size
    — results per page (default varies, max 100)
  • max_followers
    — how many followers to collect (default 500)
  • max_posts
    /
    max_activities
    /
    max_results
    — item limits (default 50)
  • cursor
    — pagination cursor from previous response
  • order_by
    — sort order:
    date_desc
    ,
    date_asc
    ,
    id_desc
  • activity_type
    — LinkedIn:
    posts
    ,
    articles
    ,
    documents
    ,
    media
    ,
    comments
  • reaction_type
    — LinkedIn:
    LIKE
    ,
    CELEBRATE
    ,
    SUPPORT
    ,
    LOVE
    ,
    INSIGHTFUL
    ,
    FUNNY
  • handle
    /
    profile_id
    /
    member_id
    /
    company_id
    — 目标账号标识
  • max_page_size
    — 每页结果数量(默认值依接口而定,最大100)
  • max_followers
    — 要采集的关注者数量(默认500)
  • max_posts
    /
    max_activities
    /
    max_results
    — 采集项数量上限(默认50)
  • cursor
    — 上一次响应返回的分页游标
  • order_by
    — 排序方式:
    date_desc
    (按日期降序)、
    date_asc
    (按日期升序)、
    id_desc
    (按ID降序)
  • activity_type
    — LinkedIn专属:
    posts
    articles
    documents
    media
    comments
  • reaction_type
    — LinkedIn专属:
    LIKE
    CELEBRATE
    SUPPORT
    LOVE
    INSIGHTFUL
    FUNNY

Workflows

工作流示例

Profile Deep Dive

用户资料深度分析

  • (Optional) Check balance:
    npx agentcash wallet info
  • Trigger profile collection
  • Poll until finished
  • Trigger posts collection
  • Poll until finished
  • Optionally fetch comments, followers
  • (可选)查询余额:
    npx agentcash wallet info
  • 触发用户资料采集
  • 轮询直至任务完成
  • 触发帖子采集
  • 轮询直至任务完成
  • (可选)获取评论、关注者数据

Cross-Platform Search

跨平台搜索

  • Search same keyword across multiple platforms
  • Compare results and synthesize findings
bash
npx agentcash fetch https://stablesocial.dev/api/x/search -m POST -b '{"query": "brand name"}'
npx agentcash fetch https://stablesocial.dev/api/instagram/search -m POST -b '{"query": "brand name"}'
npx agentcash fetch https://stablesocial.dev/api/tiktok/search -m POST -b '{"query": "brand name"}'
  • 在多个平台搜索同一关键词
  • 对比结果并整合分析
bash
npx agentcash fetch https://stablesocial.dev/api/x/search -m POST -b '{"query": "brand name"}'
npx agentcash fetch https://stablesocial.dev/api/instagram/search -m POST -b '{"query": "brand name"}'
npx agentcash fetch https://stablesocial.dev/api/tiktok/search -m POST -b '{"query": "brand name"}'

Influencer Analysis

网红分析

  • Get profile on target platform
  • Fetch recent posts with engagement
  • Get follower list for audience analysis
  • Check comments for sentiment
  • 获取目标平台的网红资料
  • 抓取其近期带互动数据的帖子
  • 获取关注者列表用于受众分析
  • 分析评论的情感倾向

Competitive Intelligence

竞品情报分析

  • Search LinkedIn for competitor company
  • Get company posts and reactions
  • Search for competitor ads
  • Monitor employee activity
bash
npx agentcash fetch https://stablesocial.dev/api/linkedin/company -m POST -b '{"company_id": "competitor"}'
npx agentcash fetch https://stablesocial.dev/api/linkedin/search-ads -m POST -b '{"query": "competitor name"}'
  • 在LinkedIn搜索竞品企业
  • 获取企业帖子及互动数据
  • 搜索竞品广告
  • 监控员工动态
bash
npx agentcash fetch https://stablesocial.dev/api/linkedin/company -m POST -b '{"company_id": "competitor"}'
npx agentcash fetch https://stablesocial.dev/api/linkedin/search-ads -m POST -b '{"query": "competitor name"}'

Cost Estimation

成本估算

All endpoints are $0.06 per trigger call. Polling is free.
TaskCallsCost
Single profile1$0.06
Profile + posts2$0.12
Full profile deep dive4-6$0.24-0.36
Cross-platform search (3 platforms)3$0.18
Competitor analysis4-8$0.24-0.48
所有触发采集的接口单次调用费用为$0.06,轮询操作免费。
任务调用次数成本
单个用户资料采集1$0.06
资料+帖子采集2$0.12
完整资料深度分析4-6$0.24-0.36
跨平台搜索(3个平台)3$0.18
竞品分析4-8$0.24-0.48

vs social-intelligence Skill

与social-intelligence技能对比

The
social-intelligence
skill uses X/Twitter (Grok) and Reddit on stableenrich.dev ($0.02/call, synchronous). Use it for quick X/Twitter keyword searches and Reddit post lookups.
Use
social-scraping
(this skill) when you need:
  • TikTok, Instagram, Facebook, or LinkedIn data
  • Profiles, followers, following — not just search
  • Comments, replies, reactions on posts
  • LinkedIn jobs, ads, company data
  • Cross-platform research
social-intelligence
技能基于X/Twitter(Grok)和Reddit平台,部署在stableenrich.dev(单次调用$0.02,同步流程)。适用于快速的X/Twitter关键词搜索及Reddit帖子查询。
当你需要以下功能时,请使用本
social-scraping
技能:
  • TikTok、Instagram、Facebook或LinkedIn平台的数据
  • 用户资料、关注者、关注列表数据 — 而非仅搜索功能
  • 帖子的评论、回复、互动反应数据
  • LinkedIn职位、广告、企业数据
  • 跨平台调研分析