cloudinary

cloudinary / SearchCloudinary / 0.1.1

README.md

Overview

Search Cloudinary

Usage

Before using this algorithm, you must first configure your Cloudinary credentials via https://algorithmia.com/algorithms/cloudinary/ConfigureCloudinary

Input

Option 1: a resource (Cloudinary file) name

"wikidark"

Option 2: a 'tag' parameter (find all files with the tag)

{"tag":"dark"}

Option 3: an 'expression' parameter, and any other search options

Only the 'expression' parameter (the search query) is required, all others are optional as described in https://cloudinary.com/documentation/search_api

This requires that your Cloudinary account have the Search API enabled

{
  "expression":"cat -tags:kitten",
  "sort_by":"100",
  "format":"jpg",
  "effect": "sepia",
  ...
}

Output

The Cloudinary result, e.g.

{
 "total_count": 32,
 "time": 30,
 "aggregations": {
   "format": {
     "png": 4,
     "jpg": 21,
     "mp4": 3,
     "doc": 4
   }
 },
 "next_cursor": "b16b8bd80426df43a107f26b0348",
 "resources": [
   {
     "public_id": "sample",
     "folder": "",
     "filename": "sample",
     "format": "png",
     "version": 1492606756,
     "resource_type": "image",
     "type": "upload",
     "created_at": "2017-04-03T09:56:49+00:00",
     "uploaded_at": "2017-04-19T12:59:16+00:00",
     "bytes": 3381,
     "backup_bytes": 16905,
     "width": 241,
     "height": 51,
     "aspect_ratio": 4.7254901960784315,
     "pixels": 12291,
     "context": {},
     "image_analysis": { 
       "face_count": 0,
       "faces": [],
       "grayscale": true,
       "illustration_score": 1,
       "transparent": false,
       "colors": {
         "gray": 96.7
       }
     },
     "url": "http://res.cloudinary.com/demo/image/upload/v1492606756/sample.png",
     "secure_url": "https://res.cloudinary.com/demo/image/upload/v1492606756/sample.png",
     "status": "active",
     "access_mode": "public"
   },
   {
     "public_id": "dog",
      ...
   },
   ...
 ] 
}