social-scraping
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSocial 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 with a JWT token:
202 Acceptedjson
{"token": "eyJhbGciOiJIUzI1NiIs..."}bash
npx agentcash fetch https://stablesocial.dev/api/x/profile -m POST -b '{"handle": "elonmusk"}'返回状态码及JWT令牌:
202 Acceptedjson
{"token": "eyJhbGciOiJIUzI1NiIs..."}Step 2: Poll (free)
步骤2:轮询结果(免费)
bash
npx agentcash fetch "https://stablesocial.dev/api/jobs?token=eyJhbGciOiJIUzI1NiIs..."- — poll again in 3-5 seconds
{"status": "pending"} - — data is ready
{"status": "finished", "data": {...}} - — collection failed (not charged)
{"status": "failed", "error": "..."}
Tokens expire after 30 minutes. Jobs typically finish in 5-60 seconds.
bash
npx agentcash fetch "https://stablesocial.dev/api/jobs?token=eyJhbGciOiJIUzI1NiIs..."- — 3-5秒后再次轮询
{"status": "pending"} - — 数据已准备就绪
{"status": "finished", "data": {...}} - — 采集失败(不收取费用)
{"status": "failed", "error": "..."}
令牌有效期为30分钟,任务通常在5-60秒内完成。
Quick Reference — TikTok
快速参考 — TikTok
| Task | Endpoint | Depends On |
|---|---|---|
| Get profile | | — |
| Get posts | | profile |
| Post comments | | posts |
| Comment replies | | post-comments |
| Followers | | profile |
| Following | | profile |
| Search posts | | — |
| Search hashtag | | — |
| Search profiles | | — |
| Search by music | | — |
Input: for profile/posts/followers. for search.
{"handle": "username"}{"query": "keyword"}| 任务 | 接口地址 | 依赖项 |
|---|---|---|
| 获取用户资料 | | — |
| 获取帖子 | | 用户资料 |
| 获取帖子评论 | | 帖子 |
| 获取评论回复 | | 帖子评论 |
| 获取关注者 | | 用户资料 |
| 获取关注列表 | | 用户资料 |
| 搜索帖子 | | — |
| 搜索话题标签 | | — |
| 搜索用户资料 | | — |
| 按音乐搜索 | | — |
输入参数: 获取资料/帖子/关注者时使用;搜索时使用。
{"handle": "username"}{"query": "keyword"}Quick Reference — Instagram
快速参考 — Instagram
| Task | Endpoint | Depends On |
|---|---|---|
| Get profile | | — |
| Get posts | | profile |
| Post comments | | posts |
| Comment replies | | post-comments |
| Followers | | profile |
| Following | | profile |
| Stories | | profile |
| Highlights | | profile |
| Search posts | | — |
| Search tags | | — |
Input: for profile/posts/followers. for search.
{"handle": "username"}{"query": "keyword"}| 任务 | 接口地址 | 依赖项 |
|---|---|---|
| 获取用户资料 | | — |
| 获取帖子 | | 用户资料 |
| 获取帖子评论 | | 帖子 |
| 获取评论回复 | | 帖子评论 |
| 获取关注者 | | 用户资料 |
| 获取关注列表 | | 用户资料 |
| 获取动态故事 | | 用户资料 |
| 获取精选动态 | | 用户资料 |
| 搜索帖子 | | — |
| 搜索话题标签 | | — |
输入参数: 获取资料/帖子/关注者时使用;搜索时使用。
{"handle": "username"}{"query": "keyword"}Quick Reference — X/Twitter
快速参考 — X/Twitter
| Task | Endpoint | Depends On |
|---|---|---|
| Get profile | | — |
| Get posts | | profile |
| Post replies | | posts |
| Post retweets | | posts |
| Quote tweets | | posts |
| Followers | | profile |
| Following | | profile |
| Search posts | | — |
| Search profiles | | — |
Input: for profile/posts/followers. for search.
{"handle": "username"}{"query": "keyword"}| 任务 | 接口地址 | 依赖项 |
|---|---|---|
| 获取用户资料 | | — |
| 获取帖子 | | 用户资料 |
| 获取帖子回复 | | 帖子 |
| 获取帖子转发 | | 帖子 |
| 获取引用推文 | | 帖子 |
| 获取关注者 | | 用户资料 |
| 获取关注列表 | | 用户资料 |
| 搜索帖子 | | — |
| 搜索用户资料 | | — |
输入参数: 获取资料/帖子/关注者时使用;搜索时使用。
{"handle": "username"}{"query": "keyword"}Quick Reference — Facebook
快速参考 — Facebook
| Task | Endpoint | Depends On |
|---|---|---|
| Get profile | | — |
| Get posts | | profile |
| Post comments | | posts |
| Comment replies | | post-comments |
| Followers | | profile |
| Following | | profile |
| Search posts | | — |
| Search people | | — |
| Search pages | | — |
| Search groups | | — |
Input: or for profile. for search.
{"handle": "username"}{"profile_id": "id"}{"query": "keyword"}| 任务 | 接口地址 | 依赖项 |
|---|---|---|
| 获取用户资料 | | — |
| 获取帖子 | | 用户资料 |
| 获取帖子评论 | | 帖子 |
| 获取评论回复 | | 帖子评论 |
| 获取关注者 | | 用户资料 |
| 获取关注列表 | | 用户资料 |
| 搜索帖子 | | — |
| 搜索用户 | | — |
| 搜索主页 | | — |
| 搜索群组 | | — |
输入参数: 获取资料时使用或;搜索时使用。
{"handle": "username"}{"profile_id": "id"}{"query": "keyword"}Quick Reference — Reddit
快速参考 — Reddit
| Task | Endpoint | Depends On |
|---|---|---|
| Get post | | — |
| Post comments | | post |
| Get comment | | — |
| Search posts | | — |
| Search profiles | | — |
| Subreddit posts | | — |
Input: for post details. for search. for subreddit.
{"post_id": "id"}{"query": "keyword"}{"subreddit": "name"}| 任务 | 接口地址 | 依赖项 |
|---|---|---|
| 获取帖子 | | — |
| 获取帖子评论 | | 帖子 |
| 获取评论 | | — |
| 搜索帖子 | | — |
| 搜索用户资料 | | — |
| 获取子版块帖子 | | — |
输入参数: 获取帖子详情时使用;搜索时使用;获取子版块帖子时使用。
{"post_id": "id"}{"query": "keyword"}{"subreddit": "name"}Quick Reference — LinkedIn
快速参考 — LinkedIn
| Task | Endpoint | Depends On |
|---|---|---|
| Member profile | | — |
| Member posts | | profile |
| Company profile | | — |
| Company posts | | company |
| Post comments | | posts |
| Comment replies | | post-comments |
| Post reactors | | posts |
| Search posts | | — |
| Search jobs | | — |
| Search members | | — |
| Search companies | | — |
| Search ads | | — |
Input: for profile. for company. for search.
{"member_id": "username"}{"company_id": "company"}{"query": "keyword"}| 任务 | 接口地址 | 依赖项 |
|---|---|---|
| 获取个人资料 | | — |
| 获取个人帖子 | | 个人资料 |
| 获取企业资料 | | — |
| 获取企业帖子 | | 企业资料 |
| 获取帖子评论 | | 帖子 |
| 获取评论回复 | | 帖子评论 |
| 获取帖子互动者 | | 帖子 |
| 搜索帖子 | | — |
| 搜索职位 | | — |
| 搜索用户 | | — |
| 搜索企业 | | — |
| 搜索广告 | | — |
输入参数: 获取个人资料时使用;获取企业资料时使用;搜索时使用。
{"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
undefined1. 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...
轮询直至任务完成...
undefinedundefinedPagination
分页机制
When results are paginated, the response includes and a . Pass the cursor to fetch the next page (each page is a new paid POST):
page_info.has_next_pagecursorbash
npx agentcash fetch https://stablesocial.dev/api/tiktok/followers -m POST -b '{"handle": "username", "cursor": "abc123"}'当结果支持分页时,响应会包含字段及参数。传递该cursor参数即可获取下一页数据(每一页对应一次新的付费POST请求):
page_info.has_next_pagecursorbash
npx agentcash fetch https://stablesocial.dev/api/tiktok/followers -m POST -b '{"handle": "username", "cursor": "abc123"}'Key Parameters
核心参数
- /
handle/profile_id/member_id— target accountcompany_id - — results per page (default varies, max 100)
max_page_size - — how many followers to collect (default 500)
max_followers - /
max_posts/max_activities— item limits (default 50)max_results - — pagination cursor from previous response
cursor - — sort order:
order_by,date_desc,date_ascid_desc - — LinkedIn:
activity_type,posts,articles,documents,mediacomments - — LinkedIn:
reaction_type,LIKE,CELEBRATE,SUPPORT,LOVE,INSIGHTFULFUNNY
- /
handle/profile_id/member_id— 目标账号标识company_id - — 每页结果数量(默认值依接口而定,最大100)
max_page_size - — 要采集的关注者数量(默认500)
max_followers - /
max_posts/max_activities— 采集项数量上限(默认50)max_results - — 上一次响应返回的分页游标
cursor - — 排序方式:
order_by(按日期降序)、date_desc(按日期升序)、date_asc(按ID降序)id_desc - — LinkedIn专属:
activity_type、posts、articles、documents、mediacomments - — LinkedIn专属:
reaction_type、LIKE、CELEBRATE、SUPPORT、LOVE、INSIGHTFULFUNNY
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.
| Task | Calls | Cost |
|---|---|---|
| Single profile | 1 | $0.06 |
| Profile + posts | 2 | $0.12 |
| Full profile deep dive | 4-6 | $0.24-0.36 |
| Cross-platform search (3 platforms) | 3 | $0.18 |
| Competitor analysis | 4-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 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.
social-intelligenceUse (this skill) when you need:
social-scraping- 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当你需要以下功能时,请使用本技能:
social-scraping- TikTok、Instagram、Facebook或LinkedIn平台的数据
- 用户资料、关注者、关注列表数据 — 而非仅搜索功能
- 帖子的评论、回复、互动反应数据
- LinkedIn职位、广告、企业数据
- 跨平台调研分析