Skip to main content

Demographic identifier API

Authentication

For detailed information on how to authenticate requests to this API, please refer to Authentication.

Common examples

Get live tracks

Request

curl --request GET \
--anyauth \
--user "<username>:<password>" \
"http://<servername>/local/demographics/.api?tracks-live.json"

Return (example) - No active track found

{
"live": {
"tracks": []
}
}

Return (example) - One active track found

{
"live": {
"tracks": [
{
"time_start": 1447749079.091622,
"time_end": 1447749081.011605,
"gender_average": 1,
"age_average": 20,
"boxsize_average": 177,
"gender_last": 1,
"age_last": 21,
"boxsize_last": 180
}
]
}
}

Return (example) - Two active tracks found

{
"live": {
"tracks": [
{
"time_start": 1447749104.451576,
"time_end": 1447749109.451567,
"gender_average": 1,
"age_average": 20,
"boxsize_average": 198,
"gender_last": 1,
"age_last": 18,
"boxsize_last": 195
},
{
"time_start": 1447749107.811568,
"time_end": 1447749109.451567,
"gender_average": -1,
"age_average": 21,
"boxsize_average": 160,
"gender_last": -1,
"age_last": 23,
"boxsize_last": 158
}
]
}
}

Get ended tracks

Request

curl --request GET \
--anyauth \
--user "<username>:<password>" \
"http://<servername>/local/demographics/.api?tracks-ended.json"

Return (example) - No active track found

{
"ended": {
"time_start": 1447748743.039911,
"time_end": 1447749643.039911,
"tracks": []
}
}

Return (example) - One ended track found

{
"ended": {
"time_start": 1447749887.539835,
"time_end": 1447749947.539835,
"tracks": [
{
"time_start": 1447749942.930319,
"time_end": 1447749946.210321,
"gender_average": 1,
"age_average": 21,
"boxsize_average": 219
}
]
}
}

Return (example) - Two ended tracks found

{
"ended": {
"time_start": 1447750011.470372,
"time_end": 1447750071.470372,
"tracks": [
{
"time_start": 1447750064.890142,
"time_end": 1447750067.690133,
"gender_average": 1,
"age_average": 22,
"boxsize_average": 217
},
{
"time_start": 1447750066.130135,
"time_end": 1447750067.690133,
"gender_average": -1,
"age_average": 18,
"boxsize_average": 192
}
]
}
}

Get live and ended tracks

Request

curl --request GET \
--anyauth \
--user "<username>:<password>" \
"http://<servername>/local/demographics/.api?tracks-live-and-ended.json&time=60"

Return (example) - Two Live and one Ended track

{
"live": {
"tracks": [
{
"time_start": 1447750516.809464,
"time_end": 1447750523.329454,
"gender_average": 1,
"age_average": 19,
"boxsize_average": 218,
"gender_last": 1,
"age_last": 19,
"boxsize_last": 218
},
{
"time_start": 1447750521.569459,
"time_end": 1447750523.329454,
"gender_average": -1,
"age_average": 17,
"boxsize_average": 222,
"gender_last": 260,
"age_last": 19,
"boxsize_last": 217
}
]
},
"ended": {
"time_start": 1447750463.936758,
"time_end": 1447750523.936758,
"tracks": [
{
"time_start": 1447750514.24947,
"time_end": 1447750515.329465,
"gender_average": 1,
"age_average": 20,
"boxsize_average": 239
}
]
}
}

API specification

Get live tracks

This API returns live face tracks (boxes), currently active in the video stream.

Request

curl --request GET \
--anyauth \
--user "<username>:<password>" \
"http://<servername>/local/demographics/.api?tracks-live.json"

Response

See Common examples for return examples.

Return value descriptions

ValueDescription
<time_start>Time of the first face observation in seconds in form of UTC (Coordinated Universal Time)
<time-end>Time of the last face observation in seconds.
<gender_average>-1 for female estimate and 1 for male estimate on average since <time_start>.
<age_average>Estimated age over the track since <time_start>.
<boxsize_average>Average box size over the track since <time_start>.
<gender_last>-1 for female guess and 1 for male guess on last observation.
<age_last>Estimated age on last observation.
<boxsize_last>Boxsize on last observation.

Get ended tracks

This API returns previously detected (ended) tracks.

Request

curl --request GET \
--anyauth \
--user "<username>:<password>" \
"http://<servername>/local/demographics/.api?tracks-ended.json&<time>"

Request parameter descriptions

ParameterDescription
<time>Use time to adjust the amount of time (in seconds) to include in the return. The default value is 15 minutes.

Response

See Common examples for return examples.

Return value descriptions

ValueDescription
<time_start>Time of the first face observation in seconds in form of UTC (Coordinated Universal Time)
<time-end>Time of the last face observation in seconds.
<gender_average>-1 for female estimate and 1 for male estimate on average since <time_start>.
<age_average>Estimated age over the track since <time_start>.
<boxsize_average>Average box size over the track since <time_start>.

Get live and ended tracks

This API combines the Live API described in Get live tracks, and the Ended API described in Get ended tracks. It returns both live information, as well as ended tracks.

Request

curl --request GET \
--anyauth \
--user "<username>:<password>" \
"http://<servername>/local/demographics/.api?tracks-live-and-ended.json"

Request parameter descriptions

ParameterDescription
<time>Use time to adjust the amount of time (in seconds) to include in the return. The default value is 15 minutes.

Response

See Common examples for return examples.

Return value descriptions

ValueDescription
<time_start>Time of the first face observation in seconds in form of UTC (Coordinated Universal Time)
<time_end>Time of the last face observation in seconds.
<gender_average>-1 for female estimate and 1 for male estimate on average since <time_start>.
<age_average>Estimated age over the track since <time_start>.
<boxsize_average>Average box size over the track since <time_start>.
<gender_last>-1 for female guess and 1 for male guess on last observation.
<age_last>Estimated age on last observation.
<boxsize_last>Boxsize on last observation.

Get FPS

This API checks the FPS used by the Demographics algorithm.

Request

curl --request GET \
--anyauth \
--user "<username>:<password>" \
"http://<servername>/demographics/.api?fps.json"

Response

200 OK
Content-Type: application/json

{
"fps": <fps>
}

Restart service

Restarts the Demographics service

Request

curl --request GET \
--anyauth \
--user "<username>:<password>" \
"http://<servername>/demographics/.apioperator?restart"

Reboot the camera

Reboots the camera

Request

curl --request GET \
--anyauth \
--user "<username>:<password>" \
"http://<servername>/demographics/.apioperator?reboot"

Get statistics

Returns historical data in JSON format

Request

curl --request GET \
--anyauth \
--user "<username>:<password>" \
"http://<servername>/local/demographics/.api?export-json[&date=<date>][&res=<res>]"

Request parameter descriptions

ParameterDescription
<date>a date of the form YYYYMMDD
a date interval of the form YYYYMMDD-YYYYMMDD
comma separated dates of the form YYYYMMDD,[..],YYYYMMDD
all (default) for all available data
<res>15m (default) for data in 15 minute bins
1h for data in 1 hour bins
24h for data in 1 day bins

Response

This script returns data in JSON format.