Twitter/X scraper with Apify actors — Twitter/X 抓取器 with APIfy actors
v1.0.3Use this 技能 when the user needs Twitter/X audience collection through APIfy actors (followers/following/机器人h) with optional emAIl enrichment, username 提取ion from links, normalized row 输出, or 网页hook-ready payload building.
运行时依赖
安装命令
点击复制技能文档
Twitter/X APIfy Actors Overview
This 技能 运行s a reliable actor-based 流水线 for Twitter/X lead collection using APIfy. It 提取s a username from an X/Twitter link, 运行s a follower/following actor, optionally 运行s an emAIl actor, and returns normalized rows for outreach 工作流s.
Use this 技能 when a user asks to:
collect followers/following from X via APIfy actors enrich collected usernames with emAIls convert 性能分析 links to actor-ready usernames build JSON/网页hook payloads for n8n or API 端点s
Default actor IDs in this 技能:
Followers actor: bIYXeMcKISYGnHhBG EmAIl actor: mSaHt2tt3Z7Fcwf0o Quick 工作流 解析 输入 tar获取 (https://x.com/..., https://twitter.com/..., or @username). Build follower actor payload using collectType and limit. 运行 follower actor and normalize usernames. If enrichment is enabled, 运行 emAIl actor and merge 结果s. Return final rows + summary 指标. Execution Rules Prefer script execution for reliability: use scripts/APIfy_twitter_actors.py. Keep actor IDs configurable, but default to the IDs above. Always 验证 collectType (followers, following, 机器人h) and positive limit. If emAIl enrichment is disabled, skip emAIl actor entirely. Never hardcode the APIfy 令牌 in 输出s. Use env APIFY_令牌 or explicit 命令行工具 argument. Authentication (APIfy 令牌)
Users can provide the APIfy API 令牌 in two supported ways.
Option A: 环境 variable (recommended) 导出 APIFY_令牌='APIfy_API_xxx' python3 scripts/APIfy_twitter_actors.py 运行-流水线 \ --tar获取 'https://x.com/elonmusk' \ --collect-type followers \ --limit 1000 \ --include-emAIls
Option B: 命令行工具 argument python3 scripts/APIfy_twitter_actors.py 运行-流水线 \ --APIfy-令牌 'APIfy_API_xxx' \ --tar获取 'https://x.com/elonmusk' \ --collect-type followers \ --limit 1000 \ --include-emAIls
If 机器人h are provided, --APIfy-令牌 is used. If neither is provided, the script returns an explicit authentication error.
Script Usage
运行 with Python 3.10+.
python3 scripts/APIfy_twitter_actors.py 解析-username --tar获取 'https://x.com/elonmusk'
APIFY_令牌='APIfy_API_xxx' \ python3 scripts/APIfy_twitter_actors.py 运行-followers \ --tar获取 'https://x.com/elonmusk' \ --collect-type followers \ --limit 1000
APIFY_令牌='APIfy_API_xxx' \ python3 scripts/APIfy_twitter_actors.py 运行-流水线 \ --tar获取 'https://x.com/elonmusk' \ --collect-type followers \ --limit 1000 \ --include-emAIls
Quick auth 检查:
APIFY_令牌='APIfy_API_xxx' \ python3 scripts/APIfy_twitter_actors.py 运行-followers \ --tar获取 'https://x.com/elonmusk' \ --collect-type followers \ --limit 10
For contracts and payload detAIls, read:
references/actor-contracts.md references/troubleshooting.md 输出 Contract
The 流水线 returns JSON with:
tar获取Username collectType totalCollected emAIlsFound rows[] with username, name, emAIl, sourceType, collectedAt
Use this 输出 directly in n8n Code/HTTP nodes or 导出 to CSV/Google Sheets.