Usage
cg_legislators(title = NULL, first_name = NULL, middle_name = NULL,
last_name = NULL, name_suffix = NULL, nickname = NULL, party = NULL,
state = NULL, state_name = NULL, state_rank = NULL, district = NULL,
in_office = NULL, chamber = NULL, gender = NULL, phone = NULL,
fax = NULL, office = NULL, website = NULL, contact_form = NULL,
email = NULL, congress_office = NULL, bioguide_id = NULL,
ocd_id = NULL, thomas_id = NULL, lis_id = NULL, crp_id = NULL,
icpsr_id = NULL, votesmart_id = NULL, fec_ids = NULL,
govtrack_id = NULL, congresspedia_url = NULL, twitter_id = NULL,
youtube_id = NULL, facebook_id = NULL, senate_class = NULL,
term_start = NULL, term_end = NULL, birthday = NULL, latitude = NULL,
longitude = NULL, zip = NULL, query = NULL, fields = NULL, page = 1,
per_page = 20, order = NULL, key = NULL, as = "table", ...)
Arguments
title
Title held by this legislator, either Sen or Rep
first_name
Legislator's first name
middle_name
Legislator's middle name or initial
last_name
Legislator's last name
name_suffix
Legislator's suffix (Jr., III, etc.)
nickname
Preferred nickname of legislator (if any)
party
Legislator's political party (D, I, or R)
state
two letter abbreviation of legislator's state
state_name
The full state name of the state this member represents.
state_rank
(Senate only) The seniority of that Senator for that state. "junior" or
"senior".
district
If legislator is a representative, their district. 0 is used
for At-Large districts
in_office
1 if legislator is currently serving, 0 if legislator is no
longer in office due to defeat/resignation/death/etc.
chamber
Chamber the member is in. One of "senate" or "house".
phone
Congressional office phone number
fax
Congressional office fax number
office
Office number for the member's DC office.
website
URL of Congressional website
contact_form
URL of web contact form
email
Legislator's email address (if known)
congress_office
Legislator's Washington DC Office Address
bioguide_id
Legislator ID assigned by
http://bioguide.congress.gov/biosearch/biosearch.asp Congressional
Biographical Directory (also used by Washington Post/NY Times)
ocd_id
Identifier for this member across all countries and levels of government, as
defined by the Open Civic Data project.
thomas_id
Identifier for this member as it appears on THOMAS.gov and Congress.gov.
lis_id
Identifier for this member as it appears on some of Congress' data systems (namely
Senate votes).
crp_id
Identifier for this member as it appears on Center for Responsive
Politics OpenSecrets (http://opensecrets.org)
icpsr_id
Identifier for this member as it is maintained by the Inter-university
Consortium for Political and Social Research.
votesmart_id
Legislator ID assigned by http://votesmart.org Project
Vote Smart
fec_ids
http://fec.gov Federal Election Commission ID
govtrack_id
ID assigned by http://govtrack.us Govtrack.us
congresspedia_url
URL of Legislator's entry on http://congresspedia.org
Congresspedia
twitter_id
The Twitter username for a member's official legislative account. This field
does not contain the handles of campaign accounts.
youtube_id
The YouTube username or channel for a member's official legislative account.
This field does not contain the handles of campaign accounts. A few legislators use YouTube
"channels" instead of regular accounts. These channels will be of the form channel/[id
facebook_id
The Facebook username or ID for a member's official legislative Facebook
presence. ID numbers and usernames can be used interchangeably in Facebook's URLs and APIs.
The referenced account may be either a Facebook Page or a user account.
senate_class
for senators I, II, or III depending on the Senator's
election term
term_start
The date a member's current term started.
term_end
The date a member's current term will end.
birthday
YYYY-MM-DD formatted birth date
latitude
latitude of coordinate
longitude
longitude of coordinate
query
(character) Return results the API thinks best match your query. Queries are
interpreted as phrases.
fields
You can request specific fields by supplying a vector of fields names. Many fields
are not returned unless requested. If you don't supply a fields parameter, you will get the
most commonly used subset of fields only. To save on bandwidth, parsing time, an
page
Page to return. Default: 1. You can use this in combination with the
per_page parameter to get more than the default or max number of results per page.
per_page
Number of records to return. Default: 20. Max: 50.
order
Sort results by one or more fields with the order parameter. order is
optional, but if no order is provided, the order of results is not guaranteed to be predictable.
Append __asc
or __desc
to the field names to control sort dire
key
your SunlightLabs API key; loads from environment variable from .Renviron or
from an option from .Rprofile
as
(character) One of table (default), list, or response (httr response object).
When table is requested, the default, a table is not always returned, but is returned almost
always. You can then make a table yourself if you like.
...
Optional additional curl options (debugging tools mostly). See examples.