# TransitOracle

> Live arrival predictions for Boston's MBTA buses, subway (Red, Orange, Blue and Green Lines, Mattapan), commuter rail and ferries. TransitOracle shows MBTA's own prediction and, where its model has beaten MBTA's on predictions it never saw, its own more accurate estimate with an 80% range, always labelled with whose it is. Free; no accounts. Run by BFT LLC; not affiliated with the MBTA or MassDOT.

To answer "when's the next train/bus at <stop>?": find the stop's id with `GET https://transitoracle.com/api/v1/stops?q=<name>` (a station's id looks like `place-pktrm`), then `GET https://transitoracle.com/api/v1/stops/<id>/arrivals?limit=10`. Each arrival's `best.at` is the time to give (UTC; convert to Boston time) and `best.source` says whether it is TransitOracle's estimate or MBTA's prediction: say which. `transitoracle.low`/`high` is the likely range; `mbta.arrival_at` is MBTA's own. Alerts for the stop come with it. A stop's page (`https://transitoracle.com/stop/<id>`) shows the same, and any page is Markdown if you ask with `Accept: text/markdown`.

Please keep to a request every few seconds, credit "Transit data provided by MassDOT" and TransitOracle, and don't present our estimates as MBTA's or MBTA's as ours.

## Pages

- [Find a stop](https://transitoracle.com/): every station by line, search by name or near you
- [A stop's next arrivals](https://transitoracle.com/stop/place-pktrm): e.g. Park Street; any stop at /stop/<id>
- [Plan a trip](https://transitoracle.com/plan): /plan?from=<id>&to=<id>
- [Live map](https://transitoracle.com/map): every vehicle
- [Track record](https://transitoracle.com/track-record): how accurate our predictions and MBTA's have been, by mode
- [About](https://transitoracle.com/about): how it works and where the data comes from

## API

- [OpenAPI description](https://transitoracle.com/openapi.json): every endpoint and field
- [Find stops](https://transitoracle.com/api/v1/stops?q=park): by name (`q`) or nearest a point (`lat`, `lon`)
- [Next arrivals at a stop](https://transitoracle.com/api/v1/stops/place-pktrm/arrivals?limit=10): live, with alerts
- [Plan a trip](https://transitoracle.com/api/v1/plan?from=place-pktrm&to=place-harsq): ways there leaving now, each with when it arrives 9 times in 10
- [Vehicles](https://transitoracle.com/api/v1/vehicles): every vehicle's latest position
- [Routes](https://transitoracle.com/api/v1/routes): ids, names and modes
- [Track record](https://transitoracle.com/api/v1/model): the serving model's test against MBTA

## Optional

- [Terms of use](https://transitoracle.com/terms)
- [Privacy policy](https://transitoracle.com/privacy)
- [Sitemap](https://transitoracle.com/sitemap.xml): every stop's page
