Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A small little gem to access the WMATA transparent data API.
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
test Initial commit of code
.document Initial commit of code
.gitignore Initial commit of code
LICENSE Initial commit of code
Rakefile Initial commit of code
VERSION Version bump to 0.2.1



Jeremy McAnally - Intridea

A nice little gem for accessing the WMATA data API (

Installing / Getting Started

First, install the gem…

gem install wmata

…or use your Git clone. It's up to you. :)

Next, mosey on over to and get yourself a developer account. Create an application (it can just be named “test” or whatever for now) and get your API key. You'll need to provide your API key for any API work you'll be doing.

To get started using the gem, require it (of course), and then set your API key:

WMATA.api_key = "ab7bce7ba8e08ccca9ce80ab890eb8a9dd"

Now you're ready to rock and roll!


The gem's functionality is primarily oriented around the WMATA module. For example, to get all the rail lines available, you'd do this:


This will give you an array of Line objects to manipulate. So, you could do something like this:


This code would give you an array of Incident objects that you can manipulate. Essentially, its usage boils down to a simple maxim: most of the fetching logic should be accessed through the WMATA module or the domain objects returned from methods called on methods called on WMATA. You can call the fetching logic directly (e.g., Line.get_all), but it's smarter to use the public API.

For detailed information about what methods are available, see the documentation for WMATA and each individual resource class.

Note on Patches/Pull Requests

  • Fork the project.

  • Make your feature addition or bug fix.

  • Add tests for it. This is important so I don't break it in a future version unintentionally.

  • Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)

  • Send me a pull request. Bonus points for topic branches.


Copyright © 2010 Jeremy McAnally. See LICENSE for details.

Something went wrong with that request. Please try again.