The OneBusAway RESTful API

OneBusAway provides a RESTful (REpresentational State Transfer) API that allows you access to the same information that powers the OneBusAway website and mobile tools. You can use the api to write cool new apps of your own.

Release Notes

Check out the Release Notes for details about whats changed with the API

API Keys

The following parameter must be included in all API requests:

  • key - your assigned application key



The assigned application key is used to track usage statistics across applications. API keys can be managed in a number of ways.

Output Format

Supported output formats include JSON and XML. The output format is determined by the request extension. For example:


will return XML results, while


will return JSON. The JSON method all supports a callback parameter, which is useful for cross-site scripting access:


will return:


Response Element

All responses are wrapped in a response element.


The response element carries the following fields:

  • version - response version information
  • code - a machine-readable response code with the following semantics:
    • 200 - Success
    • 400 - The request could not be understood due to an invalid request parameter or some other error
    • 401 - The application key is either missing or invalid
    • 404 - The specified resource was not found
    • 500 - A service exception or error occurred while processing the request
  • text - a human-readable version of the response code
  • currentTime - current system time on the api server as milliseconds since the unix epoch
  • data - the response payload
    • references see the discussion of references below


The <references/> element contains a dictionary of objects referenced by the main result payload. For elements that are often repeated in the result payload, the elements are instead included in the <references/> section and the payload will refer to elements by and object id that can be used to lookup the object in the <references/> dictionary.

Right now, only a few types of objects will ever appear in the references section: agencies, routes, stops, trips, and situations.


They will always appear in that order, since stops and trips reference routes and routes reference agencies. If you are processing the result stream in order, you should always be able to assume that an referenced entity would already have been included in the references section.


The current list of supported API methods. Methods that are subject to changed are marked BETA.

Common Elements

See more discussion of [OneBusAwayRestApi_Version2 Version 2] of the api and how element references have changed: