Media - Search

Search Media

Uploaded media objects can be searched using the file's md5, filename, or external_media_id

The following query parameters are supported:

ArgumentExampleDescription
filename
string
"my_image.jpg"Filename of the uploaded media.
external_media_id
string
"000060e3121c7305"A unique ID for this media from it's external data source.

E.g., the ImageID field from the OpenImages dataset.
md5
string
c7299866d9a68aa6735dd10md5 hash of the media file.
GET /1/media/all/search
Host: https://api.cogniac.io

Example: Search for a media

curl -X POST https://api.cogniac.io/1/media/all/search \
-H "Authorization: Bearer abcdefg.hijklmnop.qrstuvwxyz" \
-H "Content-Type: application/json" \
-d '{
"filename":"Cat.jpg",
}'
import cogniac

# connect to the tenant
cc = cogniac.CogniacConnection(username="[email protected]", 
                               password="myPassword", 
                               tenant_id="xyz6785dc")

# search for media by filename
media = cc.search_media(filename="Cat.jpg")

print media.media_id
{
  "media_id":"824hshhfguheg",
  "media_format":"jpg",
  "media_src":"google",
  "media_url":"https://www.api.cogniac.io/1/media/fullsize/824hshhfguheg.jpg",
  "media_timestamp":"240242525",
  "public":true,
  "meta_tags": [
    "[email protected]",
    "mobile",
    "iPhone 6+",
    "9.2",
    "v2.1"
 	],
  "created_at": 1455044755,
  "uploaded_by_user":"[email protected]",
  "uploaded_by_tenant":"96uohsdflkjh"
}