news-search by brave/brave-search-skills
npx skills add https://github.com/brave/brave-search-skills --skill news-search需要 API 密钥 : 请访问 https://api.search.brave.com 获取
套餐 : 包含在 搜索 套餐中。请参阅 https://api-dashboard.search.brave.com/app/subscriptions/subscribe
curl -s "https://api.search.brave.com/res/v1/news/search?q=space+exploration" \
-H "Accept: application/json" \
-H "X-Subscription-Token: ${BRAVE_SEARCH_API_KEY}"
curl -s "https://api.search.brave.com/res/v1/news/search" \
-H "Accept: application/json" \
-H "X-Subscription-Token: ${BRAVE_SEARCH_API_KEY}" \
-G \
--data-urlencode "q=cybersecurity" \
--data-urlencode "country=US" \
--data-urlencode "freshness=pd" \
--data-urlencode "count=20"
curl -s "https://api.search.brave.com/res/v1/news/search" \
-H "Accept: application/json" \
-H "X-Subscription-Token: ${BRAVE_SEARCH_API_KEY}" \
-G \
--data-urlencode "q=climate summit" \
--data-urlencode "freshness=2026-01-01to2026-01-31"
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
GET https://api.search.brave.com/res/v1/news/search
POST https://api.search.brave.com/res/v1/news/search
身份验证 : X-Subscription-Token: <API_KEY> 请求头
注意 : GET 和 POST 方法均支持。POST 方法适用于长查询或复杂的 Goggles。
| 参数 | 类型 | 必填 | 默认值 | 描述 |
|---|---|---|---|---|
q | string | 是 | - | 搜索查询 (1-400 个字符,最多 50 个单词) |
country | string | 否 | US | 搜索国家 (2 字母国家代码或 ALL) |
search_lang | string | 否 | en | 语言偏好 (2+ 字符语言代码) |
ui_lang | string | 否 | en-US | 界面语言 (例如 "en-US") |
count | int | 否 | 20 | 结果数量 (1-50) |
offset | int | 否 | 0 | 分页偏移量 (0-9) |
safesearch | string | 否 | strict | 成人内容过滤器 (off/moderate/strict) |
freshness | string | 否 | - | 时间过滤器 (pd/pw/pm/py 或日期范围) |
spellcheck | bool | 否 | true | 自动纠正查询 |
extra_snippets | bool | 否 | - | 每个结果最多 5 个额外摘要 |
goggles | string or array | 否 | - | 自定义排名过滤器 (URL 或内联;重复参数可指定多个) |
operators | bool | 否 | true | 应用搜索运算符 |
include_fetch_metadata | bool | 否 | false | 在结果中包含抓取时间戳 |
| 值 | 描述 |
|---|---|
pd | 过去一天 (24 小时) - 适用于突发新闻 |
pw | 过去一周 (7 天) |
pm | 过去一个月 (31 天) |
py | 过去一年 (365 天) |
YYYY-MM-DDtoYYYY-MM-DD | 自定义日期范围 |
{
"type": "news",
"query": {
"original": "space exploration"
},
"results": [
{
"type": "news_result",
"title": "New Developments in Space Exploration",
"url": "https://news.example.com/space-exploration",
"description": "Recent missions have advanced our understanding of...",
"age": "2 hours ago",
"page_age": "2026-01-15T14:30:00",
"page_fetched": "2026-01-15T15:00:00Z",
"meta_url": {
"scheme": "https",
"netloc": "news.example.com",
"hostname": "news.example.com",
"favicon": "https://imgs.search.brave.com/favicon/news.example.com",
"path": "/space-exploration"
},
"thumbnail": {
"src": "https://imgs.search.brave.com/..."
}
}
]
}
| 字段 | 类型 | 描述 |
|---|---|---|
type | string | 始终为 "news" |
query.original | string | 原始搜索查询 |
query.altered | string? | 拼写检查纠正后的查询 (如果已更改) |
query.cleaned | string? | 拼写检查器清理/规范化后的查询 |
query.spellcheck_off | bool? | 拼写检查是否被禁用 |
query.show_strict_warning | bool? | 如果严格安全搜索阻止了结果,则为 true |
query.search_operators | object? | 应用的搜索运算符 |
query.search_operators.applied | bool | 运算符是否被应用 |
query.search_operators.cleaned_query | string? | 运算符处理后的查询 |
query.search_operators.sites | list[str]? | 来自 site: 运算符的域名 |
results[].type | string | 始终为 "news_result" |
results[].title | string | 文章标题 |
results[].url | string | 文章源 URL |
results[].description | string? | 文章描述/摘要 |
results[].age | string? | 人类可读的时间 (例如 "2 hours ago") |
results[].page_age | string? | 来源的发布日期 (ISO 日期时间) |
results[].page_fetched | string? | 页面最后抓取时间 (ISO 日期时间) |
results[].fetched_content_timestamp | int? | 抓取时间戳 (仅在 include_fetch_metadata=true 时提供) |
results[].meta_url.scheme | string? | URL 协议方案 |
results[].meta_url.netloc | string? | 网络位置 |
results[].meta_url.hostname | string? | 小写的域名 |
results[].meta_url.favicon | string? | 网站图标 URL |
results[].meta_url.path | string? | URL 路径 |
results[].thumbnail.src | string | 提供的缩略图 URL |
results[].thumbnail.original | string? | 原始缩略图 URL |
results[].extra_snippets | list[str]? | 每个结果最多 5 个额外摘要 |
Goggles 允许您 重新排序新闻结果 — 提升可信来源或抑制不需要的来源。
| 方法 | 示例 |
|---|---|
| 托管式 | --data-urlencode "goggles=https://raw.githubusercontent.com/brave/goggles-quickstart/main/goggles/hacker_news.goggle" |
| 内联式 | --data-urlencode 'goggles=$discard\n$site=example.com' |
托管式 goggles 必须托管在 GitHub/GitLab 上,包含
! name:、! description:、! author:头部信息,并在 https://search.brave.com/goggles/create 注册。内联式 规则无需注册。
语法 : $boost=N / $downrank=N (1–10), $discard, $site=example.com。用逗号组合: $site=example.com,boost=3。用 \n (%0A) 分隔规则。
允许列表 : $discard\n$site=docs.python.org\n$site=developer.mozilla.org — 阻止列表 : $discard,site=pinterest.com\n$discard,site=quora.com
使用搜索运算符来优化结果:
site:local-paper.com - 限制在特定的新闻网站"exact phrase" - 匹配精确短语-exclude - 排除术语设置 operators=false 以禁用运算符解析。
freshness=pd 获取某个主题的最新文章。freshness=YYYY-MM-DDtoYYYY-MM-DD 查找特定时间段的文章。country、search_lang 和 ui_lang 获取跨区域的结果。include_fetch_metadata=true 以获取每个结果的 fetched_content_timestamp。strictoffset (0-9) 和 countextra_snippets=true 时,最多提供 5 个额外摘要每周安装次数
62
代码仓库
GitHub 星标数
71
首次出现
2026 年 2 月 13 日
安全审计
安装于
gemini-cli59
codex59
github-copilot58
opencode58
kimi-cli58
amp57
Requires API Key : Get one at https://api.search.brave.com
Plan : Included in the Search plan. See https://api-dashboard.search.brave.com/app/subscriptions/subscribe
curl -s "https://api.search.brave.com/res/v1/news/search?q=space+exploration" \
-H "Accept: application/json" \
-H "X-Subscription-Token: ${BRAVE_SEARCH_API_KEY}"
curl -s "https://api.search.brave.com/res/v1/news/search" \
-H "Accept: application/json" \
-H "X-Subscription-Token: ${BRAVE_SEARCH_API_KEY}" \
-G \
--data-urlencode "q=cybersecurity" \
--data-urlencode "country=US" \
--data-urlencode "freshness=pd" \
--data-urlencode "count=20"
curl -s "https://api.search.brave.com/res/v1/news/search" \
-H "Accept: application/json" \
-H "X-Subscription-Token: ${BRAVE_SEARCH_API_KEY}" \
-G \
--data-urlencode "q=climate summit" \
--data-urlencode "freshness=2026-01-01to2026-01-31"
GET https://api.search.brave.com/res/v1/news/search
POST https://api.search.brave.com/res/v1/news/search
Authentication : X-Subscription-Token: <API_KEY> header
Note : Both GET and POST are supported. POST is useful for long queries or complex Goggles.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
q | string | Yes | - | Search query (1-400 chars, max 50 words) |
country | string | No | US | Search country (2-letter country code or ALL) |
search_lang | string | No |
| Value | Description |
|---|---|
pd | Past day (24 hours) - ideal for breaking news |
pw | Past week (7 days) |
pm | Past month (31 days) |
py | Past year (365 days) |
YYYY-MM-DDtoYYYY-MM-DD | Custom date range |
{
"type": "news",
"query": {
"original": "space exploration"
},
"results": [
{
"type": "news_result",
"title": "New Developments in Space Exploration",
"url": "https://news.example.com/space-exploration",
"description": "Recent missions have advanced our understanding of...",
"age": "2 hours ago",
"page_age": "2026-01-15T14:30:00",
"page_fetched": "2026-01-15T15:00:00Z",
"meta_url": {
"scheme": "https",
"netloc": "news.example.com",
"hostname": "news.example.com",
"favicon": "https://imgs.search.brave.com/favicon/news.example.com",
"path": "/space-exploration"
},
"thumbnail": {
"src": "https://imgs.search.brave.com/..."
}
}
]
}
| Field | Type | Description |
|---|---|---|
type | string | Always "news" |
query.original | string | The original search query |
query.altered | string? | Spellcheck-corrected query (if changed) |
query.cleaned | string? | Cleaned/normalized query from spellchecker |
query.spellcheck_off |
Goggles let you re-rank news results — boost trusted outlets or suppress unwanted sources.
| Method | Example |
|---|---|
| Hosted | --data-urlencode "goggles=https://raw.githubusercontent.com/brave/goggles-quickstart/main/goggles/hacker_news.goggle" |
| Inline | --data-urlencode 'goggles=$discard\n$site=example.com' |
Hosted goggles must be on GitHub/GitLab, include
! name:,! description:,! author:headers, and be registered at https://search.brave.com/goggles/create. Inline rules need no registration.
Syntax : $boost=N / $downrank=N (1–10), $discard, $site=example.com. Combine with commas: $site=example.com,boost=3. Separate rules with \n (%0A).
Allow list : $discard\n$site=docs.python.org\n$site=developer.mozilla.org — Block list : $discard,site=pinterest.com\n$discard,site=quora.com
Resources : Discover · Syntax · Quickstart
Use search operators to refine results:
site:local-paper.com - Limit to specific news site"exact phrase" - Match exact phrase-exclude - Exclude termSet operators=false to disable operator parsing.
freshness=pd for the most recent articles on a topic.freshness=YYYY-MM-DDtoYYYY-MM-DD to find articles from specific time periods.country, search_lang, and ui_lang for cross-locale results.include_fetch_metadata=true for fetched_content_timestamp on each result.strictoffset (0-9) with countextra_snippets=trueWeekly Installs
62
Repository
GitHub Stars
71
First Seen
Feb 13, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
gemini-cli59
codex59
github-copilot58
opencode58
kimi-cli58
amp57
Lark Base CLI 使用指南:数据查询、公式与查找字段操作详解
23,600 周安装
en |
| Language preference (2+ char language code) |
ui_lang | string | No | en-US | UI language (e.g., "en-US") |
count | int | No | 20 | Number of results (1-50) |
offset | int | No | 0 | Page offset (0-9) |
safesearch | string | No | strict | Adult content filter (off/moderate/strict) |
freshness | string | No | - | Time filter (pd/pw/pm/py or date range) |
spellcheck | bool | No | true | Auto-correct query |
extra_snippets | bool | No | - | Up to 5 additional excerpts per result |
goggles | string or array | No | - | Custom ranking filter (URL or inline; repeat param for multiple) |
operators | bool | No | true | Apply search operators |
include_fetch_metadata | bool | No | false | Include fetch timestamps in results |
| bool? |
| Whether spellcheck was disabled |
query.show_strict_warning | bool? | True if strict safesearch blocked results |
query.search_operators | object? | Applied search operators |
query.search_operators.applied | bool | Whether operators were applied |
query.search_operators.cleaned_query | string? | Query after operator processing |
query.search_operators.sites | list[str]? | Domains from site: operators |
results[].type | string | Always "news_result" |
results[].title | string | Article title |
results[].url | string | Source URL of the article |
results[].description | string? | Article description/summary |
results[].age | string? | Human-readable age (e.g. "2 hours ago") |
results[].page_age | string? | Publication date from source (ISO datetime) |
results[].page_fetched | string? | When page was last fetched (ISO datetime) |
results[].fetched_content_timestamp | int? | Fetch timestamp (only with include_fetch_metadata=true) |
results[].meta_url.scheme | string? | URL protocol scheme |
results[].meta_url.netloc | string? | Network location |
results[].meta_url.hostname | string? | Lowercased domain name |
results[].meta_url.favicon | string? | Favicon URL |
results[].meta_url.path | string? | URL path |
results[].thumbnail.src | string | Served thumbnail URL |
results[].thumbnail.original | string? | Original thumbnail URL |
results[].extra_snippets | list[str]? | Up to 5 additional excerpts per result |