Open Virginia

Creating an API for the commonwealth.

Note: All APIs support a callback.

Court Decisions

Retrieve a list of rulings that affect a specific section of the code.

Example URI

http://api.openva.com/court/1.0/rulings/20-107.3.json

Instructions

Replace the section number with the section that you’re interested in. It will return a list of rulings (from May 2, 1995 foreward) that cite that section number in the text of the decision. This only includes Court of Appeals rulings, not Supreme Court rulings.

Returns

  • type (appeals/supreme)
  • name
  • date
  • abstract
  • record number

On error, it will return an object by the name of “error,” containing an element called “message” and an element called “details.” If the error is a result of there being no court rulings that affect the requested section, a 404 header will be returned, in addition to the “error” object.

Legislation

Retrieve a given bill.

Example URI

http://api.richmondsunlight.com/1.0/bill/2010/hb1.json

Instructions

Replace the year (“2010”) and bill number (“hb1”) with the bill number and year in which it was introduced that you want.

Returns

  • bill number
  • catch line
  • summary
  • full text
  • sponsor
  • outcome (passed/failed)
  • tags (if any)

If no bill is found, this method will return a 404.

Retrieve a given legislator.

Example URI

http://api.richmondsunlight.com/1.0/legislator/rbbell.json

Instructions

Replace the legislator (“rbbell”) with the Richmond Sunlight ID for that legislator. (See the prior method to learn how to do that.)

Returns

  • name
  • party
  • district number
  • district description
  • date took office
  • partisanship (0-100 scale)
  • all bills (since 2006)
    • number
    • year
    • title
    • date introduced
    • outcome
    • Richmond Sunlight URL
  • district office address
  • capitol office address
  • district office phone number
  • capitol office phone number
  • website URI (if any)
  • e-mail address
  • Virginia Public Access Project ID

If no legislator is found, this method will return a 404.

Retrieve a list of bills that affect a specific section of the code.

Example URI

http://api.richmondsunlight.com/1.0/bysection/20-107.3.json

Instructions

Replace the section number with the section that you’re interested in. It will return a list of bills (from 2006 foreward) that cite that section number in the text of the bill.

Returns

  • bill number
  • year
  • catch line
  • summary
  • sponsor
  • outcome (passed/failed)

If no bills are found, this method will return a 404.

Retrieve a list of bills and commentary on those bills for a given Photosynthesis portfolio.

Example URI

http://api.richmondsunlight.com/1.0/photosynthesis/98yxv.json

Instructions

Replace the portfolio number (“98yxv”) with the number of the portfolio that you’re interested in. (You can find this in the portfolio’s public URL on Richmond Sunlight.) It will return a list of the bills in that portfolio, along with any commentary that has been provided on each of those bills.

Returns

  • bill number
  • year
  • URL
  • notes

If no bills is found for that portfolio, or if the portfolio doesn’t exist, this method will return a 404.