textstringbắt buộc
text
https://api.sandbase.ai/v1/api/yandex/imagesYandex Images results for a keyword: image URLs, thumbnails, sizes and source pages.
Đầu ra của bạn sẽ xuất hiện ở đây
Hoàn tất đầu vào, rồi nhấp Run.
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.
Bắt đầu xây dựng
Endpoint API của nền tảng với xác thực và theo dõi mức sử dụng thống nhất.
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"
}'Đặt SandBase API key của bạn trong môi trường máy chủ. Các request sử dụng xác thực Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Giữ key của bạn trên máy chủ. Không hiển thị trong mã chạy trên trình duyệt.
textstringbắt buộctext
Đây là phản hồi ví dụ đã lưu cho API này; không có request thực nào được gửi khi xem mục này.
Chưa có phản hồi đã lưu nào được công bố. Chạy API trong Playground để xem phản hồi.
Khám phá thêm
| API | Giá | Phản hồi |
|---|---|---|
Yandex Images SearchAPI này Yandex | $0.015 mỗi lần gọi | JSON |
Yandex | $0.01 mỗi lần gọi | JSON |
Yandex | $0.015 mỗi lần gọi | JSON |
Câu hỏi
Gửi yêu cầu POST đến https://api.sandbase.ai/v1/api/yandex/images với khóa API SandBase của bạn trong tiêu đề Authorization (Bearer) và các tham số trong phần thân JSON. Bạn cũng có thể thử trực tiếp trong Playground trên trang này mà không cần viết code.
$0.015 mỗi lần gọi, được tính từ số dư SandBase của bạn. Bạn chỉ bị tính phí cho các lần gọi bạn thực hiện; không có gói đăng ký.
Bắt buộc: text (string). Bảng Parameters và Playground trên trang này liệt kê mọi trường.
Phản hồi JSON được trả về trong cùng một yêu cầu HTTP (đồng bộ). README trên trang này có ví dụ phản hồi.
Không. Yandex Images Search chạy thông qua SandBase, nên chỉ cần một API key SandBase là đủ cho endpoint này và mọi API cùng model khác trong danh mục. Bạn không cần đăng ký riêng để có quyền truy cập API của Yandex.