class SearchApi implements JsonSerializable, SearchQueryInterface

Class SearchApi

The Cloudinary API search method allows you fine control on filtering and retrieving information on all the assets in your cloud with the help of query expressions in a Lucene-like query language. A few examples of what you can accomplish using the search method include:

  • Searching by descriptive attributes such as public ID, filename, folders, tags, context, etc.
  • Searching by file details such as type, format, file size, dimensions, etc.
  • Searching by embedded data such as Exif, XMP, etc.
  • Searching by analyzed data such as the number of faces, predominant colors, auto-tags, etc.
  • Requesting aggregation counts on specified parameters, for example the number of assets found broken down by file format.

Methods

__construct(mixed $configuration = null)

SearchApi constructor.

endpoint(string $endpoint)

Sets the Search API endpoint.

executeAsync()

Executes the search API request asynchronously.

execute()

Executes the search API request.

toUrl(int $ttl = null, string $nextCursor = null)

Creates a signed Search URL that can be used on the client side.

jsonSerialize()

No description

Details

__construct(mixed $configuration = null)

SearchApi constructor.

Parameters

Name Type Description
$configuration mixed

$this endpoint(string $endpoint)

Sets the Search API endpoint.

Parameters

Name Type Description
$endpoint string The endpoint for the Search API.

Return Value

$this

PromiseInterface executeAsync()

Executes the search API request asynchronously.

Return Value

PromiseInterface

ApiResponse execute()

Executes the search API request.

Return Value

ApiResponse

Exceptions

GeneralError

string toUrl(int $ttl = null, string $nextCursor = null)

Creates a signed Search URL that can be used on the client side.

Parameters

Name Type Description
$ttl int The time to live in seconds.
$nextCursor string Starting position.

Return Value

string The resulting search URL.

jsonSerialize()

Constants

ASSETS