Read the labs blog
SunlightLabs API
people.getPersonInfo
Get all info (name, phone, URL, photo etc.) we have about a person
These are the different types of things that we may have data about:
| Name | Description |
|---|---|
| CRPcandID | The candidate ID used by the Center For Responsive politics. |
| URL | The person's or entity's website |
| state_full_name | The full name of a state, e.g. "North Dakota" |
| state_abbreviation | The abbreviation of a state's name, e.g. "CA" |
| district | The integer value of a representative's district, e.g., "6" |
| WashPost_ID | Washington Post's ID for this person |
| party | The person's party, i.e. "D", "R" or "I' |
| VoteSmart_ID | The ID used by Project Vote Smart (http://votesmart.org/index.htm) |
| title | A person's title, e.g. "Representative" or "Senator" |
| member110congress | Is/Was the person a member of the 110th Congress?, i.e., "yes" or "no" |
| FEC_ID | FEC's ID for this person |
| webform | A contact webform for this person |
| Email for this person | |
| senator_class | Class for this person (Senator): I, II, or III |
| phone | Phone number |
| name_suffix | Name Suffix, e.g. "Jr." or "II" |
| congress_office | Address of their Congressional Office, e.g. "1502 Longworth HOB, Washington, DC 20515-1101" |
| gender | Gender: "M" or "F" |
| photo | The filename for their photo at http://sunlightlabs.com/widgets/popuppoliticians/resources/images/ |
| congresspedia | The URL for their Congresspedia page |
| BioGuide_ID | ID for their BioGuide entry at http://bioguide.congress.gov/biosearch/biosearch.asp |
| Eventful_ID | The performer ID for an Eventful politician |
| lastname | Last Name(s) |
| firstname | First Name(s) |
| middlename | Middle Names(s) |
| nickname | Nickname |
| GovTrack_ID | The ID used by Govtrack.us |
| entity_id | The common id being promoted by the labs |
Arguments
These are all $_GET parameters.
id (required)
The person's entity_id
apikey (required)
your individual API key
metadata (optional)
&metadata=true provides detail about source, last update of the information etc. Click here for details
output (optional)
&output=json is set by default. You can also use &output=xml
Example Call
http://api.sunlightlabs.com/people.getPersonInfo.php?id=fakeopenID1 &apikey=23kj234kjb3kjbcl87ds
says give me all of the information about person with entity_id "fakeopenID1".
Example Response
For the default JSON:
{"entity_id": "fakeopenID1", "CRPcandID":"N00007665", "URL":"http://www.house.gov/abercrombie", "lastname":"Abercrombie",
"firstname":"Neil", "state_full_name":"HAWAII", "state_abbreviation":"HI", "district":"1", "party":"D",
"title":"Representative", "member110congress":"yes", "GovTrack_ID":"400001", "VoteSmart_ID":"H0971103",
"WashPost_ID":"a000014", "FEC_ID":"H6HI01121", "phone":"(202) 225-2726",
"congress_office":"1502 Longworth HOB, Washington, DC 20515-1101", "gender":"M",
"email":"neil.abercrombie@mail.house.gov",
"congresspedia":"http://www.sourcewatch.org/index.php?title=Neil_Abercrombie",
"photo":"Neilabercrombie.jpg", "BioGuide_ID":"A000014", "Eventful_ID":"P0-001-000016130-0"}
For XML:
<results> <entity_id>fakeopenID1</entity_id> <CRPcandID>N00007665</CRPcandID> <URL>http://www.house.gov/abercrombie<URL> <lastname>Abercrombie</lastname> <firstname>Neil</firstname> <state_full_name>HAWAII</state_full_name> <state_abbreviation>HI</state_abbreviation> <district>1</district> <party>D</party> <title>Representative</title> <member110congress>yes</member110congress> <GovTrack_ID>400001</GovTrack_ID> <VoteSmart_ID>H0971103</VoteSmart_ID> <WashPost_ID>a000014</WashPost_ID> <FEC_ID>H6HI01121</FEC_ID> <phone>(202) 225-2726</phone> <congress_office>1502 Longworth HOB, Washington, DC 20515-1101</congress_office> <gender>M</gender> <email>neil.abercrombie@mail.house.gov</email> <congresspedia>http://www.sourcewatch.org/index.php?title=Neil_Abercrombie</congresspedia> <photo>Neilabercrombie.jpg</photo> <BioGuide_ID>A000014</BioGuide_ID> <Eventful_ID>P0-001-000016130-0</Eventful_ID> </results>
Error Codes
If there is an error: a plain text string will be returned:
1: entity not found
The entity_id was not recognized
100: invalid API key
The API key was invalid
101: API key not valid for this method
Not permitted to call this particular method with this particular API key

