The Sunlight Foundation, based in Washington, D.C. is an organization all about creating openness and transparency in government. They utilize the internet to make the information about Congress and the federal government more accessible to citizens.
As part of the Sunlight Foundation, Sunlight Labs provides API for accessing a number of data points. In my conversation with them, they want to continue to make more data available as they can get it.
The Sunlight Labs developer community is rich and robust with Python and Ruby developers and have easy to use development classes built around the Sunlight API. Unfortunately, the more commonly used language, PHP, does not have the same love. Until now.
I’m releasing this set of PHP classes as an anchor point for the PHP community wanting to utilize the data that Sunlight provides, or wanting to explore what data points exist.
The library is made up of a base class, SunlightData, and seven child classes – four related to the Sunlight Labs API, and three related to the OpenSecrets API. To use the library, you will actually instantiate one of the child classes.
Documentation
This library is PHP 5.2+ ONLY. The JSON support is built into versions of PHP including and after this version. In addition, you must have cURL compiled into PHP. Most versions of PHP these days will meet these guidelines, but check with your host if you are not sure.
- SunlightLegislator class
- SunlightDistrict class
- SunlightCommittee class
- SunlightLobbyist class
- OpenSecretsMember Class
- OpenSecretsCandidate Class
- OpenSecretsCommittee Class
To Download:
- SVN: svn co http://sunlight-api.googlecode.com/svn/trunk/ sunlight-api
- Download Sunlight-PHP v1.0 (Stable)
Warning
This software is offered on an as-is basis. No support is guaranteed or implied. However, I welcome any contribution by filing an issue at the project page. Help make the project better and help citizens get exposure and transparency into their duly elected government.



