Passenger flow

This API is used to retrieve data on passenger flow in vehicles equipped with the Autoconductor system.
With it, you can:
— see how many passengers boarded and exited at each stop
— get stop coordinates, event timestamps, and a video identifier (if video recording is supported by the system)

How to get data

Method

GET

Request address

To get the data, use the address:  https://<server_address>/api/api.php?

Request parameters

  • cmd=pass_counter — command to call the API
  • ts — start time of the selection period (Unix timestamp)
  • te — end time of the selection period (Unix timestamp)
  • node — node number where the command is executed
  • imei (optional) — IMEI of the vehicle equipped with Autoconductor. If not specified, the selection will include all vehicles with the system
 

Example request

https://<server_address>/api/api.php?cmd=pass_counter&ts=1554670800&te=1554757200&imei=963852741159753&node=1
Response
{
  "code": 0,
  "data": {
    "36571": {
      "agent_id": 36571,
      "stops": [
        {
          "busline_id": 1371,
          "door_id": 0,
          "lat": "54.9346",
          "lon": "51.8981",
          "p_in": 1,
          "p_out": 0,
          "ts": 1554696995,
          "video_id": 13
        },
        {
          "busline_id": 1371,
          "door_id": 0,
          "lat": "54.9238",
          "lon": "51.9098",
          "p_in": 4,
          "p_out": 0,
          "ts": 1554697232,
          "video_id": 14
        }
      ],
      "vehiclenumber": "autoconductor"
    }
  },
  "msg": "OK"
}
In response to the API request, the following is returned:
  • code — execution code (0 = success)
  • msg — status message (e.g., OK)
  • data — main object containing passenger flow data
  • agent_id — vehicle ID in the system
  • vehiclenumber — internal vehicle number or equipment name (e.g., autoconductor)
  • stops — array of stops with passenger flow data:
  • busline_id — route ID
  • door_id — door number where passenger movement was recorded
  • lat — stop latitude
  • lon — stop longitude
  • p_in — number of passengers boarded
  • p_out — number of passengers exited
  • ts — event time (Unix timestamp)
  • video_id — video recording ID linked to the event (if available)