Vision batchAnalyze method
Analyzes a set of images and returns the search results for similar images.
HTTP request
POST https://vision.api.cloud.yandex.net/vision/v1/batchAnalyze
Parameters in the request body
{
"analyzeSpecs": [
{
"features": [
{
"type": "IMAGE_COPY_SEARCH"
}
],
"mimeType": "string",
"content": "string"
}
]
}
Field | Description |
---|---|
analyzeSpecs[] | object List of specifications. Each specification contains the image to analyze and type of analysis. |
analyzeSpecs[]. features[] |
object List of analysis types. |
analyzeSpecs[]. features[].type |
string Analysis type. Use the value |
analyzeSpecs[]. mimeType |
string Content MIME type For example, The maximum length is 255 characters. |
analyzeSpecs[]. content |
string (byte) Image content represented as a stream of bytes. Note: As any byte field, protobuf uses a pure binary representation, whereas a JSON representation uses base64. The maximum length is 10485760 characters. |
Response
HTTP Code: 200 - OK
{
"results": [
{
"results": [
{
"imageCopySearch": {
"topResults": [
{
"imageUrl": "string",
"pageUrl": "string",
"title": "string",
"description": "string"
},
// Other items of the list `results[].results[].imageCopySearch.topResults[]`.
],
"copyCount": "integer"
}
}
]
}
]
}
Field | Description |
---|---|
results[] | object List of request results. |
results[].results[] | object List of request results for a separate specification. |
results[].results[]. imageCopySearch |
object Request result for the |
results[].results[]. imageCopySearch. topResults[] |
object List of links and sites where the image is found, in descending order of relevance. |
results[].results[]. imageCopySearch. topResults[].imageUrl |
string Image URL. |
results[].results[]. imageCopySearch. topResults[].pageUrl |
string URL of the page where the image is found. |
results[].results[]. imageCopySearch. topResults[].title |
string Page title. |
results[].results[]. imageCopySearch. topResults[].description |
string Page description. |
results[].results[]. imageCopySearch. copyCount |
integer The number of image copies found. |
Sample request
curl -H "Authorization: Api-Key <Your API key>" --data @data.json https://vision.api.cloud.yandex.net/vision/v1/batchAnalyze
The data.json
file content is described below. Use your data or download the data.json file
{
"analyzeSpecs": [
{
"features": [
{
"type": "IMAGE_COPY_SEARCH"
}
],
"mimeType": "application/json",
"content": "<Image>"
}
]
}
Response
{
"results": [
{
"results": [
{
"imageCopySearch": {
"topResults": [
{
"imageUrl": "https://i.mycdn.me/i?r=AzEPZsRbOZEKgBhR0XGMT1RkPP9W1BmgpMQhwHsyiKHQlqaKTM5SRkZCeTgDn6uOyic",
"pageUrl": "www.wallpaperinhd.net/leonardo-dicaprio-wallpaper-22/",
"title": "Leonardo DiCaprio Wallpaper 22 - Desktop Wallpapers HD Free Backgrounds",
"description": "Leonardo DiCaprio Wallpaper 22"
},
{
"imageUrl": "https://sun9-68.userapi.com/c635102/v635102124/51ccb/-wkH1Q727zI.jpg",
"pageUrl": "vk.com/wall-22890129_219793",
"title": "VK wall",
"description": "Love at first sight?"
},
// Other items of the list `results[].results[].imageCopySearch.topResults[]`.
],
"copyCount": 13
}
}
]
}
]
}