Introduction
curl -X GET -H "x-api-key: <API-KEY>" https://api.unleashlive.com/v1/analytics/{deviceId}/{unixUTCTimeStampFrom}/{unixUTCTimeStampTo}/{pageNumber}
import urllib3
http = urllib3.PoolManager()
r = http.request('GET', 'https://api.unleashlive.com/v1/analytics/{deviceId}/{unixUTCTimeStampFrom}/{unixUTCTimeStampTo}/{pageNumber}', headers={'x-api-key': <API-KEY>})
r.data
{
"keys":["class_name","count","device_id","frame_number","model_id","session_id","source_file_name","timestamp"],
"total_num_pages":1,
"data":[
["this_frame_persons_count",3,"W9d3f1bcad8e8abd",1,"sparse-crowd-density-alphapose","1597644726430","W9d3f1bcad8e8abd-1597644023-17-Aug-20-06-00-23.mp4","2020-08-17T06:16:45.000Z"],["total_count",3,"W9d3f1bcad8e8abd",1,"sparse-crowd-density-alphapose","1597644726430","W9d3f1bcad8e8abd-1597644023-17-Aug-20-06-00-23.mp4","2020-08-17T06:16:45.000Z"],["number_of_persons_in_group",2,"W9d3f1bcad8e8abd",1,"sparse-crowd-density-alphapose","1597644726430","W9d3f1bcad8e8abd-1597644023-17-Aug-20-06-00-23.mp4","2020-08-17T06:16:45.000Z"],["number_of_groups",1,"W9d3f1bcad8e8abd",1,"sparse-crowd-density-alphapose","1597644726430","W9d3f1bcad8e8abd-1597644023-17-Aug-20-06-00-23.mp4","2020-08-17T06:16:45.000Z"],["num_individuals",1,"W9d3f1bcad8e8abd",1,"sparse-crowd-density-alphapose","1597644726430","W9d3f1bcad8e8abd-1597644023-17-Aug-20-06-00-23.mp4","2020-08-17T06:16:45.000Z"],["group_pixel_size",0,"W9d3f1bcad8e8abd",1,"sparse-crowd-density-alphapose","1597644726430","W9d3f1bcad8e8abd-1597644023-17-Aug-20-06-00-23.mp4","2020-08-17T06:16:45.000Z"],["total_count",10,"W9d3f1bcad8e8abd",236,"sparse-crowd-density-alphapose","1597644726430","W9d3f1bcad8e8abd-1597644023-17-Aug-20-06-00-23.mp4","2020-08-17T06:16:52.000Z"]
]
}
Welcome to the Unleash live API!
The Unleash live Analytics API connects you to all the data you need to build interactive reports or data tables from your Unleash live account.
You can use this API to access several Unleash live Analytics API endpoints, which return AI-generated analytics data from your Unleash live account.
Build tools that solve real business problems around the world.
FAQ
For the FAQ's please follow this link: knowledge.unleashlive.com.
For any extra assistance, please contact us here.
Analytics API
Description
This API exposes Unleash live read-only endpoints, allowing developers and users to retrieve AI-generated analytics data.
API access is currently an optional addon, please contact your account manager to request a demo or for more information.
API Key
An API key is required for all API endpoints.
Please contact your Unleash live accounts technical support manager for assistance.
URL
The current analytics API can be found at:
https://api.unleashlive.com/v1
Parameters
All in-use parameters appear here, consult each endpoint for more information on what is required.
Headers
curl -X GET -H "x-api-key: <API-KEY>" <URL>
import urllib3
http = urllib3.PoolManager()
r = http.request('GET', <ENDPOINT>, headers={'x-api-key': <API-KEY>})
r.data
Only one custom header is required to use the Analytics API - your individual customer API key.
x-api-key: <API KEY>
Variables
Name | Type | Constraints | Description | Example |
---|---|---|---|---|
deviceId | string | required, uuid format | Unique Device ID | Wabcdb35be35bb72 |
unixUTCTimeStampFrom | integer | required, uuid format | Unix epoch, Nanoseconds | 1597630156000 |
unixUTCTimeStampTo | integer | required, uuid format | Unix epoch, Nanoseconds | 1597630156000 |
pageNumber | integer | required, uuid format | Page number | 1 |
Endpoints
All current valid endpoints.
Version
curl -X GET -H "x-api-key: <API-KEY>" https://api.unleashlive.com/v1/analytics/version
import urllib3
http = urllib3.PoolManager()
r = http.request('GET', 'https://api.unleashlive.com/v1/analytics/version', headers={'x-api-key': <API-KEY>})
r.data
{"1.0.1"}
Retrieve current API version number.
Returns version number in the format "1.0.1"
, and should be used for testing and confirmation of valid API key.
API Endpoint
GET /analytics/version
Devices
curl -X GET -H "x-api-key: <API-KEY>" https://api.unleashlive.com/v1/analytics/devices
import urllib3
http = urllib3.PoolManager()
r = http.request('GET', 'https://api.unleashlive.com/v1/analytics/devices', headers={'x-api-key': <API-KEY>})
r.data
["Wb8fabc31378ce07","W022abc5be35bb72","Weea288bc1faaddd"]
Returns a list of all valid devices for a given API Key and account in the format:
["Wabcdb35be35bb72", ...]
Where each item corresponds to an Unleash live Device ID.
API Endpoint
GET /analytics/devices
Sessions
curl -X GET -H "x-api-key: <API-KEY>" https://api.unleashlive.com/v1/analytics/sessions
import urllib3
http = urllib3.PoolManager()
r = http.request('GET', 'https://api.unleashlive.com/v1/analytics/sessions', headers={'x-api-key': <API-KEY>})
r.data
["1595418530512","1595452859625","1595492155987"]
Returns a list of all sessions for a given API Key and account in the format:
["1595418530512", ...]
Where each item corresponds to an Unleash live session ID.
API Endpoint
GET /analytics/sessions
Size Optimized Data
curl -X GET -H "x-api-key: <API-KEY>" https://api.unleashlive.com/v1/analytics/{deviceId}/{unixUTCTimeStampFrom}/{unixUTCTimeStampTo}/{pageNumber}
import urllib3
http = urllib3.PoolManager()
r = http.request('GET', 'https://api.unleashlive.com/v1/analytics/{deviceId}/{unixUTCTimeStampFrom}/{unixUTCTimeStampTo}/{pageNumber}', headers={'x-api-key': <API-KEY>})
r.data
{"keys": ["class_name","count","device_id","frame_number","model_id","session_id","source_file_name","timestamp"],
"total_num_pages":1,
"data":[["person",1,"Wabcdb35be35bb72",110251,"starter-ai","1597622730877","Wabcdb35be35bb72?token=sneaky-firefox-288","2020-08-17T02:08:49.000Z"],
["person",3,"Wabcdb35be35bb72",110252,"starter-ai","1597622730878","Wabcdb35be35bb72?token=sneaky-firefox-288","2020-08-17T02:08:49.000Z"]]}
Retrieve raw analytics data generated between two given dates.
This endpoint is size-optimized - three fields are returned:
Field | Type | Description |
---|---|---|
keys | list (string) | A list of all keys used in the data field, in order of use. |
total_num_pages | integer | The number of pages available for the requested data. |
data | list (mixed) | List containing all requested data. |
API Endpoint
GET /analytics/{deviceId}/{unixUTCTimeStampFrom}/{unixUTCTimeStampTo}/{pageNumber}
Tableau Formatted Data
curl -X GET -H "x-api-key: <API-KEY>" https://api.unleashlive.com/v1/analytics/tableau/{deviceId}/{unixUTCTimeStampFrom}/{unixUTCTimeStampTo}/{pageNumber}
import urllib3
http = urllib3.PoolManager()
r = http.request('GET', 'https://api.unleashlive.com/v1/analytics/tableau/{deviceId}/{unixUTCTimeStampFrom}/{unixUTCTimeStampTo}/{pageNumber}', headers={'x-api-key': <API-KEY>})
r.data
{"total_num_pages":1,
"data":[{"timestamp":"2020-08-17T02:08:49.000Z","class_name":"person","count":1,"device_id":"Wabcdb35be35bb72","source_file_name":"Wabcdb35be35bb72?token=sneaky-firefox-288","frame_number":110251,"model_id":"starter-ai","session_id":"1597622730877"},
{"timestamp":"2020-08-17T02:08:49.000Z","class_name":"truck","count":1,"device_id":"Wabcdb35be35bb72","source_file_name":"Wabcdb35be35bb72?token=sneaky-firefox-288","frame_number":110252,"model_id":"starter-ai","session_id":"1597622730877"}]}
Retrieve tableau formatted analytics data generated between two given dates.
This endpoint is descriptive, allowing data to be read nativily by services such as Tableau and salesforce easily.
Field | Type | Description |
---|---|---|
total_num_pages | integer | The number of pages available for the requested data. |
data | list (mixed) | List containing all requested data. |
API Endpoint
GET /analytics/tableau/{deviceId}/{unixUTCTimeStampFrom}/{unixUTCTimeStampTo}/{pageNumber}
Errors
Error Codes
The Unleash live API uses the following error codes:
Error Code | Meaning |
---|---|
400 | Bad Request - Wrong or missing parameters. |
403 | Forbidden - Your API key is wrong. |
422 | Validation failed - Params content failed validation. |
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. |
Error Response Format
curl -X GET -H "x-api-key: none" https://api.unleashlive.com/v1/analytics/version
import urllib3
http = urllib3.PoolManager()
r = http.request('GET', 'https://api.unleashlive.com/v1/analytics/version', headers={'x-api-key': ''})
r.data
{"message":"Forbidden"}
Standard error messages are returned upon an incomplete or invalid API request.