NAV Navbar
Node.JS Python Ruby Shell

Introduction

Base URL: https://api.intenseye.com

Getting Started

Intenseye is the best video analytics platform for tracking variety of objects, extracting information from your videos and cameras in a fast, accurate and secure way.

Sign Up

Before you can use our API's, you need to register an account. Please go head and create an account from our dashboard.

Find your API Key

Upon creating an account, an API key will be automatically generated for you. You can create and remove as many keys you like.

Explore our docs

After finding your API key, you are all set! Explore our docs for more usage info. Note that you are required to enter a valid credit card to use our API's. For image API's first 1000 calls each month are free!

Authentication

Intenseye uses API keys to allow access to the API. You can find your API keys on our dashboard, which you can access by logging in or signing up.

Intenseye expects for the API key to be included in all API requests to the server via HTTP Basic Auth. Provide your API key as the basic auth username value. You do not need to provide a password. You can do this using the -u flag:

-u "INTENSEYE_API KEY:"

You must replace INTENSEYE_API KEY with your personal API key. If you sign up or log in, your API key will be automatically filled in the docs.

However Websocket API's require the key field as a query string parameter using 'key' as key and your api key as value. For example: ws://api.intenseye.com/videos/${video-id}/socket?key=${api-key}

Video API

Operations about videos

Get Videos

Code samples

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json'

};

