Get Traffic Flow API

This API returns details on how traffic is flowing, by lane, on monitored roadways.

METHOD GET
URI <production url>/v1/assets/{id}/events?event-types=TFEVT(start-ts,end-ts,size,page)
Sample Request URI <production url>/v1/assets/1000000018/events?event-types=TFEVT&start-ts=1453766605577&end-ts=1453772603879&size=10&page=1

Query Parameters

Parameter Description Required? Filter Values
id GE identifier for the device. Yes For example, 1000000018.
event-type Type of event. Yes If you filter by TFEVT, you receive a list of vehicles in traffic lanes.
start-ts Start time (timestamp) recorded in EPOCH format. Yes Numerical value, such as 1453766605577.
Note: If you use the same timestamp for start-ts and end-ts, a single result will be returned.
end-ts End time (timestamp) recorded in EPOCH format. Yes Numerical value, such as 1453772603879.
lane Identifies the traffic lane on which to filter. Lane 1 is closest to the monitoring device. No Lane 1, Lane 2, and so forth.
size Maximum number of records to return per page. If no size is specified, the default limit applies. No Numerical value.
page Indicates the page number. Default is 1. Yes Numerical value.

Response Parameters

Parameter Data Type Required? Description Description
events Array   Traffic flow direction  
properties String Yes Traffic speed Vehicle properties being tracked by the device.
speed
Roadway speed limit.
direction
By degree.
event-uid
A unique identifier established by a customer or external resource for the traffic event. For example, a specific vehicle traversing a specific road segment.
location-uid
Traffic lane location; Lane 1, Lane 2, and so forth. Lane 1 is closest to the monitoring device.
vehicle-type
Type of vehicle:
  • MOTORCYCLE
  • CAR
  • TRUCK
  • BICYCLE
measures String Yes Vehicle count (monotonically increasing) Vehicle properties being tracked by the device.
Tag = direction
value = from 0 to 360
Tag = speed
value = 55, unit = mph
Tag = vehicleCount
value = count, unit = number
event-uid String Yes   A unique identifier established by a customer or external resource for the traffic event.
timestamp Number Yes   Timestamp recorded in EPOCH format.
event-type String Yes   Identifies the TFEVT event type.
device-uid String Yes   A unique identifier established by a customer or external resource for the device recording the traffic flow.
location-uid String Yes   A unique identifier established by a customer or external resource to identify the lane number.
_links Array Yes   A collection of hyperlinks to navigate the result set via paging .

Sample Response

{
  "_embedded": {
    "events": [
      {
        "properties": {
          "direction": "DEGREE",
          "event-uid": "cccc55be-481c-4b6b-9a39-e1eb07b55fee",
          "location-uid": "Lane1",
          "speed": "MPH",
          "vehicle-type": "car"
        },
        "measures": [
          {
            "tag": "direction",
            "value": 194,
            "unit": "DEGREE"
          },
          {
            "tag": "speed",
            "value": 39,
            "unit": "MPH"
          },
          {
            "tag": "vehicleCount",
            "value": 13,
            "unit": null
          }
        ],
        "event-uid": "cccc55be-481c-4b6b-9a39-e1eb07b55fee",
        "timestamp": 1456822800000,
        "event-type": "TFEVT",
        "device-uid": "HYP1040-75",
        "location-uid": "Lane1"
      },
      {
 
        "properties": {
          "direction": "DEGREE",
          "event-uid": "d10108f1-8c38-43fc-a4dd-5c7fcb8004dc",
          "location-uid": "Lane2",
          "speed": "MPH",
          "vehicle-type": "motorcycle"
        },
        "measures": [
          {
            "tag": "direction",
            "value": 3,
            "unit": "DEGREE"
          },
          {
            "tag": "speed",
            "value": 40,
            "unit": "MPH"
          },
          {
            "tag": "vehicleCount",
            "value": 0,
            "unit": null
          }
        ],
        "event-uid": "d10108f1-8c38-43fc-a4dd-5c7fcb8004dc",
        "timestamp": 1456822845000,
        "event-type": "TFEVT",
        "device-uid": "HYP1040-75",
        "location-uid": "Lane2"
      },
      {
        "properties": {
          "direction": "DEGREE",
          "event-uid": "edec88fe-f769-4dca-b538-4cab387580b2",
          "location-uid": "Lane1",
          "speed": "MPH",
          "vehicle-type": "car"
        },
        "measures": [
          {
            "tag": "direction",
            "value": 328,
            "unit": "DEGREE"
          },
          {
            "tag": "speed",
            "value": 18,
            "unit": "MPH"
          },
          {
            "tag": "vehicleCount",
            "value": 0,
            "unit": null
          }
        ],
        "event-uid": "edec88fe-f769-4dca-b538-4cab387580b2",
        "timestamp": 1456822890000,
        "event-type": "TFEVT",
        "device-uid": "HYP1040-75",
        "location-uid": "Lane1"
      }
    ]
  },
  "_links": {
    "self": {
      "href": "http://<production url>/v1/assets/1000000018/events?event-types=TFEVT&start-ts=0&end-ts=1758118140000&size=3"
    },
    "next-page": {
      "href": "http://<production url>/v1/assets/1000000018/events?event-types=TFEVT&start-ts=1456822890000&end-ts=1758118140000&size=3"
    }
  },
  "page": {
    "size": 3,
    "totalElements": 55696,
    "totalPages": 18566,
    "number": 0
  }
}