Counting API

Health

get
https://counting.traces.cloud/
api/v1/health
health

Example

1
curl -X GET "http://faf.traces.cloud.api/v1/health" -H "accept: */*"
2
Copied!

Operations

For a successful usage of Traces Counting API, it is required to do the following step:
    Register a camera by providing coordinates of counting triangles. It should be done only once for every unique camera. Read more about counting triangles here.
If the placement of a camera or areas of interest has changed, just update the coordinates of counting triangles by sending a new POST request with the same 'camera id'.
post
https://counting.traces.cloud/
api/v1/object-counting-settings
object-counting-settings
data.json
1
{
2
"camera_id": "b5271b30-aecd-4897-bc95-ff25c8466b9e",
3
"counting_triangles": [
4
{
5
"passway_name": "2nd-floor-escalator-up",
6
"coordinates": {
7
"x1": 0,
8
"y1": 0,
9
"x2": 100,
10
"y2": 100,
11
"x3": 50,
12
"y3": 50
13
}
14
},
15
{
16
"passway_name": "2nd-floor-escalator-down",
17
"coordinates": {
18
"x1": 200,
19
"y1": 200,
20
"x2": 400,
21
"y2": 400,
22
"x3": 350,
23
"y3": 350
24
}
25
}
26
]
27
}
Copied!

Example

cURL
cURL
1
curl -X POST -H "Content-Type: application/json" -H "X-Traces-API-Key: YOUR_API_KEY" -d @data.json https://counting.traces.cloud/api/v1/object-counting-settings
Copied!
1
curl -X POST "https://counting.traces.cloud/api/v1/object-counting-settings" -H "accept: /" -H "X-Traces-API-Key: YOUR_API_KEY" -H "Content-Type: application/json" -d "{\"camera_id\":\"b5271b30-aecd-4897-bc95-ff25c8466b9e\",\"passways\":[{\"passway_name\":\"2nd-floor-escalator-up\",\"coordinates\":{\"x1\":0,\"y1\":0,\"x2\":100,\"y2\":100,\"x3\":50,\"y3\":50}},{\"passway_name\":\"2nd-floor-escalator-down\",\"coordinates\":{\"x1\":200,\"y1\":200,\"x2\":400,\"y2\":400,\"x3\":300,\"y3\":300}}]}"where 'data.json' looks like
Copied!
post
https://counting.traces.cloud/
api/v1/object-counting
object-counting

Example

1
curl -X POST "https://counting.traces.cloud/api/v1/object-counting/" -H "accept: /" -H "X-Traces-API-Key: YOUR_API_KEY" -H "Content-Type: multipart/form-data" -F "metadata={ "camera_id": "b5271b30-aecd-4897-bc95-ff25c8466b9e" }" -F "counting_options={ "classes": [ "people", "vehicle" ], "count_by_frames": false }" -F "[email protected]_video.mp4;type=video/mp4"
Copied!
post
https://counting.traces.cloud/
api/v1/dwell-time-settings
dwell-time-settings
data.json
1
{
2
"camera_id": "b5271b30-aecd-4897-bc95-ff25c8466b9e",
3
"spaces": [
4
{
5
"space_name": "main_entrance",
6
"coordinates": {
7
"x1": 0,
8
"y1": 0,
9
"x2": 100,
10
"y2": 100
11
}
12
}]
13
}
Copied!

Example

1
curl -X POST -H "Content-Type: application/json" -H "X-Traces-API-Key: YOUR_API_KEY" -d @data.json https://counting.traces.cloud/api/v1/dwell-time-settings
Copied!
post
https://counting.traces.cloud/
api/v1/dwell-time-summary
dwell-time-summary

Example

1
curl -X POST "https://counting.traces.cloud/api/v1/dwell-time-summary/" -H "accept: /" -H "X-Traces-API-Key: YOUR_API_KEY" -H "Content-Type: multipart/form-data" -F "metadata={ "camera_id": "b5271b30-aecd-4897-bc95-ff25c8466b9e" }" -F "[email protected]_video.mp4;type=video/mp4"
Copied!
post
https://counting.traces.cloud/
api/v1/dwell-time-detailed
dwell-time-detailed

Example

1
curl -X POST "https://counting.traces.cloud/api/v1/dwell-time-detailed/" -H "accept: /" -H "X-Traces-API-Key: YOUR_API_KEY" -H "Content-Type: multipart/form-data" -F "metadata={ "camera_id": "b5271b30-aecd-4897-bc95-ff25c8466b9e" }" -F "[email protected]_video.mp4;type=video/mp4"
Copied!
Last modified 3mo ago