> ## Documentation Index
> Fetch the complete documentation index at: https://docs.querying.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Brave 検索結果 API

> 1つのクエリについて、Brave 自身のインデックスの自然検索結果、FAQ、ナレッジパネル、ニュース、動画、ディスカッション、場所を取得します。

`BRAVE_SEARCH` はクエリで Brave の検索結果ページを開き、自然検索結果、広告、FAQ、ナレッジパネル、ニュース、動画、ディスカッション、場所、関連クエリを返します。Brave は自社インデックスで応答し、ページをサーバー側で描画するため結果はページとともに届き、ブラウザは動きません。

| | |
| - | - |
| `taskType` | `BRAVE_SEARCH` |
| 入力 | `query` または `prompt`(必須)、600文字・75語まで。`country`、`lang`、`safesearch`、`freshness`、`page` |
| クレジット | タスクあたり 0.3 |
| 国 | 既定値は `US`。以下が Brave の市場です。 |
| 位置 | 非対応(`422 LOCATION_UNSUPPORTED`)。 |

## リクエスト

```bash theme={"theme":"css-variables"}
curl -X POST https://api.querying.ai/v1/async/task \
  -H "Authorization: Bearer $QUERYING_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "taskType": "BRAVE_SEARCH", "payload": { "query": "ヒートポンプは寒冷地でどう動くのか", "country": "JP" } }'
```

タスクは非同期に実行されます。結果は[非同期タスク](https://docs.querying.ai/ja/concepts/async-tasks.md)のとおり読みます。

## パラメータ

| フィールド | 必須 | 説明 |
| - | - | - |
| `query` | はい、または `prompt` | 検索クエリ、600文字・75語まで。 |
| `prompt` | はい、または `query` | `query` がないとき受け付けます。両方送ると `BRAVE_SEARCH` は `query` を読みます。 |
| `country` | いいえ | 検索する市場です。`AR`、`AU`、`AT`、`BE`、`BR`、`CA`、`CL`、`DK`、`FI`、`FR`、`DE`、`GR`、`HK`、`IN`、`ID`、`IT`、`JP`、`KR`、`MY`、`MX`、`NL`、`NZ`、`NO`、`CN`、`PL`、`PT`、`PH`、`RU`、`SA`、`ZA`、`ES`、`SE`、`CH`、`TW`、`TR`、`GB`、`US` または `ALL`。既定値は `US`、`ALL` はすべての市場を検索します。 |
| `lang` | いいえ | 結果の言語です。`en`、`ko`、`ja`、`de`、`pt-br`、`zh-hant` などの Brave のコード。既定値は国の言語です。 |
| `safesearch` | いいえ | `off`、`moderate`(既定)、`strict`。 |
| `freshness` | いいえ | `pd`(過去1日)、`pw`(過去1週間)、`pm`(過去1か月)、`py`(過去1年)、または `YYYY-MM-DDtoYYYY-MM-DD` の範囲。 |
| `page` | いいえ | 結果ページ、1〜10。1ページに結果20件までで、Brave は少しずつ送るため隣のページと重なります。 |

## レスポンス

応答にあるブロックだけを含め、ないブロックは省きます。

```json theme={"theme":"css-variables"}
{
  "organicResults": [
    { "position": 1, "title": "...", "link": "https://...", "snippet": "...", "date": "2026-11-13T04:00:00.000Z", "siteName": "...", "extraSnippets": ["..."] }
  ],
  "ads": [{ "position": 1, "title": "...", "link": "https://...", "description": "...", "displayedLink": "..." }],
  "peopleAlsoAsk": [{ "question": "...", "snippet": "...", "link": "https://..." }],
  "knowledgeGraph": { "title": "...", "type": "...", "description": "...", "attributes": [{ "key": "...", "value": "..." }], "profiles": ["https://..."] },
  "topStories": [{ "title": "...", "link": "https://...", "source": "...", "date": "2 days ago", "snippet": "..." }],
  "videoResults": [{ "title": "...", "link": "https://...", "platform": "...", "duration": "1:02", "views": 1234 }],
  "discussions": [{ "position": 1, "title": "...", "link": "https://...", "source": "...", "question": "...", "topComment": "..." }],
  "locations": [{ "position": 1, "title": "...", "link": "https://...", "address": "...", "coordinates": { "latitude": 37.5, "longitude": 127 } }],
  "alteredQuery": "...",
  "relatedSearches": [{ "query": "...", "link": "https://..." }],
  "moreResultsAvailable": true,
  "page": 1
}
```

| フィールド | 説明 |
| - | - |
| `organicResults` | 常にあります。`position` はページごとに1から数えます。`snippet` は Brave の説明で、マークアップをそのまま残します。`date` はページが抜粋の前に日付を出すとき、その表現のままです。`siteName` は発行者の名前です。 |
| `ads` | 広告です。広告主の着地 `link` と表示される `displayedLink`。Brave は自然結果の間に置くため、`position` はその順番です。 |
| `peopleAlsoAsk` | Brave の FAQ ブロックです。`question`、回答を入れた `snippet`、回答元のページ。 |
| `knowledgeGraph` | ナレッジパネルです。タイトル、分類、説明、`attributes` の事実、`profiles` の公式ページ。 |
| `topStories` | ニュース結果。`date` は Brave の表現("2 days ago")です。 |
| `videoResults` | 動画です。`platform`、`channel`、`duration`、`views`。 |
| `discussions` | フォーラムの投稿です。Brave が持つときは投稿の `question` と `topComment` も返します。 |
| `locations` | 位置クエリの場所です。`address`、`coordinates`、`phoneNumber`、`openingHours`、提供元の `link`。 |
| `alteredQuery` | Brave のスペルチェッカーが検索前にクエリを変えたときにあります。 |
| `relatedSearches` | Brave の関連クエリと、それぞれを実行する `link`。 |
| `moreResultsAvailable` | このページの先に結果があるとき `true`。 |
| `page` | 返したページ。 |

HTML payload はないため、`include` が加えるものはありません。

Brave API の規約はアプリ運用に必要な範囲を超える結果の保存を制限しているため、長期間保持する場合はご注意ください。

## 制限とエラー

* 600文字・75語を超えるクエリは送信時に `422 VALIDATION_ERROR` です。
* 上の一覧にない `country`、知らない `lang`、3つの値以外の `safesearch`、形式の誤った `freshness`、1〜10の外の `page` は `422 VALIDATION_ERROR` です。
* Brave のレート制限は、別のアドレスで再試行したのち `BRAVE_HTTP_429` で答えます。`BRAVE_UNEXPECTED_PAGE` はこのエンジンが読まないページで答えたこと、`BRAVE_TIMEOUT` は時間内に答えなかったことを示します。
* その他のリクエストエラーは[エラー](https://docs.querying.ai/ja/concepts/errors.md)にあります。

## 関連

* Bing の結果ページとAI要約は [Bing 検索](https://docs.querying.ai/ja/engines/bing-search.md)
* 結果1件のページ全体を読むには [Scrape](https://docs.querying.ai/ja/engines/web-scrape.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.