360 Secure SkillHub
360 安全技能中心

Google News API - Headlines by Keyword, Topic, Publication

通过 Scavio 的 Google News 接口检索新闻头条,支持关键词、主题、栏目、故事、出版物、实体 ID、地区与语言筛选,返回标题、来源、日期和链接等结构化信息。

分类:搜索
scavio-ai
scavio-ai
热度 14.14
最近更新 2026-11-29 16:19:22

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add scavio-ai/google-news-api
兼容性
通用兼容
联网要求
需要联网
数据出网
必须出网
Metadata
name
google-news-api
description
Search Google News for headlines by keyword, topic, or publication as structured JSON — headline, source, date, and link. Use for current events, monitoring, and news research. v2 engine, 1 credit per request.
version
1.0.0
tags
google-news, news, headlines, current-events, media-monitoring, journalism, agents, langchain, crewai, autogen, structured-data, json, ai-agents, research
metadata
{"openclaw":{"requires":{"env":["SCAVIO_API_KEY"]},"primaryEnv":"SCAVIO_API_KEY","timeout":90,"throttle":1,"emoji":"📰","homepage":"https://scavio.dev/docs/google-news?utm_source=agent-skills&utm_medium=skill&utm_campaign=google-news-api"}}

Google News via Scavio (v2)

Search Google News and return structured JSON — headline, source, date, and link — for a keyword, topic, section, or publication. One credit per request.

When to trigger

Use this skill when the user asks to:

  • Find recent news or headlines on a topic
  • Monitor a company, person, or keyword in the news
  • Follow a Google News topic, section, or publication
  • Answer a current-events question that needs fresh reporting

Always call the API for time-sensitive news — never answer from training data.

Setup

Get a free API key at scavio.dev (50 free credits to get started, no card required):

export SCAVIO_API_KEY=sk_live_your_key

If you do not have a key yet

An agent running this skill without SCAVIO_API_KEY set will get 401 on every call below. The whole path from nothing to a working key is self-serve:

  1. Sign up at dashboard.scavio.dev - email or Google, no card required.
  2. A key is created for the account automatically at signup. It is on the dashboard under API Keys, ready to copy.
  3. A new account starts with 50 credits. Endpoints in this skill cost 1 credit each unless the table below says otherwise.

When the balance runs out the API answers 402 with a JSON body carrying billing_url. Topping up needs no code change - the same key keeps working. The smallest purchase is 2,500 credits for $25, and monthly plans work out cheaper per credit if the usage is steady rather than one-off.

Endpoint

POST https://api.scavio.dev/api/v2/google/news
Authorization: Bearer $SCAVIO_API_KEY

Every request costs 1 credit.

Workflow

  1. Keyword search: pass query. Add so: 1 to sort by date instead of relevance.
  2. Localize: set gl (country) and hl (language) for regional editions.
  3. Browse structured feeds: pass a topic_token, section_token, story_token, publication_token, or kgmid (returned in prior responses) to drill into a topic, section, full-coverage story, or publisher.
  4. Read news_results[] for headlines, sources, dates, and links. Some items are clusters: they carry a title and a stories[] array (each story has its own title, link, source, date) instead of a link. Flatten them before listing headlines.
  5. menu_links[] (the News sections) and related_topics[] carry topic_tokens you can pass back to browse that topic.

Parameters

Parameter Type Default Description
query string -- Keyword search (one of query or a token/kgmid is required)
so number 0 0 relevance, 1 date (valid with query/kgmid)
topic_token string -- Browse a Google News topic
section_token string -- Browse a section within a topic
story_token string -- Full-coverage story
publication_token string -- A specific publisher's feed
kgmid string -- Knowledge Graph entity id (e.g. /m/02_286)
hl string -- UI language, ISO 639-1
gl string -- Geo country, ISO 3166-1 alpha-2
google_domain string google.com Regional Google domain

Example

import requests

# Your key from https://scavio.dev. Load it from your environment or secret
# store in real code - keep it out of source control.
API_KEY = "sk_your_key_here"

response = requests.post(
    "https://api.scavio.dev/api/v2/google/news",
    headers={"Authorization": f"Bearer {API_KEY}"},
    json={"query": "openai", "gl": "us", "hl": "en", "so": 1},
)
data = response.json()
for n in data["news_results"]:
    # A cluster has stories[] instead of a link of its own
    for story in n.get("stories", [n]):
        print(story.get("date"), story.get("source", {}).get("name"), story.get("title"))
        print(" ", story.get("link"))

