Count Vehicles at a Crossroads
Use this request to get the number of vehicles that passed a crossroads road object within a given time interval.
Send the request with the access token of a user who has the permission to view the road object.
Send the Request
| GET Request Sample | |
| /api/v1/road-object/{roadObjectId}/stats/count?since={since}&until={until} |
Where:
roadObjectId Required |
integer (path) | ID of the road object (crossroads) |
since Required |
long (query) | Start of the interval, Unix timestamp in milliseconds |
until Required |
long (query) | End of the interval, Unix timestamp in milliseconds. It must be greater than since. |
The interval cannot exceed 1 hour by default. The maximum is set in the server configuration.
For example, it might be ...
curl -X 'GET' \
'https://vg.irex.ai/api/v1/road-object/12/stats/count?since=1685979600000&until=1685983200000' \
-H 'accept: */*' \
-H 'Authorization: Bearer <access_token>'
Read the Response
The response is a JSON object with the vehicle count:
{
"count": 42
}
If no entry rules are set up for the road object, the count is 0.
Handle Errors
Bad Request |
The until value is not greater than since. |
Interval is too big |
The interval between since and until exceeds the maximum. |