Creating an API for the commonwealth.
Note: All APIs support a callback.
http://api.openva.com/court/1.0/rulings/20-107.3.json
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.
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.
http://api.richmondsunlight.com/1.0/bill/2010/hb1.json
Replace the year (“2010”) and bill number (“hb1”) with the bill number and year in which it was introduced that you want.
If no bill is found, this method will return a 404.
http://api.richmondsunlight.com/1.0/legislator/rbbell.json
Replace the legislator (“rbbell”) with the Richmond Sunlight ID for that legislator. (See the prior method to learn how to do that.)
If no legislator is found, this method will return a 404.
http://api.richmondsunlight.com/1.0/bysection/20-107.3.json
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.
If no bills are found, this method will return a 404.
http://api.richmondsunlight.com/1.0/photosynthesis/98yxv.json
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.
If no bills is found for that portfolio, or if the portfolio doesn’t exist, this method will return a 404.