Tracks all MBTA buses and subway trains
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Public instance running at

Set up the environment

We use Conda to manage our Python libraries. Install conda

Note that if you choose to install Anaconda (the full version), you probably only need to install GTSF Realtime. But if you choose to install Miniconda, which is way smaller, you'll need to install dependencies later one by one.


GTFS Realtime

install GTFS

pip install protobuf
pip install --upgrade gtfs-realtime-bindings

If it's throwing errors about setuptools, do this:

conda install -c setuptools

If it's still not working, try install GTFS using

easy_install --upgrade gtfs-realtime-bindings



Using the pyScss and Flask Assets to compile the SCSS files.

pip install flask-assets
pip install pyScss


conda install lxml

Get an API key

Sign up for an account on the MBTA realtime Developer Portal and create a new application. It may take a day or two to get approval. Once you get it, create a file called ignore/mbta_api_key.txt and paste your API key there.

Run the App

$ git clone ""
$ cd your-path-to/mbta-bustracker
$ python

Open the app at localhost:5000/

API References

MBTA Realtime and GTFS Documentation

NextBus Documentation