此技能用于在用户请求“查找YouTube频道邮箱”“抓取YouTube联系信息”“获取YouTuber邮箱地址”“提取YouTube频道信息...”时使用。
YouTube 电子邮件 Scraper 附带 Apify. 从YouTube 频道查找电子邮件地址和联系信息是一项面向实际任务的技能,主要用于通过关键词搜索或直接提供频道 URL;用于影响者外联, 赞助商。
从功能定位来看,该技能强调把分散的操作要求整理成清晰、可复用的处理流程,使用户能够围绕既定目标快速准备输入、选择执行方式并获得结构化结果。实际使用前应先确认任务范围、数据来源、运行环境、必要权限和关键参数,再依据技能说明逐步执行;
若输入条件不完整,应先补齐信息或采用保守配置,避免因错误假设导致结果偏离需求。执行过程中需要关注工具调用是否成功、接口或依赖是否可用、输出格式是否符合预期,并对异常提示、缺失字段和边界情况进行处理;涉及批量任务时,还应保存进度,避免中断后重复操作。
从 YouTube 频道中提取邮箱地址及联系信息。支持按关键词搜索,或直接提供频道 URL。适用于网红合作对接、赞助洽谈与潜在客户开发。
Actor:futurizerush/youtube-email-scraper
在环境变量中设置 APIFY_API_TOKEN。可在 console.apify.com/account/integrations 获取 Token。
Apify 的运行是异步的。每次请求均需经历以下三个步骤:
SUCCEEDED典型运行耗时:30–120 秒,具体取决于频道数量。
| 参数 | 类型 | 是否必需 | 说明 |
|---|---|---|---|
inputMode |
字符串 | 是 | "directUrls" 或 "keywordSearch" |
channelUrls |
字符串数组 | 仅在 directUrls 模式下必需 |
YouTube 频道 URL 列表 |
searchKeywords |
字符串数组 | 仅在 keywordSearch 模式下必需 |
用于搜索频道的关键词列表 |
maxChannelsPerKeyword |
整数 | 否 | 每个关键词最多匹配的频道数,默认值:50 |
maxResults |
整数 | 否 | 总结果上限,默认值:100 |
locale |
字符串 | 否 | 搜索所用地区设置,默认值:"US" |
directUrls —— 精确抓取指定频道,需提供 channelUrls 参数。keywordSearch —— 先通过关键词查找频道,再从中提取联系方式,需提供 searchKeywords 参数。import requests, os, time
TOKEN = os.environ["APIFY_API_TOKEN"]
BASE = "https://api.apify.com/v2"
# 第一步:启动运行
response = requests.post(
f"{BASE}/acts/futurizerush~youtube-email-scraper/runs?token={TOKEN}",
json={
"inputMode": "keywordSearch",
"searchKeywords": ["AI automation"],
"maxChannelsPerKeyword": 10,
"maxResults": 10,
"locale": "US",
},
)
response.raise_for_status()
run = response.json()["data"]
run_id = run["id"]
dataset_id = run["defaultDatasetId"]
# 第二步:轮询直至完成
while True:
status = requests.get(
f"{BASE}/actor-runs/{run_id}?token={TOKEN}"
).json()["data"]["status"]
if status == "SUCCEEDED":
break
if status in ("FAILED", "ABORTED", "TIMED-OUT"):
raise RuntimeError(f"Run failed: {status}")
time.sleep(5)
# 第三步:获取结果(JSON 数组)
items = requests.get(
f"{BASE}/datasets/{dataset_id}/items?token={TOKEN}"
).json()
# 筛选含邮箱的频道
for channel in items:
if channel["hasEmails"]:
print(f"{channel['channelName']} ({channel['subscriberCount']} subs)")
print(f" Emails: {', '.join(channel['emails'])}")
print(f" URL: {channel['channelUrl']}")
requests.post(
f"{BASE}/acts/futurizerush~youtube-email-scraper/runs?token={TOKEN}",
json={
"inputMode": "directUrls",
"channelUrls": [
"https://www.youtube.com/@mkbhd",
"https://www.youtube.com/@nateherk",
],
},
)
# 第一步:启动运行
RUN_RESPONSE=$(curl -s -X POST
"https://api.apify.com/v2/acts/futurizerush~youtube-email-scraper/runs?token=$APIFY_API_TOKEN"
-H "Content-Type: application/json"
-d '{"inputMode": "keywordSearch", "searchKeywords": ["AI automation"], "maxChannelsPerKeyword": 10, "maxResults": 10}')
RUN_ID=$(echo "$RUN_RESPONSE" | jq -r '.data.id')
DATASET_ID=$(echo "$RUN_RESPONSE" | jq -r '.data.defaultDatasetId')
# 第二步:轮询直至完成
while true; do
STATUS=$(curl -s "https://api.apify.com/v2/actor-runs/$RUN_ID?token=$APIFY_API_TOKEN"
| jq -r '.data.status')
[ "$STATUS" = "SUCCEEDED" ] && break
[ "$STATUS" = "FAILED" ] || [ "$STATUS" = "ABORTED" ] && echo "Failed: $STATUS" && exit 1
sleep 5
done
# 第三步:获取结果
curl -s "https://api.apify.com/v2/datasets/$DATASET_ID/items?token=$APIFY_API_TOKEN" | jq '.'
结果数组中的每一项(字段名已基于 2026-04-11 实际 API 返回验证):
{
"channelName": "Nate Herk | AI Automation",
"subscriberCount": "645.0K",
"channelUrl": "https://www.youtube.com/@nateherk",
"channelDescription": "Hi, I'm Nate Herk. I'm passionate about...",
"joinDate": "Nov 17, 2013",
"viewCount": 405328,
"videoCount": 383,
"location": null,
"contactInfo": {
"emails": ["sponsorships@nateherk.com"],
"websites": ["https://nateherk.com/"],
"socialMedia": {}
},
"emails": ["sponsorships@nateherk.com"],
"websites": ["https://nateherk.com/"],
"socialMedia": {},
"emailCount": 1,
"hasEmails": true,
"descriptionUrls": [],
"extractedAt": "2026-04-11T06:07:13.204Z",
"processingSuccess": true,
"searchKeyword": "AI automation"
}
注意: 字段名采用 camelCase 命名法。emails 数组为便于使用的扁平化字段;相同数据亦存在于 contactInfo.emails 中。建议使用 hasEmails 字段快速筛选出公开邮箱的频道。
| 错误 | 原因 | 修复方式 |
|---|---|---|
| 401 Unauthorized | API Token 无效或缺失 | 检查 APIFY_API_TOKEN 是否正确配置 |
invalid-input: "must be equal to one of the allowed values" |
inputMode 值不合法 |
请严格使用 "directUrls" 或 "keywordSearch"(大小写与引号均需完全一致) |
| 未找到邮箱 | 目标频道未在公开页面中展示邮箱 | 尝试更多频道或更换关键词 |
hasEmails: true 快速筛选出公开邮箱的频道。subscriberCount 为字符串类型(例如 "645.0K"),而非数值类型。contactInfo 包含结构化联系信息;根层级的 emails 和 websites 是为方便访问而提供的扁平化数组。searchKeyword 字段标明了命中该频道所使用的搜索词(多关键词场景下尤为有用)。