API v1.0

The v1.0 release of Richmond Sunlight’s API provides a series of JSON-based web services. (It also supports JSONP and its associated callback function.) The following methods are available:

Retrieve a list of bills.

Example URI

http://api.richmondsunlight.com/1.0/bills/2011.json

Instructions

Replace the year (“2011”) with the year for which you want a listing of all bills.

Returns

  • number
  • chamber
  • date introduced
  • status
  • outcome
  • title

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. (You can find each legislator’s ID in the URL for their page on the site.)

Returns

  • name
  • party
  • district number
  • district description
  • date took office
  • partisanship (0-100 scale; 0 == Democratic, 100 == Republican)
  • 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
  • Legislative Information System 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/7l0x3.json

Instructions

Replace the portfolio number (“7l0x3”) with the number of the portfolio that you’re interested in. (You can find this in the URL.) 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.