Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


clippercard is an unofficial python client for, written in Python.


Not only is the clippercard web site a inaccessible by API, its behind-the-scene's HTML structure and HTTP protocol is not semantically structured. This library aims to provide an unofficial but sensible interface to the official web service.

Project Goal

I enjoy the actual user experience of ClipperCard on buses and trains. My complaints about the service are purely isolated to its web interface. I saw a problem, and I solved it for myself, that's all.

As an advocate for data accessibility, I believe our dollars, our votes, our voices and our actions can nudge institutions in the direction we'd like them to go. At Bay Area's Metropolitan Transportation Commission, I am sure there are a lot of great people doing good work to the best of their ability, and within the context of prioritization, organizational structure and resources available to them.

I encourage the staff of MTA reading this project to see this effort as a nudge for a public and official API. The moment they put up an API that obsoletes this project, I will happily direct followers to the official solution. If you'd like them to increase attention to data accessibility, you can send them an email at and tell them I sent you.


  • Profile Data
  • Multiple cards' data
  • For each card, multiple products and balances

I don't have access to all products loadable on the ClipperCard, so transit product variant support is limited to what I personally use for now. If you'd like me to add support for your product, send me the page source from your account home page:

Security and Privacy

It's important to point out that:

  • This project does not collect your personal information or login credentials.
  • This project is not a hosted service, your data is not stored or sent to any 3rd party service.

For now, this project is targeted at other software developers, who are capable of assessing my source code for security implications.


To install clippercard, simply:

$ pip install clippercard


import clippercard
session = clippercard.Session('username', 'password')
for c in

You also get a super convenient command line binary clippercard::

$ clippercard -h # see usage information
$ clippercard summary
|            name | Golden Gate Hacker                             |
|           email |                      |
| mailing_address | 1 Main St, San Francisco, CA 94105             |
|           phone | 415-555-5555                                   |
|       alt_phone | 650-555-5555                                   |
| primary_payment | Mastercard ending in 1234                      |
|  backup_payment | Amex ending in 9876                            |
| # | Name                      | Serial     | Type  | Status | Products                |
| 1 | Primary, card #2021234134 | 2021234134 | ADULT | Active | Cash Value: $195.00     |
|   |                           |            |       |        | Current Passes: None    |
|   |                           |            |       |        | Pending Passes: None    |
|   |                           |            |       |        | Reload: $255 - Autoload |
| 2 | Backup, card #2021234156  | 2021234156 | ADULT | Active | Cash Value: $200.00     |
|   |                           |            |       |        | Current Passes: None    |
|   |                           |            |       |        | Pending Passes: None    |
|   |                           |            |       |        | Reload: $200 - Autoload |

If you wish to use clippercard without specifying username/password on the CLI, create a file ~/.clippercardrc with this format::

username =
password = superseekrit

You may toggle accounts via the --account flag on the command line to access one of several configs in the file::

username = <replace_with_your_email>
password = <replace_with_your_password>

username = <replace_with_login_email>
password = <replace_with_login_password>

The other credentials can then be accessed via::

$ clippercard summary --account=other

More examples

If you have a transit pass that isn't recognized by this tool, you can privately share a copy of your account page view-source: with the maintainer.


  1. fork the repo to your personal GitHub account
  2. make your changes in your repo
  3. for Python source, follow local style consistency and PEP8
  4. run pylint on your diffs
  5. add unit tests, make sure they pass (just run pytest 😎)
  6. remember to bump the version number wherever applies
  7. add a new line for your revision to CHANGES.txt describing your change
  8. send a pull request to w/problem or goal statement and implementation details
  9. respond to all pull request code review requests in your branch and submit the requested changes in new commits
  10. communicate with the maintainers to merge the finalized pull request and publish your changes


Unofficial ClipperCard Python API







No releases published


No packages published