Search

Provides a powerful query interface to filter and retrieve assets and their details

POST
/v1_1/{cloud_name}/resources/search

Returns a list of resources matching the specified search criteria.

Uses a Lucene-like query language to filter assets by descriptive attributes (public_id, asset_id, filename, display_name, folder / asset_folder, tags, context.<key>), file details (resource_type, type, format, bytes, width, height, duration, pages, aspect_ratio, transparent, grayscale), lifecycle dates (uploaded_at, created_at, taken_at, updated_at, last_updated.<kind>), moderation and lifecycle state (status, moderation_status, moderation_kind), embedded data (image_metadata.*), structured metadata (metadata.<external_id>), and analysis fields (face_count, colors, quality_score, illustration_score, accessibility_analysis.*). Supports sorting, aggregate counts, and complex boolean expressions.

Examples: tags:shirt AND uploaded_at>1d, resource_type:image AND bytes>1000000, folder:products OR context.category:electronics. See the search expressions guide for the full syntax and field reference.

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 search query parameters.

Common parameters for resource search operations.

expression?string

The Lucene-like search expression. Supports token match (field:value), exact match (field=value), trailing * for prefix match, ranges ([a TO b], {a TO b}), and comparisons (>, <, >=, <=). Combine terms with uppercase AND, OR, NOT, or +/-, and group with parentheses. Wrap values containing reserved characters (spaces, colons, etc.) in double quotes. See the search expressions guide for the full syntax and supported fields.

sort_by?array<>

An array of single-key objects mapping a field to a sort direction. Each object must contain exactly one field name mapped to 'asc' or 'desc'. Default: [{"created_at": "desc"}].

max_results?integer

The maximum number of results to return. Default - 50. Maximum - 500. Set to 0 to get only total_count and aggregations without any resources in the response — useful for counting or aggregation-only queries.

Range0 <= value <= 500
next_cursor?string

The cursor value to get the next page of results. Available when a previous search returned more results than max_results.

aggregate?array<>|array<>

Fields or ranges to aggregate search results by. Requires a Tier 2 search plan; on Tier 1 the field is accepted but aggregations are omitted from the response.

with_field?array<>

The additional asset attributes to include in each search result. The fields parameter takes precedence over this parameter. image_metadata, image_analysis, and metadata require a Tier 2 search plan.

fields?string

A comma-separated list of fields to include in the response. Notes:

  • This parameter takes precedence over the with_field parameter, so if you want any additional asset attributes returned, make sure to also include them in this list (e.g., tags or context).
  • The following fields are always included in the response: public_id, asset_id, asset_folder, created_at, status, type, and resource_type.

Response Body

application/json

application/json

application/json

curl -X POST "https://example.com/v1_1/my_cloud/resources/search" \  -H "Content-Type: application/json" \  -d '{}'
{  "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      }    ]  }}