SunlightLegislator::legislatorInfo()

  • Description: Retrieves data regarding a specific legislator matching certain criteria. If there is more than one match, only the first result is returned.
  • Arguments: An array containing key/value pairs. Possible keys are: title, firstname, middlename, lastname, name_suffix, nickname, party, state, district, in_office, gender, phone, fax, website, webform, email, congress_office, bioguide_id, votesmart_id, fec_id, govtrack_id, crp_id, eventful_id, sunlight_old_id, congresspedia_id, twitter_id, youtube_url
  • Notes: To pass more than one value for a given key, pass an array. Example: array( ‘firstname’ => array(‘John’, ‘Hillary’) );
1
2
3
4
5
6
api_key = 'XXXXXXXXXXXX';

echo '<pre>';
print_r( $sf-&gt;legislatorInfo( array( 'party' =&gt; 'D', 'firstname' =&gt; 'Debbie' ) ) );
echo '</pre>';
?&gt;

Result:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
stdClass Object
(
    [legislator] =&gt; stdClass Object
        (
            [district] =&gt; Junior Seat
            [title] =&gt; Sen
            [eventful_id] =&gt; P0-001-000016119-7
            [in_office] =&gt; 1
            [state] =&gt; MI
            [crp_id] =&gt; N00004118
            [official_rss] =&gt; http://www.stabenow.senate.gov/index.xml
            [party] =&gt; D
            [email] =&gt;
            [votesmart_id] =&gt; 515
            [website] =&gt; http://stabenow.senate.gov/
            [fax] =&gt; 202-228-0325
            [govtrack_id] =&gt; 300093
            [firstname] =&gt; Debbie
            [middlename] =&gt; Ann
            [lastname] =&gt; Stabenow
            [congress_office] =&gt; 133 Hart Senate Office Building
            [phone] =&gt; 202-224-4822
            [webform] =&gt; http://stabenow.senate.gov/email.htm
            [youtube_url] =&gt; http://www.youtube.com/SenatorStabenow
            [nickname] =&gt;
            [bioguide_id] =&gt; S000770
            [fec_id] =&gt; S8MI00281
            [gender] =&gt; F
            [senate_class] =&gt; I
            [name_suffix] =&gt;
            [twitter_id] =&gt;
            [sunlight_old_id] =&gt; fakeopenID524
            [congresspedia_url] =&gt; http://www.opencongress.org/wiki/Debbie_Stabenow
        )

)