fetch('https://api.intenseye.com/videos',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.get('https://api.intenseye.com/videos', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json'
}

result = RestClient.get 'https://api.intenseye.com/videos',
  params: {
  }, headers: headers

p JSON.parse(result)

# You can also use wget
curl -X GET https://api.intenseye.com/videos \
  -H 'Accept: application/json'

GET /videos

Get all the videos associated with the user

Example responses

200 Response

{
  "message": "success",
  "data": [
    {
      "id": "ed0999cc-5f9a-467a-961f-64dde8dbffb8",
      "name": "summer.mp4",
      "slug": "summermp4",
      "size": 129532,
      "status": "IDLE",
      "statusMessage": "string",
      "pose": true,
      "emotion": true,
      "ageGender": true,
      "trackingTarget": "person",
      "userId": "3811d4ab-ff65-44a9-9cd1-05ff88320e6b",
      "createdAt": "2018-11-21T22:49:17Z",
      "updatedAt": "2018-11-21T22:49:17Z"
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK success Video Response

Upload a Video

Code samples

const fetch = require('node-fetch');
const input = document.getElementById('fileinput');
const data = new FormData();
data.append('image', input.files[0]);
const headers = {
  'Content-Type':'multipart/form-data',
  'Accept':'application/json'
};

fetch('https://api.intenseye.com/videos',
{
  method: 'POST',
  body: data,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'multipart/form-data',
  'Accept': 'application/json'
}

r = requests.post('https://api.intenseye.com/videos', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'multipart/form-data',
  'Accept' => 'application/json'
}

result = RestClient.post 'https://api.intenseye.com/videos',
  params: {
  }, headers: headers

p JSON.parse(result)

# You can also use wget
curl -X POST https://api.intenseye.com/videos \
  -H 'Content-Type: multipart/form-data' \
  -H 'Accept: application/json'

POST /videos

Add a video

Body parameter

video: string

Parameters

Parameter In Type Required Description
body body Video false none
» video body string(binary) false none

Example responses

200 Response

{
  "status": "ok",
  "message": "Video has been uploaded"
}

Responses

Status Meaning Description Schema
200 OK Video has been uploaded Generic Response

Upload a Video by url

Code samples

var request = require("request");

var options = { method: 'POST',
  url: 'https://api.intenseye.com/videos/upload_by_url',
  headers: 
   { 'cache-control': 'no-cache',
     Authorization: 'Basic ZWM3ZDk5NDAxYzUxNDhlYjA3MGZhMTcxNzVjZDg1NzA6',
     'Content-Type': 'application/json' },
  body: { url: 'https://my-videos.com/myvideo.mp4' },
  json: true };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});


import requests

url = "https://api.intenseye.com/videos/upload_by_url"

payload = "{\n\t\"url\": \"https://my-videos.com/myvideo.mp4\"\n}"
headers = {
    'Content-Type': "application/json",
    'Authorization': "Basic ZWM3ZDk5NDAxYzUxNDhlYjA3MGZhMTcxNzVjZDg1NzA6",
    'cache-control': "no-cache"
    }

response = requests.request("POST", url, data=payload, headers=headers)

print(response.text)

require 'uri'
require 'net/http'

url = URI("https://api.intenseye.com/videos/upload_by_url")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["Authorization"] = 'Basic ZWM3ZDk5NDAxYzUxNDhlYjA3MGZhMTcxNzVjZDg1NzA6'
request["cache-control"] = 'no-cache'
request.body = "{\n\t\"url\": \"https://my-videos.com/myvideo.mp4\"\n}"

response = http.request(request)
puts response.read_body

curl -X POST \
  https://api.intenseye.com/videos/upload_by_url \
  -H 'Authorization: Basic ZWM3ZDk5NDAxYzUxNDhlYjA3MGZhMTcxNzVjZDg1NzA6' \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache' \
  -d '{
    "url": "https://my-videos.com/myvideo.mp4"
}'

POST /videos/upload_by_url

Add a video by specifiying a url

Body parameter

video: string

Parameters

Parameter In Type Required Description
body body Video false none
» video body string(binary) false none

Example responses

200 Response

{
    "status": "ok",
    "message": "Video is currently being uploaded",
    "insertedItem": "31db2683-0a25-433d-a17a-6ba3d2e3c4f2"
}

Responses

Status Meaning Description Schema
200 OK Video has been uploaded Generic Response

Get a video by id

Code samples

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json'

};

fetch('https://api.intenseye.com/videos/${videoId}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.get('https://api.intenseye.com/videos/${videoId}', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json'
}

result = RestClient.get 'https://api.intenseye.com/videos/${videoId}',
  params: {
  }, headers: headers

p JSON.parse(result)

# You can also use wget
curl -X GET https://api.intenseye.com/videos/${videoId} \
  -H 'Accept: application/json'

GET /videos/${videoId}

Get video by id

Parameters

Parameter In Type Required Description
videoId path string(uuid) true ID of video to return

Example responses

200 Response

{
  "id": "ed0999cc-5f9a-467a-961f-64dde8dbffb8",
  "name": "summer.mp4",
  "slug": "summermp4",
  "size": 129532,
  "status": "IDLE",
  "statusMessage": "string",
  "pose": true,
  "emotion": true,
  "ageGender": true,
  "trackingTarget": "person",
  "userId": "3811d4ab-ff65-44a9-9cd1-05ff88320e6b",
  "createdAt": "2018-11-21T22:49:17Z",
  "updatedAt": "2018-11-21T22:49:17Z"
}

Responses

Status Meaning Description Schema
200 OK successful operation Video

Update a video by id

Code samples

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json'

};

fetch('https://api.intenseye.com/videos/${videoId}',
{
  method: 'PATCH',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.patch('https://api.intenseye.com/videos/${videoId}', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json'
}

result = RestClient.patch 'https://api.intenseye.com/videos/${videoId}',
  params: {
  }, headers: headers

p JSON.parse(result)

# You can also use wget
curl -X PATCH https://api.intenseye.com/videos/${videoId} \
  -H 'Accept: application/json'

PATCH /videos/${videoId}

Update a video by id

Parameters

Parameter In Type Required Description
videoId path string(uuid) true ID of video to return

Example responses

200 Response

{
  "status": "ok",
  "message": "Video Updated"
}

Responses

Status Meaning Description Schema
200 OK successful operation Video

Start a video analysis job

Code samples

const fetch = require('node-fetch');
const inputBody = '{
  "tracks": [
    {
      "type": "person",
      "params": {
        "ageGender": true,
        "emotion": true,
        "pose": true
      }
    }
  ]
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json'
};

fetch('https://api.intenseye.com/videos/${videoId}/analysis',
{
  method: 'PUT',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}
data = {
  "tracks": [
    {
      "type": "person",
      "params": {
        "ageGender": True,
        "emotion": True,
        "pose": True
      }
    }
  ]
}

r = requests.put('https://api.intenseye.com/videos/${videoId}/analysis', data=data, headers = headers)

print(r.json())

require 'rest-client'
require 'json'

data = {
  "tracks" => [
    {
      "type" => "person",
      "params" => {
        "ageGender" => True,
        "emotion": => True,
        "pose" => True
      }
    }
  ]
}

result = RestClient.post 'https://api.intenseye.com/videos/${videoId}/analyze', data.to_json, {content_type: :json, accept: :json}

p JSON.parse(result)

curl -X POST https://api.intenseye.com/videos/${videoId}/analyze \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  --data '{"tracks": [{"type": "person","params": {"ageGender": true,"emotion": true,"pose": true}}]}'

PUT /videos/${videoId}/analysis

Start the analysis process on a video. It'll take a while (around 10min) to start the analysis process on the intenseye cloud so you can check if the status of your video is INPROGRESS by using GET video endpoint.

Body parameter

{
  "tracks": [
    {
      "type": "person",
      "params": {
        "ageGender": true,
        "emotion": true,
        "pose": true
      }
    }
  ]
}

Parameters

Parameter In Type Required Description
videoId path string(uuid) true ID of video to return
body body AnalyzeConfig true Configure the tracked objects by specifiying this parameters

Example responses

200 Response

{
    "status": "ok",
    "message": "Video is being prepared for analyzing",
    "data": {
        "jobId": "300d8f75-bdb5-4ac1-bf21-c0354769bb38"
    }
}

Responses

Status Meaning Description Schema
200 OK successful operation Generic Response

Cancel a video analysis job

Code samples

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json'

};

fetch('https://api.intenseye.com/videos/${videoId}/analysis_jobs/${jobId}',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.delete('https://api.intenseye.com/videos/${videoId}/analysis_jobs', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json'
}

result = RestClient.delete 'https://api.intenseye.com/videos/${videoId}/analyze',
  params: {
  }, headers: headers

p JSON.parse(result)

# You can also use wget
curl -X DELETE https://api.intenseye.com/videos/${videoId}/analyze \
  -H 'Accept: application/json'

DELETE /videos/${videoId}/analysis

Cancel a video analyze job

Parameters

Parameter In Type Required Description
videoId path string(uuid) true ID of video
jobId path string(uuid) true ID of job

Example responses

200 Response

{
  "status": "ok",
  "message": "string"
}

Responses

Status Meaning Description Schema
200 OK successful operation Generic Response

Get video analysis results

Code samples

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json'

};

fetch('https://api.intenseye.com/videos/${videoId}/analytics/${ts}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.get('https://api.intenseye.com/videos/${videoId}/analytics/${ts}', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json'
}

result = RestClient.get 'https://api.intenseye.com/videos/${videoId}/analytics/${ts}',
  params: {
  }, headers: headers

p JSON.parse(result)

# You can also use wget
curl -X GET https://api.intenseye.com/videos/${videoId}/analytics/${ts} \
  -H 'Accept: application/json'

GET /videos/${videoId}/analytics/${ts}

Get all the analytics results associated with the video.

The results are paginated. This means you need to include the nextToken in the response as query string to get the next batch.

If you defined the optional ts parameter, you can not use startDate/endDate

Parameters

Parameter In Type Required Description
videoId path string(uuid) true ID of video to return
ts path string(uuid) false Get analysis results at exact date
startDate query string long false Get analysis results starting from date
endDate query string long false Get analysis results until date
nextToken query string string false Get next paginated result

Example responses

200 Response

{
    "status": "ok",
    "data": [
        {
    "status": "ok",
    "data": [
        {
            "ts": 1033,
            "items": [
                [
                  {
                    "target": "person",
                    "trackId": "721a1826-ef99-4aa7-b0de-814ac19d6b87",
                    "coords": {
                      "top": 853.0414554447166,
                      "left": 107.49713619354867,
                      "width": 446.5641656829871,
                      "height": 895.3351440611577
                    },
                    "dwell": 3124,
                    "face": {
                      "coords": { "top": 210, "left": 50, "width": 104, "height": 140 },
                      "emotion": {
                        "angry": 0.011855,
                        "disgusted": 0.000284,
                        "fearful": 0.047599,
                        "happy": 0.587557,
                        "sad": 0.108022,
                        "surprised": 0.003734,
                        "neutral": 0.240949
                      },
                      "ageRange": { "min": 30, "max": 40 },
                      "gender": "male"
                    },
                    "pose": {
                      "nose": [245.95854455528342, 135.50286380645133],
                      "leftEye": [271.9585445552834, 109.50286380645133],
                      "rightEye": [232.95854455528342, 102.50286380645133],
                      "leftEar": [317.9585445552834, 116.50286380645133],
                      "rightEar": [212.95854455528342, 102.50286380645133],
                      "leftShoulder": [382.9585445552834, 234.50286380645133],
                      "rightShoulder": [192.95854455528342, 234.50286380645133],
                      "leftElbow": [448.9585445552834, 424.50286380645133],
                      "rightElbow": [160.95854455528342, 378.50286380645133],
                      "leftWrist": [323.9585445552834, 463.50286380645133],
                      "rightWrist": [107.95854455528342, 293.50286380645133],
                      "leftHip": [330.9585445552834, 522.5028638064514],
                      "rightHip": [212.95854455528342, 502.50286380645133],
                      "leftKnee": [199.95854455528342, 778.5028638064514],
                      "rightKnee": [22.958544555283424, 561.5028638064514],
                      "leftAnkle": [],
                      "rightAnkle": [264.9585445552834, 771.5028638064514],
                      "leftHand": [291.9585445552834, 472.50286380645133],
                      "rightHand": [93.95854455528342, 271.50286380645133],
                      "leftForeArm": [373.9585445552834, 447.50286380645133],
                      "rightForeArm": [128.95854455528342, 327.50286380645133]
                    }
                  },
                  {
                    "target": "chair",
                    "trackId": "b764e9be-7caa-4114-92b5-daa1721b545a",
                    "coordinates": {
                      "top": 176.30773063136587,
                      "left": 565.1180239532664,
                      "width": 467.129262626991,
                      "height": 477.22716055589854
                    },
                    "dwell": 3124
                  },
                  {
                    "target": "chair",
                    "trackId": "77957054-4a57-4d8e-852d-582599f242cc",
                    "coordinates": {
                      "top": 884.2640100008211,
                      "left": 619.2013159655706,
                      "width": 374.8613486162699,
                      "height": 466.4429771057436
                    },
                    "dwell": 3124
                  },
                  {
                    "target": "chair",
                    "trackId": "bdeaaf2e-dd11-478c-8fbf-bc6550417b6f",
                    "coordinates": {
                      "top": 1643.8204329583305,
                      "left": 592.664469907539,
                      "width": 273.76880307222086,
                      "height": 408.3482428651854
                    },
                    "dwell": 3124
                  },
                  {
                    "target": "chair",
                    "trackId": "81eb9166-1f20-4b73-b3a9-41ab0501d0b3",
                    "coordinates": {
                      "top": 844.6323439579762,
                      "left": 203.788279292237,
                      "width": 475.6699125323273,
                      "height": 875.372523638055
                    },
                    "dwell": 2083
                  }
                ]
            ]
        }
    ],
    "nextToken": "00160010000a000800000000000005dcf07fffffd2f07fffffd2fb53609675348bf352d1eb13ad43b0cb0004"
}
    ],
    "nextToken": "00160010000a000800000000000005dcf07fffffd2f07fffffd2fb53609675348bf352d1eb13ad43b0cb0004"
}

Responses

Status Meaning Description Schema
200 OK success Video Response

Receive video analysis results through a web socket

GET /videos/${videoId}/socket

Get all the analytics results associated with the video in real time using WebSocket

Parameters

Parameter In Type Required Description
videoId path string(uuid) true ID of video to return
key query string string true Intenseye API key
{
  "videoId": "7b538f78-f067-4211-b74c-b2fec3d67629",
  "ts": 250,
  "videoData": [
    {
      "trackId": "56d8433e-073d-4e11-8711-d9b23f10d229",
      "target": "person",
      "coordinates": {
        "left": 44,
        "top": 140.29503243941252,
        "width": 670.3355549558855,
        "height": 694.3388429752066
      },
      "dwell": 208,
      "pose": {
        "nose": [
          471,
          177
        ],
        "rightShoulder": [
          287,
          395
        ],
        "rightElbow": [
          217,
          666
        ],
        "rightWrist": [
          331,
          456
        ],
        "leftShoulder": [
          645,
          412
        ],
        "leftElbow": [
          706,
          683
        ],
        "leftWrist": [
          732,
          561
        ],
        "rightHip": [
          375,
          727
        ],
        "rightKnee": [],
        "rightAnkle": [],
        "leftHip": [
          602,
          718
        ],
        "leftKnee": [],
        "leftAnkle": [],
        "leftEye": [
          506,
          159
        ],
        "rightEye": [
          444,
          151
        ],
        "leftEar": [
          558,
          203
        ],
        "rightEar": [
          401,
          186
        ],
        "leftHand": [
          738,
          530
        ],
        "rightHand": [
          359,
          403
        ],
        "leftForeArm": [
          721,
          609
        ],
        "rightForeArm": [
          285,
          540
        ]
      }
    }
  ]
}

Get all tasks for a video

Code samples

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json'
};

fetch('https://api.intenseye.com/videos/${videoId}/tasks',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.get('https://api.intenseye.com/videos/${videoId}/tasks', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json'
}

result = RestClient.get 'https://api.intenseye.com/videos/${videoId}/tasks',
  params: {
  }, headers: headers

p JSON.parse(result)

# You can also use wget
curl -X GET https://api.intenseye.com/videos/${videoId}/tasks \
  -H 'Accept: application/json'

GET /videos/${videoId}/tasks

Get all the tasks associated with the video

Parameters

Parameter In Type Required Description
videoId path string(uuid) true ID of video to return

Example responses

200 Response

{
  "message": "success",
  "data": [
    {
      "metadata": {
      "canvasDimensions": {
        "width": 135.0,
        "height": 367.4
      },
      "imageDimensions": {
        "width": 70.5,
        "height": 157.2
      }
      },
      "rules": [
        {
          "id": "da27e1ef-2994-4b54-8d42-4864eb2edc51",
          "label": "rule label 1",
          "definitions": [
            {
              "id": "40b9bded-2821-41e5-8781-0bedf8a5620d",
              "type": "string",
              "label": "definition label 1",
              "coords": [15,20],
              "color": "#000000",
              "actions": [
                {
                  "id": "b806ed28-6b50-4afb-8462-2b3d462020f7",
                  "type": "string",
                  "target": "person",
                  "label": "action label 1",
                  "properties": {
                    "parts": ["rightHand", "leftHand"],
                    "color": "#000000",
                  }
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK success Video Response

Get a video task by task ID

Code samples

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json'

};

fetch('https://api.intenseye.com/videos/${videoId}/tasks/${taskId}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.get('https://api.intenseye.com/videos/${videoId}/tasks/${taskId}', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json'
}

result = RestClient.get 'https://api.intenseye.com/videos/${videoId}/tasks/${taskId}',
  params: {
  }, headers: headers

p JSON.parse(result)

# You can also use wget
curl -X GET https://api.intenseye.com/videos/${videoId}/tasks/${taskId} \
  -H 'Accept: application/json'

GET /videos/${videoId}/tasks/${taskId}

Get a video task with the task ID

Parameters

Parameter In Type Required Description
videoId path string(uuid) true ID of video to return
taskId path string(uuid) true ID of task to return

Example responses

200 Response

{
  "message": "success",
  "data": [
    {
      "metadata": {
      "canvasDimensions": {
        "width": 135.0,
        "height": 367.4
      },
      "imageDimensions": {
        "width": 70.5,
        "height": 157.2
      }
      },
      "rules": [
        {
          "id": "da27e1ef-2994-4b54-8d42-4864eb2edc51",
          "label": "rule label 1",
          "definitions": [
            {
              "id": "40b9bded-2821-41e5-8781-0bedf8a5620d",
              "type": "string",
              "label": "definition label 1",
              "coords": [15,20],
              "color": "#000000",
              "actions": [
                {
                  "id": "b806ed28-6b50-4afb-8462-2b3d462020f7",
                  "type": "string",
                  "target": "person",
                  "label": "action label 1",
                  "properties": {
                    "parts": ["rightHand", "leftHand"],
                    "color": "#000000",
                  }
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK success Video Response

Start a video task

Code samples

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json'

};

fetch('https://api.intenseye.com/videos/${videoId}/tasks/${taskId}',
{
  method: 'PUT',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.put('https://api.intenseye.com/videos/${videoId}/tasks/${taskId}', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json'
}

result = RestClient.put 'https://api.intenseye.com/videos/${videoId}/tasks/${taskId}',
  params: {
  }, headers: headers

p JSON.parse(result)

curl -X PUT https://api.intenseye.com/videos/${videoId}/tasks/${taskId} \
  -H 'Accept: application/json'

PUT /videos/${videoId}/tasks/${taskId}

Start a video task

Parameters

Parameter In Type Required Description
videoId path string(uuid) true ID of video to return
taskId path string(uuid) true ID of task to return

Example responses

200 Response

{
  "status": "ok",
  "message": "string"
}

Responses

Status Meaning Description Schema
200 OK successful operation Generic Response

Cancel a video task job

Code samples

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json'

};

fetch('https://api.intenseye.com/videos/${videoId}/task_jobs/${jobId}',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.delete('https://api.intenseye.com/videos/${videoId}/task_jobs/${jobId}', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json'
}

result = RestClient.delete 'https://api.intenseye.com/videos/${videoId}/task_jobs/${jobId}',
  params: {
  }, headers: headers

p JSON.parse(result)

# You can also use wget
curl -X DELETE https://api.intenseye.com/videos/${videoId}/task_jobs/${jobId} \
  -H 'Accept: application/json'

DELETE /videos/${videoId}/task_jobs/${jobId}

Cancel a video task

Parameters

Parameter In Type Required Description
videoId path string(uuid) true ID of video
jobId path string(uuid) true ID of job

Example responses

200 Response

{
  "status": "ok",
  "message": "string"
}

Responses

Status Meaning Description Schema
200 OK successful operation Generic Response

Get a video analysis job by id

Code samples

var request = require("request");

var options = { method: 'GET',
  url: 'https://api.intenseye.com/videos/7a90ddb2-08dd-4284-944e-0969ffce94bc/analysis_jobs/4d925232-649a-49da-81e6-85e10f7c15e6',
  headers: 
   { 'cache-control': 'no-cache',
     'Content-Type': 'application/json' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});


import requests

url = "https://api.intenseye.com/videos/7a90ddb2-08dd-4284-944e-0969ffce94bc/analysis_jobs/4d925232-649a-49da-81e6-85e10f7c15e6"

payload = ""
headers = {
    'Content-Type': "application/json",
    'cache-control': "no-cache"
    }

response = requests.request("GET", url, data=payload, headers=headers)

print(response.text)

require 'uri'
require 'net/http'

url = URI("https://api.intenseye.com/videos/7a90ddb2-08dd-4284-944e-0969ffce94bc/analysis_jobs/4d925232-649a-49da-81e6-85e10f7c15e6")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["cache-control"] = 'no-cache'

response = http.request(request)
puts response.read_body

curl -X GET \
  https://api.intenseye.com/videos/7a90ddb2-08dd-4284-944e-0969ffce94bc/analysis_jobs/4d925232-649a-49da-81e6-85e10f7c15e6 \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache'

GET /videos/${videoId}/analysis_jobs/${jobId}

Get analysis job by id

Parameters

Parameter In Type Required Description
videoId path string(uuid) true ID of video to return
jobId path string(uuid) true ID of job to return

Example responses

200 Response

{
    "status": "ok",
    "data": {
        "id": "4d925232-649a-49da-81e6-85e10f7c15e6",
        "videoId": "7a90ddb2-08dd-4284-944e-0969ffce94bc",
        "configId": "0c68d4df-662d-4b06-926f-efb7845cb010",
        "state": "IDLE",
        "createdAt": "2019-04-19T14:36:34Z",
        "updatedAt": "2019-04-19T14:38:49Z",
        "isTest": false
    }
}

Responses

Status Meaning Description Schema
200 OK successful operation Generic Response

Camera API

Operations about camera

Get all cameras

Code samples

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json'

};

fetch('https://api.intenseye.com/cameras',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.get('https://api.intenseye.com/cameras', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json'
}

result = RestClient.get 'https://api.intenseye.com/cameras',
  params: {
  }, headers: headers

p JSON.parse(result)

# You can also use wget
curl -X GET https://api.intenseye.com/cameras \
  -H 'Accept: application/json'

GET /cameras

Get all the cameras associated with the user

Example responses

200 Response

{
  "message": "success",
  "data": [
    {
      "id": "ed0999cc-5f9a-467a-961f-64dde8dbffb8",
      "name": "summer.mp4",
      "slug": "summermp4",
      "status": "IDLE",
      "statusMessage": "string",
      "pose": true,
      "emotion": true,
      "ageGender": true,
      "trackingTarget": "person",
      "userId": "3811d4ab-ff65-44a9-9cd1-05ff88320e6b",
      "createdAt": "2018-11-21T22:49:17Z",
      "updatedAt": "2018-11-21T22:49:17Z"
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK success Camera Response

Add a camera

Code samples

const fetch = require('node-fetch');
const inputBody = '{
  "name": "Office Camera 1",
  "url": "http://35.181.33.12:7001",
  "username": "admin",
  "password": "password"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json'

};

fetch('https://api.intenseye.com/cameras',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.post('https://api.intenseye.com/cameras', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.post 'https://api.intenseye.com/cameras',
  params: {
  }, headers: headers

p JSON.parse(result)

# You can also use wget
curl -X POST https://api.intenseye.com/cameras \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json'

POST /cameras

Add a camera

Body parameter

{
  "name": "Office Camera 1",
  "url": "http://35.181.33.12:7001",
  "username": "admin",
  "password": "password"
}

Parameters

Parameter In Type Required Description
body body Camera false none
» name body string true Give a name to your camera
» url body string true Your camera URL
» username body string false Username to connect your camera
» password body string false Password to connect your camera

Example responses

200 Response

{
  "status": "ok",
  "message": "Camera is saved"
}

Responses

Status Meaning Description Schema
200 OK Camera is saved Generic Response

Get a camera by id

Code samples

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json'

};

fetch('https://api.intenseye.com/cameras/${cameraId}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.get('https://api.intenseye.com/cameras/${cameraId}', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json'
}

result = RestClient.get 'https://api.intenseye.com/cameras/${cameraId}',
  params: {
  }, headers: headers

p JSON.parse(result)

# You can also use wget
curl -X GET https://api.intenseye.com/cameras/${cameraId} \
  -H 'Accept: application/json'

GET /cameras/${cameraId}

Get camera by id

Parameters

Parameter In Type Required Description
cameraId path string(uuid) true ID of camera to return

Example responses

200 Response

{
  "id": "ed0999cc-5f9a-467a-961f-64dde8dbffb8",
  "name": "summer.mp4",
  "slug": "summermp4",
  "status": "IDLE",
  "statusMessage": "string",
  "userId": "3811d4ab-ff65-44a9-9cd1-05ff88320e6b",
  "createdAt": "2018-11-21T22:49:17Z",
  "updatedAt": "2018-11-21T22:49:17Z"
}

Responses

Status Meaning Description Schema
200 OK successful operation Camera

Update a camera by id

Code samples

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json'

};

fetch('https://api.intenseye.com/cameras/${cameraId}',
{
  method: 'PATCH',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.patch('https://api.intenseye.com/cameras/${cameraId}', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json'
}

result = RestClient.patch 'https://api.intenseye.com/cameras/${cameraId}',
  params: {
  }, headers: headers

p JSON.parse(result)

# You can also use wget
curl -X PATCH https://api.intenseye.com/cameras/${cameraId} \
  -H 'Accept: application/json'

PATCH /cameras/${cameraId}

Update a camera by id

Parameters

Parameter In Type Required Description
cameraId path string(uuid) true ID of camera to return

Example responses

200 Response

{
  "status": "ok",
  "message": "Camera Updated"
}

Responses

Status Meaning Description Schema
200 OK successful operation Camera

Start an analysis on a camera

Code samples

var request = require("request");

var options = { method: 'PUT',
  url: 'https://api.intenseye.com/cameras/7a90ddb2-08dd-4284-944e-0969ffce94bc/analysis',
  headers: 
   { 'cache-control': 'no-cache',
     Authorization: 'Basic M2NjM2NiNDI1NDViODQ4MjZiZWIxZTZiYjdkZWQ3ZDM6',
     'Content-Type': 'application/json' },
  body: 
   { targets: 
      [ { type: 'person',
          params: { ageGender: true, emotion: true, pose: true } } ] },
  json: true };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

import requests

url = "https://api.intenseye.com/cameras/7a90ddb2-08dd-4284-944e-0969ffce94bc/analysis"

payload = "{\n    \"targets\": [\n        {\n            \"type\": \"person\",\n            \"params\": {\n                \"ageGender\": true,\n                \"emotion\": true,\n                \"pose\": true\n            }\n        }\n    ]\n}"
headers = {
    'Content-Type': "application/json",
    'Authorization': "Basic M2NjM2NiNDI1NDViODQ4MjZiZWIxZTZiYjdkZWQ3ZDM6",
    'cache-control': "no-cache"
    }

response = requests.request("PUT", url, data=payload, headers=headers)

print(response.text)

require 'uri'
require 'net/http'

url = URI("https://api.intenseye.com/cameras/7a90ddb2-08dd-4284-944e-0969ffce94bc/analysis")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request["Authorization"] = 'Basic M2NjM2NiNDI1NDViODQ4MjZiZWIxZTZiYjdkZWQ3ZDM6'
request["cache-control"] = 'no-cache'
request.body = "{
    \"targets\": [
        {
            \"type\": \"person\",
            \"params\": {
                \"ageGender\": true,
                \"emotion\": true,
                \"pose\": true
            }
        }
    ]
}"

response = http.request(request)
puts response.read_body

curl -X PUT \
  https://api.intenseye.com/cameras/7a90ddb2-08dd-4284-944e-0969ffce94bc/analysis \
  -H 'Authorization: Basic M2NjM2NiNDI1NDViODQ4MjZiZWIxZTZiYjdkZWQ3ZDM6' \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache' \
  -d '{
    "targets": [
        {
            "type": "person",
            "params": {
                "ageGender": true,
                "emotion": true,
                "pose": true
            }
        }
    ]
}'

PUT /cameras/${cameraId}/analysis

Start the analysis process on a camera. It'll take a while (around 10min) to start the analysis process on the intenseye cloud so you can check if the status of your camera is INPROGRESS by using GET camera endpoint.

Body parameter

{
  "tracks": [
    {
      "type": "person",
      "params": {
        "ageGender": true,
        "emotion": true,
        "pose": true
      }
    }
  ]
}

Parameters

Parameter In Type Required Description
cameraId path string(uuid) true ID of camera to return
body body AnalyzeConfig true Configure the tracked objects by specifiying this parameters

Example responses

200 Response

{
    "status": "ok",
    "message": "Camera is being prepared for analyzing",
    "data": {
        "jobId": "300d8f75-bdb5-4ac1-bf21-c0354769bb38"
    }
}

Responses

Status Meaning Description Schema
200 OK successful operation Generic Response

Cancel a camera analyze process

Code samples

var request = require("request");

var options = { method: 'DELETE',
  url: 'https://api.intenseye.com/cameras/7a90ddb2-08dd-4284-944e-0969ffce94bc/analysis_jobs/4d925232-649a-49da-81e6-85e10f7c15e6',
  headers: 
   { 'cache-control': 'no-cache',
     'Content-Type': 'application/json' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

import requests

url = "https://api.intenseye.com/cameras/7a90ddb2-08dd-4284-944e-0969ffce94bc/analysis_jobs/4d925232-649a-49da-81e6-85e10f7c15e6"

payload = ""
headers = {
    'Content-Type': "application/json",
    'cache-control': "no-cache"
    }

response = requests.request("DELETE", url, data=payload, headers=headers)

print(response.text)

require 'uri'
require 'net/http'

url = URI("https://api.intenseye.com/cameras/7a90ddb2-08dd-4284-944e-0969ffce94bc/analysis_jobs/4d925232-649a-49da-81e6-85e10f7c15e6")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Delete.new(url)
request["Content-Type"] = 'application/json'
request["cache-control"] = 'no-cache'

response = http.request(request)
puts response.read_body
curl -X GET \
  https://api.intenseye.com/cameras/7a90ddb2-08dd-4284-944e-0969ffce94bc/analysis_jobs/4d925232-649a-49da-81e6-85e10f7c15e6 \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache'

DELETE /cameras/${cameraId}/analysis

Cancel a camera analyze process

Parameters

Parameter In Type Required Description
cameraId path string(uuid) true ID of camera
jobId path string(uuid) true ID of job

Example responses

200 Response

{
  "status": "ok",
  "message": "string"
}

Responses

Status Meaning Description Schema
200 OK successful operation Generic Response

Get camera analysis results

Code samples

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json'

};

fetch('https://api.intenseye.com/cameras/${cameraId}/analytics/${ts}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.get('https://api.intenseye.com/cameras/${cameraId}/analytics/${ts}', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json'
}

result = RestClient.get 'https://api.intenseye.com/cameras/${cameraId}/analytics/${ts}',
  params: {
  }, headers: headers

p JSON.parse(result)

# You can also use wget
curl -X GET https://api.intenseye.com/cameras/${cameraId}/analytics/${ts} \
  -H 'Accept: application/json'

GET /cameras/${cameraId}/analytics/${ts}

Get all the analytics results associated with the camera.

The results are paginated. This means you need to include the nextToken in the response as query string to get the next batch.

If you defined the optional ts parameter, you can not use startDate/endDate

Parameters

Parameter In Type Required Description
cameraId path string(uuid) true ID of camera to return
ts path string(uuid) false Get analysis results at exact date
startDate query string long false Get analysis results starting from date
endDate query string long false Get analysis results until date
nextToken query string string false Get next paginated result

Example responses

200 Response

{
    "status": "ok",
    "data": [
        {
            "ts": 1033,
            "items": [
                [
                  {
                    "target": "person",
                    "trackId": "721a1826-ef99-4aa7-b0de-814ac19d6b87",
                    "coords": {
                      "top": 853.0414554447166,
                      "left": 107.49713619354867,
                      "width": 446.5641656829871,
                      "height": 895.3351440611577
                    },
                    "dwell": 3124,
                    "face": {
                      "coords": { "top": 210, "left": 50, "width": 104, "height": 140 },
                      "emotion": {
                        "angry": 0.011855,
                        "disgusted": 0.000284,
                        "fearful": 0.047599,
                        "happy": 0.587557,
                        "sad": 0.108022,
                        "surprised": 0.003734,
                        "neutral": 0.240949
                      },
                      "ageRange": { "min": 30, "max": 40 },
                      "gender": "male"
                    },
                    "pose": {
                      "nose": [245, 135],
                      "leftEye": [271, 109],
                      "rightEye": [232, 102],
                      "leftEar": [317, 116],
                      "rightEar": [212, 102],
                      "leftShoulder": [382, 234],
                      "rightShoulder": [192, 234],
                      "leftElbow": [448, 424],
                      "rightElbow": [160, 378],
                      "leftWrist": [323, 463],
                      "rightWrist": [107, 293],
                      "leftHip": [330, 522],
                      "rightHip": [212, 502],
                      "leftKnee": [199, 778],
                      "rightKnee": [22, 561],
                      "leftAnkle": [],
                      "rightAnkle": [264, 771],
                      "leftHand": [291, 472],
                      "rightHand": [93, 271],
                      "leftForeArm": [373, 447],
                      "rightForeArm": [1282, 3273]
                    }
                  },
                  {
                    "target": "chair",
                    "trackId": "b764e9be-7caa-4114-92b5-daa1721b545a",
                    "coordinates": {
                      "top": 176.30773063136587,
                      "left": 565.1180239532664,
                      "width": 467.129262626991,
                      "height": 477.22716055589854
                    },
                    "dwell": 3124
                  },
                  {
                    "target": "chair",
                    "trackId": "77957054-4a57-4d8e-852d-582599f242cc",
                    "coordinates": {
                      "top": 884.2640100008211,
                      "left": 619.2013159655706,
                      "width": 374.8613486162699,
                      "height": 466.4429771057436
                    },
                    "dwell": 3124
                  },
                  {
                    "target": "chair",
                    "trackId": "bdeaaf2e-dd11-478c-8fbf-bc6550417b6f",
                    "coordinates": {
                      "top": 1643.8204329583305,
                      "left": 592.664469907539,
                      "width": 273.76880307222086,
                      "height": 408.3482428651854
                    },
                    "dwell": 3124
                  },
                  {
                    "target": "chair",
                    "trackId": "81eb9166-1f20-4b73-b3a9-41ab0501d0b3",
                    "coordinates": {
                      "top": 844.6323439579762,
                      "left": 203.788279292237,
                      "width": 475.6699125323273,
                      "height": 875.372523638055
                    },
                    "dwell": 2083
                  }
                ]
            ]
        }
    ],
    "nextToken": "00160010000a000800000000000005dcf07fffffd2f07fffffd2fb53609675348bf352d1eb13ad43b0cb0004"
}

Responses

Status Meaning Description Schema
200 OK success Camera Response

Receive camera analysis results through a web socket

GET /cameras /${videoId}/socket

Get all the analytics results associated with the camera in real time using WebSocket

Parameters

Parameter In Type Required Description
videoId path string(uuid) true ID of camera to return
key query string string true Intenseye API key
{
  "cameraId": "7b538f78-f067-4211-b74c-b2fec3d67629",
  "ts": 250,
  "cameraData": [
    {
      "trackId": "56d8433e-073d-4e11-8711-d9b23f10d229",
      "target": "person",
      "coordinates": {
        "left": 44,
        "top": 140.29503243941252,
        "width": 670.3355549558855,
        "height": 694.3388429752066
      },
      "dwell": 208,
      "pose": {
        "nose": [
          471,
          177
        ],
        "rightShoulder": [
          287,
          395
        ],
        "rightElbow": [
          217,
          666
        ],
        "rightWrist": [
          331,
          456
        ],
        "leftShoulder": [
          645,
          412
        ],
        "leftElbow": [
          706,
          683
        ],
        "leftWrist": [
          732,
          561
        ],
        "rightHip": [
          375,
          727
        ],
        "rightKnee": [],
        "rightAnkle": [],
        "leftHip": [
          602,
          718
        ],
        "leftKnee": [],
        "leftAnkle": [],
        "leftEye": [
          506,
          159
        ],
        "rightEye": [
          444,
          151
        ],
        "leftEar": [
          558,
          203
        ],
        "rightEar": [
          401,
          186
        ],
        "leftHand": [
          738,
          530
        ],
        "rightHand": [
          359,
          403
        ],
        "leftForeArm": [
          721,
          609
        ],
        "rightForeArm": [
          285,
          540
        ]
      }
    }
  ]
}

Get all tasks for a camera

Code samples

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json'

};

fetch('https://api.intenseye.com/cameras/${cameraId}/tasks',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.get('https://api.intenseye.com/cameras/${cameraId}/tasks', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json'
}

result = RestClient.get 'https://api.intenseye.com/cameras/${cameraId}/tasks',
  params: {
  }, headers: headers

p JSON.parse(result)

# You can also use wget
curl -X GET https://api.intenseye.com/cameras/${cameraId}/tasks \
  -H 'Accept: application/json'

GET /cameras/${cameraId}/tasks

Get all the tasks associated with the camera

Parameters

Parameter In Type Required Description
cameraId path string(uuid) true ID of camera to return

Example responses

200 Response

{
  "message": "success",
  "data": [
    {
      "metadata": {
      "canvasDimensions": {
        "width": 135.0,
        "height": 367.4
      },
      "imageDimensions": {
        "width": 70.5,
        "height": 157.2
      }
      },
      "rules": [
        {
          "id": "da27e1ef-2994-4b54-8d42-4864eb2edc51",
          "label": "rule label 1",
          "definitions": [
            {
              "id": "40b9bded-2821-41e5-8781-0bedf8a5620d",
              "type": "string",
              "label": "definition label 1",
              "coords": [15,20]],
              "color": "#000000",
              "actions": [
                {
                  "id": "b806ed28-6b50-4afb-8462-2b3d462020f7",
                  "type": "string",
                  "target": "person",
                  "label": "action label 1",
                  "properties": {
                    "parts": ["rightHand", "leftHand"],
                    "color": "#000000",
                  }
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK success Camera Response

Get a camera task by task ID

Code samples

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json'

};

fetch('https://api.intenseye.com/cameras/${cameraId}/tasks/${taskId}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.get('https://api.intenseye.com/cameras/${cameraId}/tasks/${taskId}', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json'
}

result = RestClient.get 'https://api.intenseye.com/cameras/${cameraId}/tasks/${taskId}',
  params: {
  }, headers: headers

p JSON.parse(result)

# You can also use wget
curl -X GET https://api.intenseye.com/cameras/${cameraId}/tasks/${taskId} \
  -H 'Accept: application/json'

GET /cameras/${cameraId}/tasks/${taskId}

Get a camera task with the task ID

Parameters

Parameter In Type Required Description
cameraId path string(uuid) true ID of camera to return
taskId path string(uuid) true ID of task to return

Example responses

200 Response

{
  "message": "success",
  "data": [
    {
      "metadata": {
      "canvasDimensions": {
        "width": 135.0,
        "height": 367.4
      },
      "imageDimensions": {
        "width": 70.5,
        "height": 157.2
      }
      },
      "rules": [
        {
          "id": "da27e1ef-2994-4b54-8d42-4864eb2edc51",
          "label": "rule label 1",
          "definitions": [
            {
              "id": "40b9bded-2821-41e5-8781-0bedf8a5620d",
              "type": "string",
              "label": "definition label 1",
              "coords": [15,20]],
              "color": "#000000",
              "actions": [
                {
                  "id": "b806ed28-6b50-4afb-8462-2b3d462020f7",
                  "type": "string",
                  "target": "person",
                  "label": "action label 1",
                  "properties": {
                    "parts": ["rightHand", "leftHand"],
                    "color": "#000000",
                  }
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK success Camera Response

Start a camera task

Code samples

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json'

};

fetch('https://api.intenseye.com/cameras/${cameraId}/tasks/${taskId}',
{
  method: 'PUT',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.put('https://api.intenseye.com/cameras/${cameraId}/tasks/${taskId}', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json'
}

result = RestClient.put 'https://api.intenseye.com/cameras/${cameraId}/tasks/${taskId}',
  params: {
  }, headers: headers

p JSON.parse(result)

# You can also use wget
curl -X PUT https://api.intenseye.com/cameras/${cameraId}/tasks/${taskId} \
  -H 'Accept: application/json'

PUT /cameras/:cameraId/tasks/:taskId

Start a camera task

Parameters

Parameter In Type Required Description
cameraId path string(uuid) true ID of camera to return
taskId path string(uuid) true ID of task to return

Example responses

200 Response

{
  "status": "ok",
  "message": "string"
}

Responses

Status Meaning Description Schema
200 OK successful operation Generic Response

Cancel a camera task

Code samples

var request = require("request");

var options = { method: 'GET',
  url: 'https://api.intenseye.com/cameras/7a90ddb2-08dd-4284-944e-0969ffce94bc/task_jobs/4d925232-649a-49da-81e6-85e10f7c15e6',
  headers: 
   { 'cache-control': 'no-cache',
     Authorization: 'Basic M2NjM2NiNDI1NDViODQ4MjZiZWIxZTZiYjdkZWQ3ZDM6',
     'Content-Type': 'application/json' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});


import requests

url = "https://api.intenseye.com/cameras/7a90ddb2-08dd-4284-944e-0969ffce94bc/task_jobs/4d925232-649a-49da-81e6-85e10f7c15e6"

payload = ""
headers = {
    'Content-Type': "application/json",
    'Authorization': "Basic M2NjM2NiNDI1NDViODQ4MjZiZWIxZTZiYjdkZWQ3ZDM6",
    'cache-control': "no-cache"
    }

response = requests.request("GET", url, data=payload, headers=headers)

print(response.text)

require 'uri'
require 'net/http'

url = URI("https://api.intenseye.com/cameras/7a90ddb2-08dd-4284-944e-0969ffce94bc/task_jobs/4d925232-649a-49da-81e6-85e10f7c15e6")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["Authorization"] = 'Basic M2NjM2NiNDI1NDViODQ4MjZiZWIxZTZiYjdkZWQ3ZDM6'
request["cache-control"] = 'no-cache'

response = http.request(request)
puts response.read_body

curl -X GET \
  https://api.intenseye.com/cameras/7a90ddb2-08dd-4284-944e-0969ffce94bc/task_jobs/4d925232-649a-49da-81e6-85e10f7c15e6 \
  -H 'Authorization: Basic M2NjM2NiNDI1NDViODQ4MjZiZWIxZTZiYjdkZWQ3ZDM6' \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache'

DELETE /cameras/:cameraId/task_jobs/:jobId

Cancel a camera task

Parameters

Parameter In Type Required Description
cameraId path string(uuid) true ID of camera to return
jobId path string(uuid) true ID of job to return

Example responses

200 Response

{
  "status": "ok",
  "message": "string"
}

Responses

Status Meaning Description Schema
200 OK successful operation Generic Response

Image API

Operations about images

Detection API

You can call the detection api via PUT method by defining your track items.

Get Detection

Code samples

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json'

};
const payload = {
  "image": {
      "url": "https://i.imgur.com/SMvjyhH.jpg"
  },
  "tracks": [{
          "type": "person",
          "params": {
              "pose": true,
              "emotion": false,
              "ageGender": false
          }
      }
  ],
  "options": {
      "objectDetection": {
          "confidence": 0.7
      }
  }
}
fetch(`https://api.intenseye.com/images/detection`,
{
  method: 'PUT',
  body: JSON.stringify(payload),
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json'
}
payload = {
  "image": {
      "url": "https://i.imgur.com/SMvjyhH.jpg"
  },
  "tracks": [{
          "type": "person",
          "params": {
              "pose": true,
              "emotion": false,
              "ageGender": false
          }
      }
  ],
  "options": {
      "objectDetection": {
          "confidence": 0.7
      }
  }
}
r = requests.get('https://api.intenseye.com/detection', data=json.dumps(payload), headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json'
}

payload = {
  "image": {
      "url": "https://i.imgur.com/SMvjyhH.jpg"
  },
  "tracks": [{
          "type": "person",
          "params": {
              "pose": true,
              "emotion": false,
              "ageGender": false
          }
      }
  ],
  "options": {
      "objectDetection": {
          "confidence": 0.7
      }
  }
}

result = RestClient.put "https://api.intenseye.com/detection", payload, {content_type: :json, accept: :json}

p JSON.parse(result)

curl -X PUT \
  https://api.intenseye.com/images/detection \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache' \
  -d '{
    "image": {
        "url": "https://bloximages.chicago2.vip.townnews.com/siouxcityjournal.com/content/tncms/assets/v3/editorial/1/d5/1d5bda56-2505-5b93-bef8-6f3c7e19590e/5b7d798a24b6d.image.jpg?resize=1200%2C1408"
    },
    "tracks": [{
            "type": "person",
            "params": {
                "pose": false,
                "emotion": false,
                "ageGender": false
            }
        }
    ],
    "options": {
        "objectDetection": {
            "confidence": 0.7
        },
        "pose": {
            "confidence": 0.3
        }
    }
}'

PUT /images/detection

Get image detection

Parameters

Parameter In Type Required Description
image body object true Image object to be analyzed. See Image for more detail
tracks body array(object) true List of objects to be tracked. See Track for more detail.
options body object false Extra options for tracks to pass to the model

Example request body

{
    "image": {
        "url": "https://i.ytimg.com/vi/7nIQv3K_-Qc/maxresdefault.jpg"
    },
    "tracks": [
          {
            "type": "person",
            "params": {
                "pose": false,
                "emotion": false,
                "ageGender": false
          }
        }
    ],
    "options": {
        "objectDetection": {
            "confidence": 0.7
        },
        "pose": {
            "confidence": 0.3
        }
    }
}

Example responses

200 Response

{
  "data": [
    {
      "type": "car",
      "confidence": 0.5368256568908691,
      "coords": {
        "top": 734,
        "left": 174,
        "height": 24,
        "width": 56
      }
    },
    {
      "type": "person",
      "confidence": 0.9996501207351685,
      "coords": {
        "top": 499,
        "left": 323,
        "height": 134,
        "width": 69
      }
    }
  ],
  "metadata": {
    "dimensions": {
      "width": 1920,
      "height": 1080
    },
    "format": "PNG"
  }
}

Responses

Status Meaning Description Schema
200 OK success Image Detection

Errors

The Intenseye API uses the following error codes:

Error Code Meaning
400 Bad Request -- Your request is invalid.
401 Unauthorized -- Your API key is wrong.
403 Forbidden -- The requested resource is not permitted
404 Not Found -- The specified resource could not be found.
405 Method Not Allowed -- You tried to access a resource with an invalid method.
410 Gone -- The resource requested has been removed from our servers.
415 Unsupported Media Type -- You requested with a format that isn't json.
429 Too Many Requests -- You're requesting too many resources! Slow down!
500 Internal Server Error -- We had a problem with our server. Try again later.
503 Service Unavailable -- We're temporarily offline for maintenance. Please try again later.

Schemas

Video

{
  "id": "ed0999cc-5f9a-467a-961f-64dde8dbffb8",
  "name": "summer.mp4",
  "slug": "summermp4",
  "size": 129532,
  "status": "IDLE",
  "statusMessage": "string",
  "userId": "3811d4ab-ff65-44a9-9cd1-05ff88320e6b",
  "createdAt": "2018-11-21T22:49:17Z",
  "updatedAt": "2018-11-21T22:49:17Z"
}

Properties

Name Type Required Restrictions Description
id string(uuid) true none none
name string true none none
slug string true none none
size number(int32) false none none
status string true none none
statusMessage string false none none
userId string(uuid) true none none
createdAt string(date-time) true none none
updatedAt string(date-time) true none none

Enumerated Values

Property Value
status IDLE
status PREPARING
status INPROGRESS
status FINISHED
status ERROR

Camera

{
  "id": "ed0999cc-5f9a-467a-961f-64dde8dbffb8",
  "name": "summer.mp4",
  "slug": "summermp4",
  "status": "IDLE",
  "statusMessage": "string",
  "pose": true,
  "emotion": true,
  "ageGender": true,
  "trackingTarget": "person",
  "userId": "3811d4ab-ff65-44a9-9cd1-05ff88320e6b",
  "createdAt": "2018-11-21T22:49:17Z",
  "updatedAt": "2018-11-21T22:49:17Z"
}

Properties

Name Type Required Restrictions Description
id string(uuid) true none none
name string true none none
slug string true none none
status string true none none
statusMessage string false none none
userId string(uuid) true none none
createdAt string(date-time) true none none
updatedAt string(date-time) true none none

Enumerated Values

Property Value
status IDLE
status PREPARING
status INPROGRESS
status FINISHED
status ERROR

Generic Response

{
  "status": "ok",
  "data": "array"
}

Properties

Name Type Required Restrictions Description
status string false none none
data array true none none

Enumerated Values

Property Value
status ok
status ko

Insert Response

{
  "status": "ok",
  "insertedItem": "string"
}

Properties

Name Type Required Restrictions Description
status string true none none
insertedItem string(uuid) true none none

API Key

{
  "userId": "string",
  "key": "string"
}

Properties

Name Type Required Restrictions Description
userId string(uuid) true none none
key string(uuid) true none none

Image

  {
    "url": "https://i.ytimg.com/vi/7nIQv3K_-Qc/maxresdefault.jpg",
    "bytes": "iVBORw0KGgoAAAANSUhEUgAABDgAAAJfCAYAAACaMWZXAAAgAElEQVR4Xky9SbNl53Ultk7f3/6+Jl+2yERLAaRIghRZxVCVw1ZJNXCpKlxWyDVyeOI..."
  }

Image object can only have url or bytes but not both. You can either supply a stored image on a url or base64 converted image.

Tracking Parameters

{
  "ageGender": true,
  "emotion": true,
  "pose": true
}

Properties

Name Type Required Restrictions Description
ageGender boolean false none none
emotion boolean false none none
pose boolean false none none

Tracking Target

"person"

Properties

Name Type Required Restrictions Description
anonymous string false none none

Enumerated Values

Property Value
anonymous person
anonymous car

Api Key Response

{
  "message": "string",
  "data": [
    {
      "userId": "string",
      "key": "string"
    }
  ]
}

Properties

Name Type Required Restrictions Description
message string false none none
data [API Key] false none none

Video Response

{
  "message": "success",
  "data": [
    {
      "id": "ed0999cc-5f9a-467a-961f-64dde8dbffb8",
      "name": "summer.mp4",
      "slug": "summermp4",
      "size": 129532,
      "status": "IDLE",
      "statusMessage": "string",
      "pose": true,
      "emotion": true,
      "ageGender": true,
      "trackingTarget": "person",
      "userId": "3811d4ab-ff65-44a9-9cd1-05ff88320e6b",
      "createdAt": "2018-11-21T22:49:17Z",
      "updatedAt": "2018-11-21T22:49:17Z"
    }
  ]
}

Properties

Name Type Required Restrictions Description
status string false none none
data [Video] false none none

Enumerated Values

Property Value
status ok
status ko

Camera Response

{
  "message": "success",
  "data": [
    {
      "id": "ed0999cc-5f9a-467a-961f-64dde8dbffb8",
      "name": "summer.mp4",
      "slug": "summermp4",
      "status": "IDLE",
      "statusMessage": "string",
      "userId": "3811d4ab-ff65-44a9-9cd1-05ff88320e6b",
      "createdAt": "2018-11-21T22:49:17Z",
      "updatedAt": "2018-11-21T22:49:17Z"
    }
  ]
}

Properties

Name Type Required Restrictions Description
message string false none none
data [Camera] false none none

Image Detection

{
  "type": "person",
  "confidence": 0.994,
  "coords": {
    "top": 30,
    "left": 26,
    "width": 44,
    "height": 120
  },
  "face": {
    "coords": {
        "top": 24,
        "left": 24,
        "width": 38,
        "height": 48
    },
    "emotions": {
        "angry": 0.003,
        "disgusted": 0.000,
        "fearful": 0.009,
        "happy": 0.0255,
        "sad": 0.803,
        "surprised": 0.001,
        "neutral": 0.155
    }
  },
  "pose": {
    "nose": [
        45,
        30
    ],
    "leftEye": [
        59,
        55
    ],
    "rightEye": [
        31,
        4
    ],
  },
}

Properties

Name Type Required Restrictions Description
type string true none none
confidence number true none none
coords Coords true none none

Enumerated Values

Property Value
type person
type car
type bicycle

Coords

{
  "top": "number",
  "left": "number",
  "width": "number",
  "height": "number"
}
Name Type Required Restrictions Description
top number true none none
left number true none none
bottom number true none none
right number true none none

Analyze Configuration

{
  "targets": "array",
}
Name Type Required Restrictions Description
targets array(Track) true none A track object which is required to define a trackable item and it's properties (if available)

Track

{
  "type": "string",
  "params": "object"
}
Name Type Required Restrictions Description
type Tracking Target true none Trackable item type
params object(Track Parameters) false none Optional parameters which you can pass to extract more information

Track Parameters

{
  "ageGender": "boolean",
  "pose": "boolean",
  "emotion": "boolean"
}
Name Type Required Restrictions Description
ageGender boolean false none Enable age gender tracking
pose boolean false none Enable pose tracking
emotion boolean false none Enable emotion tracking