YouTube Channel API Skill
📖 Introduction
This skill provides users with a one-stop channel data extraction service through BrowserAct's YouTube Channel API template. It can directly extract structured channel results from YouTube search. By simply entering search keywords and optional upload date filters, you can get clean, usable channel data directly.
✨ Features
- 1. No hallucinations, ensuring stable and accurate data extraction: Pre-set workflows to avoid AI generative hallucinations.
- No CAPTCHA issues: No need to handle reCAPTCHA or other verification challenges.
- No IP restrictions or geo-blocking: No need to handle regional IP restrictions.
- Faster execution: Faster task execution compared to purely AI-driven browser automation solutions.
- High cost-effectiveness: Significantly reduces data acquisition costs compared to AI solutions that consume a large number of tokens.
🔑 API Key Guide
Before running, you must first check the
BROWSERACT_API_KEY environment variable. If it is not set, do not take any other actions; you should request and wait for the user to provide it.
The Agent must inform the user at this point:
"Since you have not configured the BrowserAct API Key yet, please go to the BrowserAct Console to get your Key."
🛠️ Input Parameters
Agent should flexibly configure the following parameters according to user needs when calling the script:
- 1. KeyWords
-
Type:
string
-
Description: Search keywords used to find YouTube channels.
-
Example:
AI,
automation, INLINECODE4
- 2. Upload_date
-
Type:
string
-
Description: Filter channels that have published content within a defined time window.
-
Optional Values:
This week,
Any time, etc.
-
Default: INLINECODE8
🚀 Usage
Agent should execute the following standalone script to achieve "one command gets results":
CODEBLOCK0
⏳ Running Status Monitoring
Since this task involves automated browser operations, it may take a long time (several minutes). The script will
continuously output status logs with timestamps (e.g.,
[14:30:05] Task Status: running) while running.
Agent Notes:
- - While waiting for the script to return results, please keep an eye on the terminal output.
- As long as the terminal continues to output new status logs, it means the task is running normally. Do not misjudge it as a deadlock or unresponsiveness.
- If the status remains unchanged for a long time or the script stops outputting without returning a result, then consider triggering the retry mechanism.
📊 Data Output
After successful execution, the script will directly parse and print the results from the API response. The results include:
- -
channel_title: Channel name displayed on YouTube - INLINECODE11 : Channel page URL
- INLINECODE12 : Whether the channel is verified
- INLINECODE13 : Channel handle
- INLINECODE14 : Subscriber count
- INLINECODE15 : Channel description text
- INLINECODE16 : Channel avatar or thumbnail image URL
⚠️ Error Handling & Retry
During the execution of the script, if an error occurs (such as network fluctuations or task failure), the Agent should follow this logic:
- 1. Check the output content:
- If the output
contains "Invalid authorization", it means the API Key is invalid or expired. At this point,
do not retry; you should guide the user to recheck and provide the correct API Key.
- If the output
does not contain "Invalid authorization" but the task execution fails (for example, the output starts with
Error: or returns empty results), the Agent should
automatically try to execute the script one more time.
- 2. Retry limit:
- Automatic retry is limited to
once. If the second attempt still fails, stop retrying and report the specific error message to the user.
🌟 Typical Use Cases
- 1. Creator Discovery: Find channels related to specific topics for outreach.
- Influencer Sourcing: Identify potential influencers in specific industries.
- Competitive Landscape Mapping: Track competitors' channel growth and updates.
- Channel Database Building: Extract structured data for building creator databases.
- Content Trend Tracking: Monitor new channels popping up around a specific keyword.
- Market Research: Collect data on leading YouTube channels in a target niche.
- Brand Monitoring: Track unofficial or related channels discussing your brand.
- Audience Analysis: Assess the size of audiences in specific fields via subscriber counts.
- Partnership Campaigns: Find active channels that uploaded videos recently.
- Automated Data Enrichment: Pipe YouTube channel details into CRMs or internal tools.
YouTube 频道 API 技能
📖 简介
本技能通过 BrowserAct 的 YouTube 频道 API 模板,为用户提供一站式频道数据提取服务。它可以直接从 YouTube 搜索中提取结构化的频道结果。只需输入搜索关键词和可选的发布日期筛选条件,即可直接获取干净、可用的频道数据。
✨ 功能特点
- 1. 无幻觉,确保稳定准确的数据提取:预设工作流程,避免 AI 生成式幻觉。
- 无验证码问题:无需处理 reCAPTCHA 或其他验证挑战。
- 无 IP 限制或地域封锁:无需处理区域 IP 限制。
- 执行速度更快:与纯 AI 驱动的浏览器自动化解决方案相比,任务执行速度更快。
- 高性价比:与消耗大量 Token 的 AI 解决方案相比,显著降低数据获取成本。
🔑 API 密钥指南
运行前,必须首先检查 BROWSERACT
APIKEY 环境变量。如果未设置,请勿执行任何其他操作;应请求并等待用户提供。
此时 Agent 必须告知用户:
由于您尚未配置 BrowserAct API 密钥,请前往 BrowserAct 控制台 获取您的密钥。
🛠️ 输入参数
Agent 在调用脚本时应根据用户需求灵活配置以下参数:
- 1. 关键词
-
类型:string
-
描述:用于搜索 YouTube 频道的搜索关键词。
-
示例:AI、自动化、科技评测
- 2. 上传日期
-
类型:string
-
描述:筛选在特定时间范围内发布过内容的频道。
-
可选值:本周、任意时间 等。
-
默认值:任意时间
🚀 使用方法
Agent 应执行以下独立脚本,实现一键获取结果:
bash
示例调用
python -u ./scripts/youtube
channelapi.py 搜索关键词 上传日期
⏳ 运行状态监控
由于此任务涉及自动化浏览器操作,可能需要较长时间(数分钟)。脚本在运行时会
持续输出带有时间戳的状态日志(例如 [14:30:05] 任务状态:运行中)。
Agent 注意事项:
- - 在等待脚本返回结果期间,请密切关注终端输出。
- 只要终端持续输出新的状态日志,即表示任务正常运行。请勿误判为死锁或无响应。
- 如果状态长时间保持不变,或脚本停止输出且未返回结果,则考虑触发重试机制。
📊 数据输出
执行成功后,脚本将直接从 API 响应中解析并打印结果。结果包括:
- - channeltitle:YouTube 上显示的频道名称
- channellink:频道页面 URL
- verified:频道是否经过验证
- handle:频道句柄
- subscribers:订阅者数量
- description:频道描述文本
- thumbnail:频道头像或缩略图图片 URL
⚠️ 错误处理与重试
在脚本执行过程中,如果发生错误(如网络波动或任务失败),Agent 应遵循以下逻辑:
- 1. 检查输出内容:
- 如果输出
包含 Invalid authorization,则表示 API 密钥无效或已过期。此时
请勿重试,应引导用户重新检查并提供正确的 API 密钥。
- 如果输出
不包含 Invalid authorization,但任务执行失败(例如输出以 Error: 开头或返回空结果),Agent 应
自动尝试重新执行脚本一次。
- 2. 重试限制:
- 自动重试限制为
一次。如果第二次尝试仍然失败,请停止重试并向用户报告具体的错误信息。
🌟 典型使用场景
- 1. 创作者发现:查找与特定主题相关的频道,用于外展合作。
- 网红资源挖掘:识别特定行业的潜在网红。
- 竞争格局分析:追踪竞争对手的频道增长和更新情况。
- 频道数据库构建:提取结构化数据,用于构建创作者数据库。
- 内容趋势追踪:监控围绕特定关键词涌现的新频道。
- 市场调研:收集目标细分领域领先 YouTube 频道的数据。
- 品牌监控:追踪讨论您品牌的非官方或相关频道。
- 受众分析:通过订阅者数量评估特定领域的受众规模。
- 合作活动策划:寻找近期上传视频的活跃频道。
- 自动化数据丰富:将 YouTube 频道详情导入 CRM 或内部工具。