news-search

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

News Search

新闻搜索

Requires API Key: Get one at https://api.search.brave.com
需要API Key:可前往https://api.search.brave.com获取
套餐:包含在Search套餐中。详情请见https://api-dashboard.search.brave.com/app/subscriptions/subscribe

Quick Start (cURL)

快速开始(cURL)

Basic Search

基础搜索

bash
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}"
bash
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}"

Recent News (Past 24 Hours)

近期新闻(过去24小时)

bash
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"
bash
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"

Date Range Filter

日期范围筛选

bash
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"
bash
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"

Endpoint

接口地址

http
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.
http
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方法。当查询内容较长或使用复杂Goggles规则时,推荐使用POST。

Parameters

参数说明

ParameterTypeRequiredDefaultDescription
q
stringYes-Search query (1-400 chars, max 50 words)
country
stringNo
US
Search country (2-letter country code or
ALL
)
search_lang
stringNo
en
Language preference (2+ char language code)
ui_lang
stringNo
en-US
UI language (e.g., "en-US")
count
intNo
20
Number of results (1-50)
offset
intNo
0
Page offset (0-9)
safesearch
stringNo
strict
Adult content filter (
off
/
moderate
/
strict
)
freshness
stringNo-Time filter (
pd
/
pw
/
pm
/
py
or date range)
spellcheck
boolNo
true
Auto-correct query
extra_snippets
boolNo-Up to 5 additional excerpts per result
goggles
string or arrayNo-Custom ranking filter (URL or inline; repeat param for multiple)
operators
boolNo
true
Apply search operators
include_fetch_metadata
boolNo
false
Include fetch timestamps in results
参数类型是否必填默认值描述
q
string-搜索查询词(1-400字符,最多50个单词)
country
string
US
搜索国家(两位国家代码或
ALL
search_lang
string
en
搜索内容语言偏好(两位及以上字符的语言代码)
ui_lang
string
en-US
UI界面语言(例如:"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 或 array-自定义排序规则(URL或内联规则;可重复参数添加多个规则)
operators
bool
true
是否启用搜索运算符
include_fetch_metadata
bool
false
是否在结果中包含抓取时间戳

Freshness Values

时效性参数值

ValueDescription
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
描述
pd
过去24小时 - 适合突发新闻
pw
过去7天
pm
过去31天
py
过去365天
YYYY-MM-DDtoYYYY-MM-DD
自定义日期范围

Response Format

响应格式

json
{
  "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/..."
      }
    }
  ]
}
json
{
  "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/..."
      }
    }
  ]
}

Response Fields

响应字段说明

FieldTypeDescription
type
stringAlways
"news"
query.original
stringThe original search query
query.altered
string?Spellcheck-corrected query (if changed)
query.cleaned
string?Cleaned/normalized query from spellchecker
query.spellcheck_off
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
boolWhether 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
stringAlways
"news_result"
results[].title
stringArticle title
results[].url
stringSource 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
stringServed thumbnail URL
results[].thumbnail.original
string?Original thumbnail URL
results[].extra_snippets
list[str]?Up to 5 additional excerpts per result
字段类型描述
type
string固定为
"news"
query.original
string原始搜索查询词
query.altered
string?拼写纠正后的查询词(若有修改)
query.cleaned
string?经过拼写检查清理/标准化后的查询词
query.spellcheck_off
bool?是否禁用了拼写检查
query.show_strict_warning
bool?若严格模式SafeSearch屏蔽了结果则为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 (Custom Ranking) — Unique to Brave

Goggles(自定义排序)—— Brave专属功能

Goggles let you re-rank news results — boost trusted outlets or suppress unwanted sources.
MethodExample
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
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

Search Operators

搜索运算符

Use search operators to refine results:
  • site:local-paper.com
    - Limit to specific news site
  • "exact phrase"
    - Match exact phrase
  • -exclude
    - Exclude term
Set
operators=false
to disable operator parsing.
使用搜索运算符优化搜索结果:
  • site:local-paper.com
    - 限定结果来自特定新闻网站
  • "exact phrase"
    - 匹配精确短语
  • -exclude
    - 排除指定词汇
设置
operators=false
可禁用运算符解析。

Use Cases

使用场景

  • Breaking news monitoring: Use
    freshness=pd
    for the most recent articles on a topic.
  • Custom news feeds with Goggles: Boost trusted sources and discard other sources — unique to Brave.
  • Historical news research: Use
    freshness=YYYY-MM-DDtoYYYY-MM-DD
    to find articles from specific time periods.
  • Multilingual news: Combine
    country
    ,
    search_lang
    , and
    ui_lang
    for cross-locale results.
  • Data pipelines: Set
    include_fetch_metadata=true
    for
    fetched_content_timestamp
    on each result.
  • 突发新闻监控:使用
    freshness=pd
    获取某一主题的最新文章。
  • 自定义新闻流:通过Goggles优先展示可信来源并屏蔽其他来源——Brave专属功能。
  • 历史新闻研究:使用
    freshness=YYYY-MM-DDtoYYYY-MM-DD
    查找特定时间段的文章。
  • 多语言新闻获取:组合
    country
    search_lang
    ui_lang
    参数获取跨地区多语言结果。
  • 数据管道集成:设置
    include_fetch_metadata=true
    获取每条结果的
    fetched_content_timestamp
    字段。

Notes

注意事项

  • SafeSearch: Defaults to
    strict
  • Pagination: Use
    offset
    (0-9) with
    count
  • Extra snippets: Up to 5 additional excerpts when
    extra_snippets=true
  • SafeSearch:默认值为
    strict
  • 分页:结合
    offset
    (0-9)和
    count
    参数实现分页
  • 额外摘要:当
    extra_snippets=true
    时,每个结果最多返回5条额外摘要