bartjs
Version:
A client for interacting with the Bay Area Rapid Transit (BART) API
26 lines (15 loc) • 1.2 kB
Markdown
# bartjs
```
npm install bartjs
```
A client for interacting with the [Bay Area Rapid Transit (BART) API](http://api.bart.gov/docs/overview/index.aspx "BART API Documentation").
The API exposed is a thin wrapper over the [Request module](https://api.bart.gov/docs/overview/index.aspx "Request") that transforms the BART API's XML responses to JSON together with spatial convenience methods.
[](https://travis-ci.org/affinespaces/bartjs)
# Set-up
First, obtain a API validation key [here](http://api.bart.gov/api/register.aspx). If you don't prefer to obtain your own key, no worries -- BART provides a "no strings attached key" -- `MW9S-E7SL-26DU-VV8V` -- which you may use until it is relentlessly abused and overused and BART decides to revoke it. For this reason BART suggests registering for your own key.
Regarding rate limits, BART is sketchy on the details other than to say they are extremely generous.
Initialize your Bart object:
```javascript
const bart = require('bart')({ 'apiKey': 'ABCD-1234-5678-9101' });
```
Note that if you do not pass a key, bartjs defaults to the no strings attached key.