Real-time crowding in GTFS-RealTime and V3 API

67 views
Skip to first unread message

Developer at MBTA

unread,
Jun 22, 2020, 2:43:54 PM6/22/20
to MBTA Developers
Hello all,

As you may have heard, the MBTA recently started providing real-time crowding information for several of our local bus routes. We wanted to tell you that this data is also available in the GTFS-RealTime VehiclePositions feed and the V3 API!

The VehiclePositions feed and Vehicle API endpoint have an `occupancy_status` field, which can take one of three values corresponding to our crowding estimates:

  • MANY_SEATS_AVAILABLE: Not crowded
  • FEW_SEATS_AVAILABLE: Some crowding
  • FULL: Crowded

Information is now available for bus routes 1, 15, 16, 22, 23, 31, 32, 109, and 110. We are prioritizing busy routes with notably high ridership during the pandemic. For each route, our Customer Technology team verifies the accuracy of real-time crowding information through manual passenger counts. We are adding more routes throughout the summer. 

You can read more about the data in the V3 API Swagger documentation, or about MBTA's crowding data more generally.

Let us know if you have any questions or feedback!

Sincerely,
Developer@MBTA

Jeff Lopes

unread,
Jun 29, 2020, 2:47:47 PM6/29/20
to massdotd...@googlegroups.com
This is such a great addition to the API. Thank you! 

Is it possible to describe where you feel like the data currently stands? I'm seeing some vehicles with occupany_status null, but I haven't dug in enough to understand if that's expected based on certain conditions or if the data is only available for some vehicles while in testing. 

--
You received this message because you are subscribed to the Google Groups "MBTA Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to massdotdevelop...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/massdotdevelopers/7e8bb12b-60be-435c-ba5d-9328c0086fb6o%40googlegroups.com.

Jeff Lopes

unread,
Jun 29, 2020, 3:52:29 PM6/29/20
to massdotd...@googlegroups.com
Okay. I did dig in a little. It looks like at least some of the vehicles missing data are waiting to begin a trip. Here's one that's at Harvard waiting to start a trip to Nubian. Is it possible to default vehicles to MANY_SEATS_AVAILABLE before they've started a trip? 

    {
      "attributes": {
        "bearing": 315,
        "current_status": "IN_TRANSIT_TO",
        "current_stop_sequence": 1,
        "direction_id": 0,
        "label": "1857",
        "last_updated": "2020-06-29T15:47:18-04:00",
        "latitude": 42.37274,
        "longitude": -71.11651,
        "occupancy_status": null,
        "speed": null,
        "updated_at": "2020-06-29T15:47:18-04:00"
      },
      "id": "y1857",
      "links": {
        "self": "/vehicles/y1857"
      },
      "relationships": {
        "route": {
          "data": {
            "id": "1",
            "type": "route"
          }
        },
        "stop": {
          "data": {
            "id": "110",
            "type": "stop"
          }
        },
        "trip": {
          "data": {
            "id": "45030930",
            "type": "trip"
          }
        }
      },
      "type": "vehicle"
    },

Developer at MBTA

unread,
Jun 29, 2020, 4:03:06 PM6/29/20
to MBTA Developers
Hi Jeff,

We only include occupancy information when we're confident in the data. We're always working to increase the number of routes and locations where we provide crowding estimates, but in the meantime you may not always see information even on the listed routes.

Sincerely,
Developer@MBTA
To unsubscribe from this group and stop receiving emails from it, send an email to massdotdevelopers+unsubscribe@googlegroups.com.

Jeff Lopes

unread,
Jun 29, 2020, 4:09:44 PM6/29/20
to massdotd...@googlegroups.com
Makes sense. As a workaround, is there some other way to determine that these vehicles have not begun their trip? I noticed the current_status field, but it always seems to be set to IN_TRANSIT_TO. I was hoping it would have a WAITING status or something like that. 

To unsubscribe from this group and stop receiving emails from it, send an email to massdotdevelop...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "MBTA Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to massdotdevelop...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/massdotdevelopers/7051bae0-f919-453a-8cb2-3fe75f3fabc9o%40googlegroups.com.

Developer at MBTA

unread,
Jun 29, 2020, 4:40:53 PM6/29/20
to MBTA Developers
You can use the `current_stop_sequence`. Vehicles at the start of their trip will have a stop sequence value that's the same as the first stop on the trip. Generally the first stop sequence is 1, but it's not a guarantee.

Sincerely,
Developer@MBTA
To unsubscribe from this group and stop receiving emails from it, send an email to massdotdevelopers+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "MBTA Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to massdotdevelopers+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages