Search

Finds images in your asset library based on visual similarity or content

POST
/v1_1/{cloud_name}/resources/visual_search

Returns a list of resources that are visually similar to a specified image. You can provide the source image for comparison in one of three ways:

  • Provide a URL of an image
  • Specify the asset ID of an existing image
  • Provide a textual description

Authorization

AuthorizationBasic <token>

Basic authentication using Cloudinary API Key and API Secret.

In: header

Path Parameters

cloud_name*string

The cloud name of your product environment.

Request Body

application/json

The visual search parameters.

Parameters for visual search operations

Parameters for visual search operations

image_url*string

The URL of an image to use as the source for finding visually similar images

Formaturi
threshold?number

The minimum similarity score (between 0 and 1.0) that a resource must have to be included in the response

Range0 <= value <= 1

Response Body

application/json

application/json

application/json

curl -X POST "https://example.com/v1_1/my_cloud/resources/visual_search" \  -H "Content-Type: application/json" \  -d '{    "image_url": "http://example.com"  }'
{  "total_count": 0,  "time": 0,  "resources": [    {      "asset_id": "string",      "public_id": "string",      "asset_folder": "string",      "filename": "string",      "display_name": "string",      "format": "string",      "version": 0,      "resource_type": "image",      "type": "upload",      "created_at": "2019-08-24T14:15:22Z",      "uploaded_at": "2019-08-24T14:15:22Z",      "bytes": 0,      "backup_bytes": 0,      "width": 0,      "height": 0,      "aspect_ratio": 0,      "pixels": 0,      "url": "http://example.com",      "secure_url": "http://example.com",      "status": "active",      "access_mode": "public",      "access_control": [        {          "access_type": "token",          "key": "string",          "start": "string",          "end": "string"        }      ],      "etag": "string",      "created_by": {        "access_key": "string"      },      "uploaded_by": {        "access_key": "string"      },      "context": {        "property1": "string",        "property2": "string"      },      "tags": [        "string"      ],      "image_metadata": {},      "image_analysis": {},      "metadata": {},      "quality_analysis": {},      "accessibility_analysis": {}    }  ],  "next_cursor": "string",  "aggregations": {    "values": [      {        "value": "string",        "count": 0      }    ],    "ranges": [      {        "from": 0,        "to": 0,        "count": 0      }    ]  }}