Sunlight APIs

Component ID

2140911

Component name

Sunlight APIs

Component type

module

Maintenance status

Development status

Component security advisory coverage

covered

Downloads

849

Component created

Component changed

Component body

Sunlight APIs is a helper module which provides access to Sunlight data services.

Please note, this module doesn't do much aside from allow you to configure your Sunlight API key. You will need to develop your own module which uses the API :)

Sample code for a custom module depending on this module:

$tweet = 'Hey Congress...';
$legislators = sunlight('Congress', 'legislators_locate')->getByZip('94109');
foreach ($legislators->results as $legislator) {
  if ($legislator->chamber == 'house' && $legislator->twitter_id) {
    $tweet .= " @{$legislator->twitter_id}";
  }
}

Note: This module is not affiliated with Sunlight Foundation; it has been developed independently.