images-search について
Brave Search API で画像を検索するスキルです。画像のメタデータ、サムネイル、掲載元リンクを返し、地域、件数、スペルチェック、SafeSearchを設定できます。
主な機能
- 01Brave API による画像検索
- 02国と言語による絞り込み
- 03最大 200 件の結果指定
- 04Strict または Off の SafeSearch
- 05サムネイルと画像メタデータの取得
活用シーン
- 01ギャラリーやムードボード用の画像検索
- 02記事への関連画像の追加
- 03ビジュアル分析用の画像結果取得
インストール
コマンドをコピーしてターミナルで実行します。
$
npx skills add https:/ / github.com/ brave/ brave-search-skills --skill images-searchインストール後、Claude Code で/images-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/images/search?q=mountain+landscape" \
-H "Accept: application/json" \
-H "X-Subscription-Token: ${BRAVE_SEARCH_API_KEY}"
パラメーターを指定した検索
curl -s "https://api.search.brave.com/res/v1/images/search" \
-H "Accept: application/json" \
-H "X-Subscription-Token: ${BRAVE_SEARCH_API_KEY}" \
-G \
--data-urlencode "q=northern lights photography" \
--data-urlencode "country=US" \
--data-urlencode "search_lang=en" \
--data-urlencode "count=20" \
--data-urlencode "safesearch=strict"
エンドポイント
GET https://api.search.brave.com/res/v1/images/search
認証:X-Subscription-Token: <API_KEY> ヘッダー
パラメーター
| パラメーター | 型 | 必須 | デフォルト | 説明 |
|---|---|---|---|---|
q | string | はい | - | 検索クエリ(1~400 文字、最大 50 語) |
country | string | いいえ | US | 検索対象の国(2 文字の国コードまたは ALL) |
search_lang | string | いいえ | en | 2 文字以上の言語コード |
count | int | いいえ | 50 | 返す結果の数(1~200) |
safesearch | string | いいえ | strict | off または strict(画像では moderate は指定できません) |
spellcheck | bool | いいえ | true | クエリを自動修正します。修正後のクエリは query.altered に含まれます |
レスポンス形式
{
"type": "images",
"query": {
"original": "mountain landscape",
"altered": null,
"spellcheck_off": false,
"show_strict_warning": false
},
"results": [
{
"type": "image_result",
"title": "Beautiful Mountain Landscape",
"url": "https://example.com/mountain-photo",
"source": "example.com",
"page_fetched": "2025-09-15T10:30:00Z",
"thumbnail": {
"src": "https://imgs.search.brave.com/...",
"width": 200,
"height": 150
},
"properties": {
"url": "https://example.com/images/mountain.jpg",
"placeholder": "https://imgs.search.brave.com/placeholder/...",
"width": 1920,
"height": 1080
},
"meta_url": {
"scheme": "https",
"netloc": "example.com",
"hostname": "example.com",
"favicon": "https://imgs.search.brave.com/favicon/...",
"path": "/mountain-photo"
},
"confidence": "high"
}
],
"extra": {
"might_be_offensive": false
}
}
レスポンスフィールド
| フィールド | 型 | 説明 |
|---|---|---|
type | string | 常に "images" です |
query.original | string | 元のクエリ |
query.altered | string? | スペルチェック後のクエリ(修正がない場合は null) |
query.spellcheck_off | bool? | スペルチェックが無効になっていたかどうか |
query.show_strict_warning | bool? | strict のセーフサーチによって関連する結果が非表示になった場合は true |
results[] | array | 画像検索結果のリスト |
results[].type | string | 常に "image_result" です |
results[].title | string? | 画像のタイトル |
results[].url | string? | 画像が見つかったページの URL |
results[].source | string? | ソースのドメイン |
results[].page_fetched | string? | 最後にページをクロールした日時(ISO 形式) |
results[].thumbnail.src | string? | Brave プロキシ経由のサムネイル URL(幅約 500px) |
results[].thumbnail.width | int? | サムネイルの幅 |
results[].thumbnail.height | int? | サムネイルの高さ |
results[].properties.url | string? | 元のフルサイズ画像の URL |
results[].properties.placeholder | string? | 低解像度のプレースホルダー URL(Brave プロキシ経由) |
results[].properties.width | int? | 元画像の幅(null の場合があります) |
results[].properties.height | int? | 元画像の高さ(null の場合があります) |
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[].confidence | string? | 関連性:low、medium、high のいずれか |
extra.might_be_offensive | bool | 結果に不快なコンテンツが含まれる可能性があるかどうか |
使用例
- ビジュアルコンテンツの発見:画像ギャラリー、ムードボード、ビジュアル調査ツールを作成できます。幅広く結果を取得するには
count=200を使用してください。画像固有のメタデータ(サイズ、サムネイル)が必要な場合は、web-searchよりもこちらが適しています。 - コンテンツの充実:記事や生成コンテンツに関連する画像を追加できます。
countryとsearch_langを使って、対象読者の地域に合わせてください。 - 安全な画像取得:デフォルトの
safesearch=strictにより、すぐにファミリー向けの結果を取得できます。モードはoffとstrictの 2 種類のみで、web/video/news 検索とは異なり、moderate オプションはありません。 - 大量の一括取得:1 リクエストあたり最大 200 件の画像を取得できます(web は 20 件、videos/news は 50 件)。画像の一括取得やビジュアル分析パイプラインに最適です。
補足
- SafeSearch:画像検索ではデフォルトで
strictです(web 検索より厳格です)。 - 大量取得:1 リクエストあたり最大 200 件の結果を返せます。
- サムネイル:ユーザーのプライバシー保護のため、Brave プロキシ経由で配信されます(幅 500px)。元のフル解像度画像には
properties.urlを使用してください。 - サイズ:画像によっては
properties.width/heightが欠けている場合があります。 - プレースホルダー:
properties.placeholderは低解像度の URL で、インラインの base64 ではありません。プログレッシブ読み込みの UX に役立ちます。
コメント
Markdown 対応