Response

Trimmed live capture of {"query": "Nvidia", "gl": "us", "hl": "en", "so": 1}, which returned 99 items, 3 of them clusters. search_parameters echoes so as the string "1".

{
  "search_parameters": {
    "engine": "google_news",
    "q": "Nvidia",
    "google_domain": "google.com",
    "hl": "en",
    "gl": "us",
    "so": "1"
  },
  "news_results": [
    {
      "position": 1,
      "title": "News about Nvidia • Stock",
      "stories": [
        {
          "position": 1,
          "title": "Stocks snap from a $6 trillion washout to a $3.5 trillion surge as Nvidia, Micron, and SpaceX bounce back",
          "link": "https://finance.yahoo.com/markets/article/stocks-snap-from-a-6-trillion-washout-to-a-3-trillion-surge-as-nvidia-micron-and-spacex-bounce-back-151218930.html",
          "source": { "name": "Yahoo Finance", "title": "Yahoo Finance", "authors": ["Jared Blikre"] },
          "date": "1 day ago",
          "iso_date": "2026-11-27T18:32:22Z",
          "topic_token": "CAAqKAgKIiJDQkFTRXdvTkwyY3ZNVEZuWW1wM2JtSnNYeElDWlc0b0FBUAE",
          "publication_token": "CAAqLQgKIidDQklTRndnTWFoTUtFV1pwYm1GdVkyVXVlV0ZvYjI4dVkyOXRLQUFQAQ"
        }
      ]
    },
    {
      "position": 2,
      "title": "5 lightning-quick cartoons about Nvidia reinstating Jensen Huang",
      "link": "https://theweek.com/cartoons/5-lightning-quick-cartoons-about-nvidia-reinstating-jensen-huang",
      "source": { "name": "The Week", "title": "The Week" },
      "date": "53 minutes ago",
      "iso_date": "2026-11-29T07:00:00Z",
      "thumbnail": "https://cdn.mos.cms.futurecdn.net/6mmQqXJEr9maiHwQ6WKMLf.jpg",
      "publication_token": "CAAqJQgKIh9DQklTRVFnTWFnMEtDM1JvWlhkbFpXc3VZMjl0S0FBUAE"
    }
  ],
  "menu_links": [
    { "position": 1, "title": "U.S.", "topic_token": "CAAqIggKIhxDQkFTRHdvSkwyMHZNRGxqTjNjd0VnSmxiaWdBUAE" },
    { "position": 5, "title": "Technology", "topic_token": "CAAqJggKIiBDQkFTRWdvSUwyMHZNRGRqTVhZU0FtVnVHZ0pWVXlnQVAB" }
  ],
  "related_topics": [
    { "position": 1, "title": "Nvidia", "topic_token": "CAAqIQgKIhtDQkFTRGdvSUwyMHZNRGx5YUY4U0FtVnVLQUFQAQ" },
    { "position": 4, "title": "Nvidia GTC", "topic_token": "CAAqKAgKIiJDQkFTRXdvTkwyY3ZNVEZ5WkY5NGVITnNhaElDWlc0b0FBUAE" }
  ],
  "response_time": 2585,
  "credits_used": 1,
  "cached": false
}

Source objects also carry an icon, and items carry thumbnail_small. In this capture each cluster held 3 stories.

Guardrails

  • Each call costs 1 credit. Inform the user before paginating widely.
  • Never fabricate headlines, sources, dates, or links. Only return API data.
  • One of query, kgmid, or a *_token must be provided.
  • so (relevance vs date) only applies to query/kgmid requests.
  • Cite the source and link when summarizing news. For a cluster, cite each story's own link; the cluster itself has none.

Failure handling

  • 400 means an invalid parameter (e.g. no query and no token) — fix and retry.
  • 401 means the API key is invalid or missing. Check SCAVIO_API_KEY.
  • 429 means rate or usage limit exceeded. Wait before retrying. See rate limits.
  • 502 / 503 mean upstream is temporarily unavailable. Wait a few seconds before retrying.
  • If no results are returned, broaden the query or drop the date sort.
  • If SCAVIO_API_KEY is not set, prompt the user to export it before continuing.