scraping-twitter-profile-tweets
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseScraping Twitter Profile Tweets
抓取Twitter主页推文
Raw data collection. No assumed use case — returns the full dataset for downstream analysis.
原始数据采集。不预设使用场景——返回完整数据集供下游分析。
Inputs
输入参数
| Parameter | Type | Required | Default | Notes |
|---|---|---|---|---|
| array | Optional | | Twitter profile URLs (x.com or twitter.com formats) |
| array | Optional | | Twitter usernames (without @) |
| string | Optional | — | Tweets after this date (YYYY-MM-DD or YYYY-MM-DD_HH:MM:SS_UTC) |
| string | Optional | — | Tweets before this date (YYYY-MM-DD or YYYY-MM-DD_HH:MM:SS_UTC) |
| boolean | Optional | | Include native retweets in results |
| boolean | Optional | | Only tweets containing images |
| boolean | Optional | | Include tweet replies |
| number | Optional | — | Minimum reply count threshold |
| boolean | Optional | | Fetch full profile about data |
| number | Optional | Unlimited | Maximum tweets to return |
| string | Optional | — | JavaScript function to transform each output object |
| 参数 | 类型 | 是否必填 | 默认值 | 说明 |
|---|---|---|---|---|
| array | 可选 | | Twitter主页URL(支持x.com或twitter.com格式) |
| array | 可选 | | Twitter用户名(不带@符号) |
| string | 可选 | — | 在此日期之后发布的推文(格式为YYYY-MM-DD或YYYY-MM-DD_HH:MM:SS_UTC) |
| string | 可选 | — | 在此日期之前发布的推文(格式为YYYY-MM-DD或YYYY-MM-DD_HH:MM:SS_UTC) |
| boolean | 可选 | | 结果中包含原生转发推文 |
| boolean | 可选 | | 仅返回包含图片的推文 |
| boolean | 可选 | | 包含推文回复 |
| number | 可选 | — | 最低回复数量阈值 |
| boolean | 可选 | | 获取完整的主页简介数据 |
| number | 可选 | 无限制 | 返回的最大推文数量 |
| string | 可选 | — | 用于转换每个输出对象的JavaScript函数 |
How to Run
运行方式
Using run_actor.js (recommended)
使用run_actor.js(推荐)
bash
undefinedbash
undefinedQuick answer (table)
快速返回(表格形式)
node scripts/run_actor.js --actor "apidojo~twitter-profile-scraper" --input '{"twitterHandles": ["elonmusk"], "maxItems": 100}'
node scripts/run_actor.js --actor "apidojo~twitter-profile-scraper" --input '{"twitterHandles": ["elonmusk"], "maxItems": 100}'
Save as CSV
保存为CSV格式
node scripts/run_actor.js --actor "apidojo~twitter-profile-scraper" --input '{"twitterHandles": ["elonmusk"], "maxItems": 100}' --output results.csv --format csv
node scripts/run_actor.js --actor "apidojo~twitter-profile-scraper" --input '{"twitterHandles": ["elonmusk"], "maxItems": 100}' --output results.csv --format csv
Save as JSON
保存为JSON格式
node scripts/run_actor.js --actor "apidojo~twitter-profile-scraper" --input '{"twitterHandles": ["elonmusk"], "maxItems": 100}' --output results.json --format json
undefinednode scripts/run_actor.js --actor "apidojo~twitter-profile-scraper" --input '{"twitterHandles": ["elonmusk"], "maxItems": 100}' --output results.json --format json
undefinedREST API fallback
备用REST API方式
bash
curl -X POST "https://api.apify.com/v2/acts/apidojo~twitter-profile-scraper/runs" \
-H "Authorization: Bearer $APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"twitterHandles": ["elonmusk"], "maxItems": 100}'If Apify MCP is available:
Use the Apify MCP tool with actor and the input above.
call_actorapidojo~twitter-profile-scraperbash
curl -X POST "https://api.apify.com/v2/acts/apidojo~twitter-profile-scraper/runs" \
-H "Authorization: Bearer $APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"twitterHandles": ["elonmusk"], "maxItems": 100}'若Apify MCP可用:
使用Apify MCP的工具,指定actor为并传入上述输入参数。
call_actorapidojo~twitter-profile-scraperOutput Fields
输出字段
| Field | Type | Description |
|---|---|---|
| string | Always |
| string | Tweet ID |
| string | Tweet URL (x.com) |
| string | Tweet URL (twitter.com) |
| string | Tweet text content |
| number | Retweet count |
| number | Reply count |
| number | Like count |
| number | Quote tweet count |
| number | Bookmark count |
| string | Creation timestamp |
| string | Detected language |
| boolean | Whether this is a reply |
| boolean | Whether this is a retweet |
| boolean | Whether this is a quote tweet |
| string | Twitter client used |
| string | Author @username |
| string | Author display name |
| boolean | Legacy verification |
| boolean | Twitter Blue verification |
| string | Author profile picture URL |
| number | Author follower count |
| 字段 | 类型 | 描述 |
|---|---|---|
| string | 固定为 |
| string | 推文ID |
| string | 推文URL(x.com格式) |
| string | 推文URL(twitter.com格式) |
| string | 推文文本内容 |
| number | 转发数 |
| number | 回复数 |
| number | 点赞数 |
| number | 引用推文数 |
| number | 收藏数 |
| string | 创建时间戳 |
| string | 检测到的语言 |
| boolean | 是否为回复推文 |
| boolean | 是否为转发推文 |
| boolean | 是否为引用推文 |
| string | 使用的Twitter客户端 |
| string | 作者@用户名 |
| string | 作者显示名称 |
| boolean | 传统认证标识 |
| boolean | Twitter Blue认证标识 |
| string | 作者头像URL |
| number | 作者粉丝数 |
Edge Cases
边缘情况
- Private account: Returns 0 tweets. Tell user the account is private.
- Account suspended: Returns error. Handle may be banned.
- Very active account: Use maxItems to cap and control cost ($0.0004 per extra tweet).
- Date range: Minimum 50 results needed for the query to run. If few tweets in range, widen date range.
- Retweets in results: Actor returns all public tweets including retweets.
- 私人账号:返回0条推文。需告知用户该账号为私人账号。
- 账号被封禁:返回错误信息。该账号可能已被封禁。
- 高活跃度账号:使用maxItems参数限制返回数量,控制成本(每额外一条推文收费0.0004美元)。
- 日期范围:查询需至少返回50条结果才能运行。若指定范围内推文数量较少,请扩大日期范围。
- 结果中的转发推文:该工具会返回所有公开推文,包括转发内容。