textstring必須
text
https://api.sandbase.ai/v1/api/yandex/imagesYandex Images results for a keyword: image URLs, thumbnails, sizes and source pages.
出力はここに表示されます
入力を完了してから[実行]をクリックしてください。
This API returns Yandex Images results for a keyword. Each result has the full image URL, a thumbnail, the image size and the page it came from. It needs one input, text, the search query.
source domain of each result.size.width and size.height to find images that are large enough for print or banners.link back to the page that hosts it.curl -X POST "https://api.sandbase.ai/v1/api/yandex/images" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text": "coffee"}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
text | string | Yes | text |
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"images_results": [
{
"link": "https://www.ixbt.com/live/offtopic/espresso-flet-uayt-latte-makiato-kak-razobrat…",
"original": "https://img.ixbt.site/live/images/original/32/75/48/2024/10/16/13debe3369.jpg",
"position": 1,
"size": {
"bytes": 52497,
"height": 501,
"width": 877
},
"snippet": "Эспрессо",
"source": "ixbt.com",
"thumbnail": "https://avatars.mds.yandex.net/i?id=3792c6e26c505c0c57105cad26b374d0e32045bf-154…",
"title": "Эспрессо, флэт уайт, латте макиато. Как разобраться в видах кофе? / Оффтопик / i"
}
]
}
| Field | Meaning |
|---|---|
images_results[] | List of image results for the query, in the order returned. |
images_results[].position | Rank of the result in the list, starting at 1. |
images_results[].original | URL of the full-size image file. |
images_results[].thumbnail | URL of a smaller preview image hosted on a Yandex domain. |
images_results[].link | URL of the web page that contains the image. |
images_results[].source | Domain name of the site that hosts the page, for example en.wikipedia.org. |
images_results[].title | Title of the source page. Long titles may be cut off. |
images_results[].snippet | Short text shown with the image, such as a caption or page description. |
images_results[].size.width / images_results[].size.height | Width and height of the original image. |
images_results[].size.bytes | File size of the original image, as given by the bytes key. |
text is the only parameter and it is required. Pass the search phrase as a plain string, for example coffee.$0.015 per successful call. Failed calls are not charged.
開発を始める
統一認証と使用状況の追跡を備えたプラットフォームAPIエンドポイントです。
curl -X POST "https://api.sandbase.ai/v1/api/yandex/images" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "coffee"
}'SandBaseのAPIキーをサーバー環境に設定してください。リクエストはBearer認証を使用します。
export SANDBASE_API_KEY="YOUR_API_KEY"キーはサーバー側で管理してください。ブラウザコードに公開しないでください。
textstring必須text
このAPIの保存済みサンプルレスポンスです。表示時にライブリクエストは行われません。
保存済みレスポンスはまだ公開されていません。PlaygroundでAPIを実行し、レスポンスを確認してください。
さらに探索
| API | 価格 | レスポンス |
|---|---|---|
Yandex Images Searchこの API Yandex | $0.015 / 回 | JSON |
Yandex | $0.01 / 回 | JSON |
Yandex | $0.015 / 回 | JSON |
質問
Authorization ヘッダー(Bearer)に SandBase API key を指定し、パラメータを JSON ボディで送信して https://api.sandbase.ai/v1/api/yandex/images に POST リクエストを送ります。このページの Playground で、コードを書かずに試すこともできます。
1回あたり $0.015、SandBase 残高から課金されます。課金対象はご利用分のみで、サブスクリプションはありません。
必須: text (string)。 このページの Parameters テーブルと Playground に、すべてのフィールドが一覧表示されています。
同じ HTTP リクエスト内で返される JSON レスポンスです(同期)。 このページの README にサンプルレスポンスがあります。
いいえ。Yandex Images Search は SandBase 経由で動作するため、SandBase の API key 1つでこのエンドポイントと、カタログ内の他のすべての API とモデルを利用できます。Yandex の API アクセスを別途申請する必要はありません。