news-search について
news-search は Brave Search API でニュース記事を検索するスキルです。ニュースの追跡や調査に向け、期間指定と Goggles によるソース順位調整に対応します。
主な機能
- 01キーワードによるニュース検索
- 02国と言語による絞り込み
- 03期間または日付範囲の指定
- 04Goggles によるソース順位調整
- 05記事の要約と公開日の取得
活用シーン
- 01特定テーマの最新報道の追跡
- 02期間を限定したニュース調査
- 03選択したニュースソースの優先
インストール
コマンドをコピーしてターミナルで実行します。
npx skills add https:/ / github.com/ brave/ brave-search-skills --skill news-searchインストール後、Claude Code で/news-searchを入力して読み込まれたか確認します。
詳細
ニュース検索
API キーが必要です:https://api.search.brave.com で取得してください。
プラン:Search プランに含まれています。https://api-dashboard.search.brave.com/app/subscriptions/subscribe をご覧ください。
クイックスタート(cURL)
基本検索
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}"
最近のニュース(過去 24 時間)
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
認証:X-Subscription-Token: <API_KEY> ヘッダー
注:GET と POST の両方をサポートしています。長いクエリや複雑な Goggles には POST が便利です。
パラメーター
| パラメーター | 型 | 必須 | デフォルト | 説明 |
|---|---|---|---|---|
q | string | はい | - | 検索クエリ(1~400 文字、最大 50 単語) |
country | string | いいえ | US | 検索対象の国(2 文字の国コードまたは ALL) |
search_lang | string | いいえ | en | 優先する言語(2 文字以上の言語コード) |
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 or array | いいえ | - | カスタムランキングフィルター(URL またはインライン指定。複数指定する場合はパラメーターを繰り返します) |
operators | bool | いいえ | true | 検索演算子を適用します |
include_fetch_metadata | bool | いいえ | false | 検索結果に取得時刻を含めます |
鮮度の値
| 値 | 説明 |
|---|---|
pd | 過去 1 日(24 時間)—速報に最適 |
pw | 過去 1 週間(7 日間) |
pm | 過去 1 か月(31 日間) |
py | 過去 1 年(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"
},
"profile": {
"name": "Example Outlet",
"url": "https://news.example.com/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 datetime) |
results[].page_fetched | string? | ページが最後に取得された日時(ISO datetime) |
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 件の追加抜粋 |
results[].profile.name | string? | サイト名 |
results[].profile.url | string? | プロフィールを確認できる元の URL |
results[].profile.long_name | string? | サイトの正式名称 |
results[].profile.img | string? | プロフィールを表す画像の提供 URL |
Goggles(カスタムランキング)— Brave 独自の機能
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 に登録する必要があります。インラインルールは登録不要です。
構文:ルールは $ とカンマ区切りのオプションで始まります。アクション(いずれか 1 つを選択):discard、boost[=N]、downrank[=N] — N は 1~10 の整数です。サイトフィルター:site=DOMAIN。例:$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を指定すると、トピックに関する最新の記事を取得できます。 - Goggles によるカスタムニュースフィード:信頼できるソースの表示順位を上げ、ほかのソースを除外します。Brave 独自の機能です。
- 過去のニュース調査:
freshness=YYYY-MM-DDtoYYYY-MM-DDを指定すると、特定の期間の記事を検索できます。 - 多言語ニュース:
country、search_lang、ui_langを組み合わせると、異なるロケールの検索結果を取得できます。 - データパイプライン:
include_fetch_metadata=trueを設定すると、各結果にfetched_content_timestampが含まれます。
注意事項
- セーフサーチ:デフォルトは
strictです。 - ページネーション:
countとともにoffset(0~9)を指定します。 - 追加のスニペット:
extra_snippets=trueの場合、最大 5 件の追加抜粋を取得できます。