以下为本文档的中文说明
google-news-api-skill 是一个通过 BrowserAct API 自动从 Google News 提取结构化新闻数据的技能。它利用预设的工作流直接从 Google News 获取新闻结果,包括标题、来源、发布时间和文章链接等结构化信息,只需输入搜索关键词和时间过滤条件即可获得清晰可用的新闻数据。使用场景包括:当需要搜索特定主题的最新新闻时;当需要跟踪行业趋势和动态时;当需要监控品牌在媒体中的曝光和舆情时;当需要收集竞争对手的最新动态时;当需要获取特定关键词的最新报道时;当需要进行市场热点话题研究时;当需要汇总每日行业新闻简报时;当需要追踪特定人物的媒体活动时;当需要检索过去 24 小时的热点事件时;当需要提取结构化数据用于市场研究和分析时;当需要进行舆情预警和风险监控时。核心特点包括:一是无幻觉(No Hallucinations),预设的工作流直接从 Google News 提取数据,避免了 AI 生成式幻觉问题,确保数据提取的稳定性和精确性,每一条信息都可追溯到真实源头;二是无需处理验证码,不需要应对 reCAPTCHA 等验证挑战,大幅减少运维成本和人工干预;三是无 IP 限制,不需要处理区域 IP 限制或地理封锁问题,全球新闻一网打尽,适合跨国信息采集需求;四是执行速度快,相比纯 AI 驱动的浏览器自动化方案,任务执行效率更高,响应时间更短,适合实时性要求高的场景;五是成本效益好,同样工作量的运营成本远低于其他新闻采集方案;六是高度可定制,支持灵活的关键词选择和时间范围设置,并能将数据导出为 CSV、JSON 等结构化格式,便于后续分析和处理。这个技能为新闻监测和舆情分析提供了高效、可靠的数据采集方案。
Google News Automation Skill
📖 Introduction
This skill provides a one-stop news collection service using BrowserAct’s Google News API template. It directly extracts structured news results from Google News, including headlines, sources, publication times, and article links. Simply input search keywords and time filters to get clean, usable news data.
✨ Features
- No Hallucinations: Pre-set workflows avoid AI generative hallucinations, ensuring stable and precise data extraction.
- No Captcha Issues: No need to handle reCAPTCHA or other verification challenges.
- No IP Restrictions: No need to handle regional IP restrictions or geofencing.
- Faster Execution: Tasks execute faster compared to pure AI-driven browser automation solutions.
- Cost-Effective: Significantly lowers data acquisition costs compared to high-token-consuming AI solutions.
🔑 API Key Setup
Before running, check theBROWSERACT_API_KEYenvironment variable. If not set, do not take other measures; ask and wait for the user to provide it.
Agent must inform the user:
“Since you haven’t configured the BrowserAct API Key, please visit the BrowserAct Console to get your Key.”
🛠️ Input Parameters
Agent should flexibly configure the following parameters based on user needs:
Search_Keywords (Search Keywords)
- Type:
string - Description: The content to search on Google News. Can be company names, industry terms, competitor names, etc.
- Example:
AI Startup,Tesla,SpaceX
- Type:
Publish_date (Time Range)
- Type:
string - Description: Filter news by publication time.
- Options:
any time: No restrictionpast hours: Past few hours (breaking news)past 24 hours: Past 24 hours (daily monitoring)past week: Past week (short-term trends)past year: Past year (long-term research)
- Default:
past week
- Type:
Datelimit (Max Items)
- Type:
number - Description: Maximum number of news items to extract per task.
- Default:
30 - Suggestion: Use 10-30 for real-time monitoring; use larger values for deep research.
- Type:
🚀 Usage
Agent should use the following independent script to achieve “one-line command result”:
# Examplepython-u./scripts/google_news_api.py"Search Keywords""Publish Date"Quantity⏳ Execution Monitoring
Since this task involves automated browser operations, it may take some time (several minutes). The script willcontinuously output status logs with timestamps(e.g.,[14:30:05] Task Status: running).
Agent Instructions:
- While waiting for the script result, keep monitoring the terminal output.
- As long as the terminal is outputting new status logs, the task is running normally; do not mistake it for a deadlock or unresponsiveness.
- Only if the status remains unchanged for a long time or the script stops outputting without returning a result should you consider triggering the retry mechanism.
📊 Data Output
After successful execution, the script parses and prints results directly from the API response. Results include:
headline: News titlesource: Publisher/Sourcenews_link: Article URLpublished_time: Publication timeauthor: Author (if available)
⚠️ Error Handling & Retry
If an error occurs during script execution (e.g., network fluctuations or task failure), the Agent should follow this logic:
Check Output Content:
- If the outputcontains
"Invalid authorization", it means the API Key is invalid or expired.Do not retry; guide the user to re-check and provide the correct API Key. - If the outputdoes not contain
"Invalid authorization"but the task failed (e.g., output starts withError:or returns empty results), the Agent shouldautomatically try to re-execute the script once.
- If the outputcontains
Retry Limit:
- Automatic retry is limited toone time. If the second attempt fails, stop retrying an
d report the specific error information to the user.
- Automatic retry is limited toone time. If the second attempt fails, stop retrying an
🌟 Typical Use Cases
- Industry Trend Tracking: Find the latest developments in fields like “Low-altitude economy” or “Generative AI”.
- PR Monitoring: Monitor media exposure of a specific brand or company over the past 24 hours.
- Competitor Intelligence: Collect information on new products or marketing activities from competitors over the past week.
- Market Research: Get popular reports on specific keywords across different time dimensions.
- Figure Tracking: Retrieve the latest news reports on industry leaders or public figures.
- Daily News Summary: Automatically extract and summarize daily news in specific domains.
- Global Breaking News: Get real-time updates on major global events.
- Structured Data Extraction: Extract structured information like headlines, sources, and links for analysis.
- Media Exposure Analysis: Evaluate the propagation heat of a project or event in mainstream news media.
- Long-term Research: Retrieve all in-depth reports on a specific technical topic from the past year.