Title: | Access Functions for ProPublica's APIs |
---|---|
Description: | Provides wrapper functions to access the ProPublica's Congress and Campaign Finance APIs. The Congress API provides near real-time access to legislative data from the House of Representatives, the Senate and the Library of Congress. The Campaign Finance API provides data from United States Federal Election Commission filings and other sources. The API covers summary information for candidates and committees, as well as certain types of itemized data. For more information about these APIs go to: <https://www.propublica.org/datastore/apis>. |
Authors: | Aleksander Dietrichson [aut, cre], Joselina Davit [aut] |
Maintainer: | Aleksander Dietrichson <[email protected]> |
License: | GPL-3 | file LICENSE |
Version: | 1.1.4 |
Built: | 2025-01-21 05:26:05 UTC |
Source: | https://github.com/dietrichson/propublicar |
Use this request to search the title and full text of legislation by keyword to get the 20 most recent bills. Searches cover House and Senate bills from the 113th Congress through the current Congress (115th). If multiple words are given (e.g. query = health care) the search is treated as multiple keywords using the OR operator. Quoting the words (e.g. query = "health care") makes it a phrase search. Search results can be sorted by date (the default) or by relevance, and in ascending or descending order.
bills_legislation_by_keyword( query_keyword, sort = c("date", "_score"), dir = c("desc", "asc"), page = 1, myAPI_Key )
bills_legislation_by_keyword( query_keyword, sort = c("date", "_score"), dir = c("desc", "asc"), page = 1, myAPI_Key )
query_keyword |
keyword or phrase to search the title and full text of legislation to get the 20 most recent bills |
sort |
_score or date (default is date) |
dir |
sort direction: asc or desc |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
a list object with the return values about title and full text of legislation by keyword
## Not run: bills_legislation_by_keyword(query_keyword = 'megahertz') ## End(Not run)
## Not run: bills_legislation_by_keyword(query_keyword = 'megahertz') ## End(Not run)
To compare bill sponsorship between two members who served in the same Congress and chamber. HTTP Request: GET https://api.propublica.org/congress/v1/members/first-member-id/bills/second-member-id/congress/chamber.json
compare_two_member_bill_sponsorships( first_member_id, second_member_id, congress, chamber, page = 1, myAPI_Key )
compare_two_member_bill_sponsorships( first_member_id, second_member_id, congress, chamber, page = 1, myAPI_Key )
first_member_id |
The ID of the member to retrieve; it is assigned by the Biographical Directory of the United States Congress or can be retrieved from a member list request. |
second_member_id |
The ID of the member to retrieve; it is assigned by the Biographical Directory of the United States Congress or can be retrieved from a member list request. |
congress |
102-116 for House, 101-116 for Senate |
chamber |
house o senate |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of bill sponsorship comparison between two members who served in the same Congress and chamber
## Not run: compare_two_member_bill_sponsorships('G000575', 'D000624', '114', 'house') ## End(Not run)
## Not run: compare_two_member_bill_sponsorships('G000575', 'D000624', '114', 'house') ## End(Not run)
Use this request type to compare two members’ vote positions in a particular Congress and chamber. Responses include four calculated values, showing the number and percentage of votes in which the members took the same position or opposing positions. HTTP Request: GET https://api.propublica.org/congress/v1/members/first-member-id/votes/second-member-id/congress/chamber.json
compare_two_member_vote_positions( first_member_id, second_member_id, congress, chamber, page = 1, myAPI_Key )
compare_two_member_vote_positions( first_member_id, second_member_id, congress, chamber, page = 1, myAPI_Key )
first_member_id |
The ID of the member to retrieve; it is assigned by the Biographical Directory of the United States Congress or can be retrieved from a member list request. |
second_member_id |
The ID of the member to retrieve; it is assigned by the Biographical Directory of the United States Congress or can be retrieved from a member list request. |
congress |
102-116 for House, 101-116 for Senate |
chamber |
house or senate |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves four calculated values: common_votes, disagree_votes, agree_percent and disagree_percent to compare two members’ vote positions, in a particular Congress and chamber
## Not run: compare_two_member_vote_positions('G000575', 'D000624', '114', 'house') ## End(Not run)
## Not run: compare_two_member_vote_positions('G000575', 'D000624', '114', 'house') ## End(Not run)
Use this request type to get details on bills that may be considered by the House or Senate in the near future, based on scheduled published or announced by congressional leadership.
get_a_bill(congress, bill_id, page = 1, myAPI_Key)
get_a_bill(congress, bill_id, page = 1, myAPI_Key)
congress |
105-116 |
bill_id |
a bill slug, for example hr4881 - these can be found in the recent bill response. |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
The responses include a legislative_day attribute which is the earliest the bills could be considered, and a range attribute that indicates whether the bill information comes from a weekly schedule or a daily one. Combine the two for the best sense of when a bill might come up for consideration. For Senate bills, the response includes a context attribute reproducing the sentence that includes mention of the bill. These responses omit bills that have not yet been assigned a bill number or introduced, and additional bills may be considered at any time.
List with the result of the query
## Not run: get_a_bill(115, 'hr21') ## End(Not run)
## Not run: get_a_bill(115, 'hr21') ## End(Not run)
HTTP Request: GET https://api.propublica.org/congress/v1/congress/bills/bill-id/amendments.json. Use this request type to get Library of Congress-assigned subjects about a particular bill.
get_amendments_bill(congress, bill_id, page = 1, myAPI_Key)
get_amendments_bill(congress, bill_id, page = 1, myAPI_Key)
congress |
105-116 |
bill_id |
a bill slug, for example hr4881 - these can be found in the recent bill response. |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves the 20 most recent results and supports paginated requests.
## Not run: get_amendments_bill(115, 'hr1628') ## End(Not run)
## Not run: get_amendments_bill(115, 'hr1628') ## End(Not run)
To get the 20 most recent bill cosponsorships for a particular member, either bills cosponsored or bills where cosponsorship was withdrawn. #HTTP Request: GET https://api.propublica.org/congress/v1/members/member-id/bills/type.json
get_bills_cosponsored_member( member_id, type = c("cosponsored", "withdrawn"), page = 1, myAPI_Key )
get_bills_cosponsored_member( member_id, type = c("cosponsored", "withdrawn"), page = 1, myAPI_Key )
member_id |
The ID of the member to retrieve; it is assigned by the Biographical Directory of the United States Congress or can be retrieved from a member list request. |
type |
cosponsored or withdrawn |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves the 20 most recent bill cosponsorships for a particular member
## Not run: get_bills_cosponsored_member('B001260', 'cosponsored') ## End(Not run)
## Not run: get_bills_cosponsored_member('B001260', 'cosponsored') ## End(Not run)
Get Candidate Info https://www.propublica.org/datastore/apis GET https://api.propublica.org/campaign-finance/v1/cycle/candidates/fec-id
get_candidate(FEC_ID, cycle = 2018, page = 1, myAPI_Key)
get_candidate(FEC_ID, cycle = 2018, page = 1, myAPI_Key)
FEC_ID |
The FEC-assigned 9-character ID of a candidate. |
cycle |
The election cycle must be even-numbered year between 1996 and 2018 |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
a list object with the return values about candidate basic information
## Not run: get_candidate('P60005915', 2016) ## End(Not run)
## Not run: get_candidate('P60005915', 2016) ## End(Not run)
https://www.propublica.org/datastore/apis HTTP Request: GET https://api.propublica.org/campaign-finance/v1/cycle/candidates/search
get_candidate_by_name(NAME, cycle = 2018, page = 1, myAPI_Key)
get_candidate_by_name(NAME, cycle = 2018, page = 1, myAPI_Key)
NAME |
The first or last name of the candidate. |
cycle |
The election cycle |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves federal candidates by last name, using a query string parameter.
## Not run: get_candidate_by_name('Wilson', 2016) ## End(Not run)
## Not run: get_candidate_by_name('Wilson', 2016) ## End(Not run)
Get Candidates in Race
get_candidates_in_race( state, chamber, district, cycle = 2018, return_value = c("results", "query"), page = 1, myAPI_Key )
get_candidates_in_race( state, chamber, district, cycle = 2018, return_value = c("results", "query"), page = 1, myAPI_Key )
state |
State abbreviation |
chamber |
house or senate |
district |
house district |
cycle |
The election cycle in question, e.g. 2018 |
return_value |
should results be retrieved, or query string returned. |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
The result of the API call (list), unless return_value=query
(mostly for debugging), in which case the query string is returned.
## Not run: get_candidates_in_race('MI', 'house', 11) ## End(Not run)
## Not run: get_candidates_in_race('MI', 'house', 11) ## End(Not run)
Get Committee Info HTTP Request: GET https://api.propublica.org/campaign-finance/v1/cycle/committees/fec-id
get_committee(FEC_ID, cycle = 2018, page = 1, myAPI_Key)
get_committee(FEC_ID, cycle = 2018, page = 1, myAPI_Key)
FEC_ID |
The FEC-assigned 9-character ID of a committee. |
cycle |
The election cycle |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves ca specific FEC committee for a given campaign cycle from the campaign-finance API from ProPublica.
## Not run: get_committee('C00553560', 2016) ## End(Not run)
## Not run: get_committee('C00553560', 2016) ## End(Not run)
HTTP Request: GET https://api.propublica.org/campaign-finance/v1/cycle/committees/search
get_committee_by_name(NAME, cycle = 2018, page = 1, myAPI_Key)
get_committee_by_name(NAME, cycle = 2018, page = 1, myAPI_Key)
NAME |
The name of the committee. |
cycle |
The election cycle |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves ca specific committee by name for a given campaign cycle from the campaign-finance API from ProPublica.
## Not run: get_committee_by_name('Americans FOR A BETTER TOMORROW TODAY', 2016) ## End(Not run)
## Not run: get_committee_by_name('Americans FOR A BETTER TOMORROW TODAY', 2016) ## End(Not run)
HTTP Request: GET https://api.propublica.org/campaign-finance/v1/cycle/committees/fec-id/electioneering_communications
get_committee_electioneering_communications( cycle = 2018, FEC_ID, page = 1, myAPI_Key )
get_committee_electioneering_communications( cycle = 2018, FEC_ID, page = 1, myAPI_Key )
cycle |
The election cycle |
FEC_ID |
The FEC-assigned 9-character ID of a committee. |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves the 20 most recently added FEC independent expenditure-only committees, known as “super PACs” from the campaign-finance API from ProPublica.
## Not run: get_committee_electioneering_communications(2016, 'C30002034') ## End(Not run)
## Not run: get_committee_electioneering_communications(2016, 'C30002034') ## End(Not run)
HTTP Request GET https://api.propublica.org/campaign-finance/v1/cycle/committees/fec-id/filings
get_committee_filings(FEC_ID, cycle = 2018, page = 1, myAPI_Key)
get_committee_filings(FEC_ID, cycle = 2018, page = 1, myAPI_Key)
FEC_ID |
The FEC-assigned 9-character ID of a committee. |
cycle |
The election cycle |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves the 20 most recent FEC filings from the specified committee. Electronic filings are available back to 2001. Paper filings by Senate candidate committees and senatorial party committees go back to 1999.
## Not run: get_committee_filings('C00553560', 2016) ## End(Not run)
## Not run: get_committee_filings('C00553560', 2016) ## End(Not run)
HTTP Request: GET https://api.propublica.org/campaign-finance/v1/cycle/committees/leadership
get_committee_leadership(cycle = 2018, page = 1, myAPI_Key)
get_committee_leadership(cycle = 2018, page = 1, myAPI_Key)
cycle |
The election cycle: an even-numbered year between 1996 and 2016. The current cycle in 2018 |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves committees designated as “leadership PACs” by the FEC from the campaign-finance API from ProPublica.
## Not run: get_committee_leadership(2016) ## End(Not run)
## Not run: get_committee_leadership(2016) ## End(Not run)
To get biographical and Congressional role information for a particular member of Congress. HTTP Request: GET https://api.propublica.org/congress/v1/members/member-id.json
get_congress_member(member_id, page = 1, myAPI_Key)
get_congress_member(member_id, page = 1, myAPI_Key)
member_id |
The ID of the member to retrieve; it is assigned by the Biographical Directory of the United States Congress or can be retrieved from a member list request. |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves biographical and Congressional role information for a particular member of Congress
## Not run: get_congress_member('K000388') ## End(Not run)
## Not run: get_congress_member('K000388') ## End(Not run)
To get lists of statements published on a specific member’s congressional website during a particular congress, use the following function. HTTP Request: GET https://api.propublica.org/congress/v1/congress/bills/bill-id/statements.json
get_congressional_statement_by_bill(congress, bill_id, page = 1, myAPI_Key)
get_congressional_statement_by_bill(congress, bill_id, page = 1, myAPI_Key)
congress |
113-116 |
bill_id |
a bill slug, for example s19 - these can be found in bill responses. |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves the 20 most recent results and supports pagination using multiples of 20.
## Not run: get_congressional_statement_by_bill(115, 's19') ## End(Not run)
## Not run: get_congressional_statement_by_bill(115, 's19') ## End(Not run)
Get lists of statements published on a specific member’s congressional website during a particular congress, use the following function.
get_congressional_statement_by_member(member_id, congress, page = 1, myAPI_Key)
get_congressional_statement_by_member(member_id, congress, page = 1, myAPI_Key)
member_id |
The ID of the member to retrieve; it is assigned by the Biographical Directory of the United States Congress or can be retrieved from a member list request. |
congress |
113-116 |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves the 20 most recent results and supports pagination using multiples of 20.
## Not run: get_congressional_statement_by_member("C001084", 115) ## End(Not run)
## Not run: get_congressional_statement_by_member("C001084", 115) ## End(Not run)
To get lists of statements published on congressional websites for a particular subject, use the following function.These subjects are not automatically assigned but are manually curated by ProPublica, although they are based on legislative subjects produced by the Library of Congress. We advise using the statement search response for a more complete listing of statements about a keyword or phrase. HTTP Request: GET https://api.propublica.org/congress/v1/statements/subject/subject.json
get_congressional_statement_by_subjects(subject, page = 1, myAPI_Key)
get_congressional_statement_by_subjects(subject, page = 1, myAPI_Key)
subject |
Slug version of subject |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves the 20 most recent results and supports pagination using multiples of 20.
## Not run: get_statement_subjects()$results[[11]][3] get_congressional_statement_by_subjects(get_statement_subjects()$results[[11]][3]) get_congressional_statement_by_subjects("Central Intelligence Agency") ## End(Not run)
## Not run: get_statement_subjects()$results[[11]][3] get_congressional_statement_by_subjects(get_statement_subjects()$results[[11]][3]) get_congressional_statement_by_subjects("Central Intelligence Agency") ## End(Not run)
HTTP Request: GET https://api.propublica.org/congress/v1/congress/bills/bill-id/cosponsors.json. Use this request type to get Library of Congress-assigned subjects about a particular bill.
get_cosponsors_specific_bill(congress, bill_id, page = 1, myAPI_Key)
get_cosponsors_specific_bill(congress, bill_id, page = 1, myAPI_Key)
congress |
105-116 |
bill_id |
a bill slug, for example hr4881 - these can be found in the recent bill response. |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves information about the cosponsors of a particular bill
## Not run: get_cosponsors_specific_bill(114, 'hr4249') ## End(Not run)
## Not run: get_cosponsors_specific_bill(114, 'hr4249') ## End(Not run)
Senate Request: GET https://api.propublica.org/congress/v1/members/chamber/state/current.json House Request: GET https://api.propublica.org/congress/v1/members/chamber/state/district/current.json
get_current_members_by_statedistrict( state, chamber, district, page = 1, myAPI_Key )
get_current_members_by_statedistrict( state, chamber, district, page = 1, myAPI_Key )
state |
Two-letter state abbreviation |
chamber |
house or senate |
district |
House of Representatives district number (House requests only). For states with at-large districts (AK, DE, MT, ND, SD, VT, WY), territories (GU, AS, VI, MP), commonwealths (PR) and the District of Columbia, use a district value of 1. |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves biographical and Congressional role information for a particular member of Congress by State/District
## Not run: get_current_members_by_statedistrict( 'MI', 'house', 11) get_current_members_by_statedistrict( 'RI', 'senate') ## End(Not run)
## Not run: get_current_members_by_statedistrict( 'MI', 'house', 11) get_current_members_by_statedistrict( 'RI', 'senate') ## End(Not run)
HTTP Request: GET https://api.propublica.org/campaign-finance/v1/cycle/electioneering_communications/year/month/day
get_electioneering_communications_by_date( cycle = 2018, year, month, day, page = 1, myAPI_Key )
get_electioneering_communications_by_date( cycle = 2018, year, month, day, page = 1, myAPI_Key )
cycle |
The election cycle |
year |
The four-digit year from 2008-2016. |
month |
The two-digit month from 01-12 |
day |
The two-digit day from 01-31 |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves all broadcast advertisements that identify one or more federal candidates (and have aired 30 days before a primary election and 60 days before the general election) from a specific date.
## Not run: get_electioneering_communications_by_date(2016, 2012, '10', '01') ## End(Not run)
## Not run: get_electioneering_communications_by_date(2016, 2012, '10', '01') ## End(Not run)
HTTP Request: GET https://api.propublica.org/campaign-finance/v1/cycle/committees/fec-id/electioneering_communications
get_electioneering_communications_committee( cycle = 2018, FEC_ID, page = 1, myAPI_Key )
get_electioneering_communications_committee( cycle = 2018, FEC_ID, page = 1, myAPI_Key )
cycle |
The election cycle |
FEC_ID |
The FEC-assigned 9-character ID of a committee. To find a committee official FEC ID, use a candidate search request or the FEC web site. |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves the most recent broadcast advertisements by a specific committee that identify one or more federal candidates (and have aired 30 days before a primary election and 60 days before the general election).
## Not run: get_electioneering_communications_committee(2016, 'C30002034') ## End(Not run)
## Not run: get_electioneering_communications_committee(2016, 'C30002034') ## End(Not run)
HTTP Request: GET https://api.propublica.org/campaign-finance/v1/cycle/filings/search
get_electronic_filing_by_committees(NAME, cycle = 2018, page = 1, myAPI_Key)
get_electronic_filing_by_committees(NAME, cycle = 2018, page = 1, myAPI_Key)
NAME |
The committee name or partial name |
cycle |
The election cycle |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves information about FEC reports filed electronically by a committee for a given campaign cycle from the campaign-finance API from ProPublica.
## Not run: get_electronic_filing_by_committees(NAME = "UNITED EGG", 2016) ## End(Not run)
## Not run: get_electronic_filing_by_committees(NAME = "UNITED EGG", 2016) ## End(Not run)
HTTP Request: GET https://api.propublica.org/campaign-finance/v1/cycle/filings/types/form-type-id
get_electronic_filing_by_types(cycle = 2018, form_type_id, page = 1, myAPI_Key)
get_electronic_filing_by_types(cycle = 2018, form_type_id, page = 1, myAPI_Key)
cycle |
The election cycle |
form_type_id |
F + integer. To get form type IDs, use an electronic filing form types request. |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves a list of available form types for FEC electronic filings.
## Not run: get_electronic_filing_by_types(2016, 'F24') get_electronic_filing_by_types(2016, matrix(unlist(get_electronic_filing_form_types(2016)$results), ncol = 2, byrow = TRUE)[8]) #' ## End(Not run)
## Not run: get_electronic_filing_by_types(2016, 'F24') get_electronic_filing_by_types(2016, matrix(unlist(get_electronic_filing_form_types(2016)$results), ncol = 2, byrow = TRUE)[8]) #' ## End(Not run)
HTTP Request: GET https://api.propublica.org/campaign-finance/v1/cycle/filings/year/month/day
get_electronic_filing_byDate( cycle = 2018, year, month, day, page = 1, myAPI_Key )
get_electronic_filing_byDate( cycle = 2018, year, month, day, page = 1, myAPI_Key )
cycle |
The election cycle |
year |
The four-digit year from 2001-2016 |
month |
The two-digit month from 01-12 |
day |
The two-digit day from 01-31 |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves information about FEC reports filed electronically on a specific date.
## Not run: get_electronic_filing_byDate(2016, 2016, '01', '10') ## End(Not run)
## Not run: get_electronic_filing_byDate(2016, 2016, '01', '10') ## End(Not run)
HTTP Request: GET https://api.propublica.org/campaign-finance/v1/cycle/filings/types
get_electronic_filing_form_types(cycle = 2018, page = 1, myAPI_Key)
get_electronic_filing_form_types(cycle = 2018, page = 1, myAPI_Key)
cycle |
The election cycle |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves a list of available form types for FEC electronic filings.
## Not run: get_electronic_filing_form_types(2016) ## End(Not run)
## Not run: get_electronic_filing_form_types(2016) ## End(Not run)
To get a list of 20 upcoming Senate or House committee meetings, use the following function. HTTP Request: GET https://api.propublica.org/congress/v1/congress/chamber/committees/committee-id/hearings.json
get_hearing_specific_committee( congress, chamber, committee_id, page = 1, myAPI_Key )
get_hearing_specific_committee( congress, chamber, committee_id, page = 1, myAPI_Key )
congress |
114-116 |
chamber |
house or senate |
committee_id |
Optional committee abbreviation, for example HSAG. Use the full committees response to find abbreviations. |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves the 20 most recent hearings and supports pagination.
## Not run: get_hearing_specific_committee(115, 'house', 'HSRU') get_hearing_specific_committee(115, 'house', lists_of_committees(115, "senate")$results[[1]]$committees[[1]]$id) ## End(Not run)
## Not run: get_hearing_specific_committee(115, 'house', 'HSRU') get_hearing_specific_committee(115, 'house', lists_of_committees(115, "senate")$results[[1]]$committees[[1]]$id) ## End(Not run)
To get the latest actions from the House or Senate floor, use the following function. HTTP Request: GET hhttps://api.propublica.org/congress/v1/chamber/floor_updates/year/month/day.json
get_house_senate_floor_actions_by_date( chamber, year, month, day, page = 1, myAPI_Key )
get_house_senate_floor_actions_by_date( chamber, year, month, day, page = 1, myAPI_Key )
chamber |
house or senate |
year |
YYYY format |
month |
MM format |
day |
DD format |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves the 20 most recent results for that date and supports pagination using multiples of 20.
## Not run: get_house_senate_floor_actions_by_date('senate', 2017, '05', '02') ## End(Not run)
## Not run: get_house_senate_floor_actions_by_date('senate', 2017, '05', '02') ## End(Not run)
#HTTP Request: GET https://api.propublica.org/campaign-finance/v1/cycle/committees/fec-id/independent_expenditures
get_independent_expenditure_by_committee( cycle = 2018, FEC_ID, page = 1, myAPI_Key )
get_independent_expenditure_by_committee( cycle = 2018, FEC_ID, page = 1, myAPI_Key )
cycle |
The election cycle |
FEC_ID |
The FEC-assigned 9-character ID of a committee. To find a committee official FEC ID, use a candidate search request or the FEC web site. |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves the 20 most recent independent expenditures by a given committee.
## Not run: get_independent_expenditure_by_committee(2016, FEC_ID ='C00575423') ## End(Not run)
## Not run: get_independent_expenditure_by_committee(2016, FEC_ID ='C00575423') ## End(Not run)
HTTP Request: GET https://api.propublica.org/campaign-finance/v1/cycle/independent_expenditures/year/month/day
get_independent_expenditure_by_date( cycle = 2018, year, month, day, page = 1, myAPI_Key )
get_independent_expenditure_by_date( cycle = 2018, year, month, day, page = 1, myAPI_Key )
cycle |
The election cycle |
year |
The four-digit year from 2008-2016 |
month |
The two-digit month from 01-12 |
day |
The two-digit day from 01-31 |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves all independent expenditures on a specific date (the date of activity, not the date filed with the FEC).
## Not run: get_independent_expenditure_by_date(2016, year = 2018, month ='01', day = '01') ## End(Not run)
## Not run: get_independent_expenditure_by_date(2016, year = 2018, month ='01', day = '01') ## End(Not run)
HTTP Request: GET https://api.propublica.org/campaign-finance/v1/cycle/independent_expenditures/race_totals/office
get_independent_expenditure_office_totals( cycle = 2018, office = c("house", "senate", "president"), page = 1, myAPI_Key )
get_independent_expenditure_office_totals( cycle = 2018, office = c("house", "senate", "president"), page = 1, myAPI_Key )
cycle |
The election cycle |
office |
one of house, senate or president |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves he amount of money spent in independent expenditures for a given office (either House, Senate or President).
## Not run: get_independent_expenditure_office_totals(2016, 'president') get_independent_expenditure_office_totals(2016, 'house') get_independent_expenditure_office_totals(2016, 'senate') ## End(Not run)
## Not run: get_independent_expenditure_office_totals(2016, 'president') get_independent_expenditure_office_totals(2016, 'house') get_independent_expenditure_office_totals(2016, 'senate') ## End(Not run)
HTTP Request: GET https://api.propublica.org/campaign-finance/v1/cycle/committees/fec-id/independent_expenditures/races
get_independent_expenditure_race_totals_committee( cycle, FEC_ID, page = 1, myAPI_Key )
get_independent_expenditure_race_totals_committee( cycle, FEC_ID, page = 1, myAPI_Key )
cycle |
The election cycle |
FEC_ID |
The FEC-assigned 9-character ID of a committee |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
list of returned JSON from endpoint that retrieves the total amounts of money that a given committee has spent on individual races (consisting of a state, office and district) during a cycle.
## Not run: get_independent_expenditure_race_totals_committee(2016, 'C00490375') ## End(Not run)
## Not run: get_independent_expenditure_race_totals_committee(2016, 'C00490375') ## End(Not run)
#HTTP Request: GET https://api.propublica.org/campaign-finance/v1/cycle/candidates/fec-id/independent_expenditures
get_independent_expenditure_support_candidate( cycle = 2018, FEC_ID, page = 1, myAPI_Key )
get_independent_expenditure_support_candidate( cycle = 2018, FEC_ID, page = 1, myAPI_Key )
cycle |
The election cycle |
FEC_ID |
The FEC-assigned 9-character ID of a committee. To find a committee official FEC ID, use a candidate search request or the FEC web site. |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves the 200 most recent independent expenditures in support of or opposition to a given candidate.
## Not run: get_independent_expenditure_support_candidate(2016, FEC_ID ='P00003392') ## End(Not run)
## Not run: get_independent_expenditure_support_candidate(2016, FEC_ID ='P00003392') ## End(Not run)
#HTTP Request: GET https://api.propublica.org/campaign-finance/v1/cycle/president/independent_expenditures
get_independent_expenditure_support_presidential_candidate( cycle = 2018, page = 1, myAPI_Key )
get_independent_expenditure_support_presidential_candidate( cycle = 2018, page = 1, myAPI_Key )
cycle |
The election cycle |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves the 200 most recent independent expenditures in support of or opposition to any presidential candidate.
## Not run: get_independent_expenditure_support_presidential_candidate(2016) ## End(Not run)
## Not run: get_independent_expenditure_support_presidential_candidate(2016) ## End(Not run)
Committees must report registered lobbyists who act as “bundlers”, collecting donations for the committee from multiple contributors. HTTP Request: GET https://api.propublica.org/campaign-finance/v1/cycle/committees/fec-id/lobbyist_bundlers
get_lobbyist_bundlers(cycle = 2018, FEC_ID, page = 1, myAPI_Key)
get_lobbyist_bundlers(cycle = 2018, FEC_ID, page = 1, myAPI_Key)
cycle |
The election cycle |
FEC_ID |
The FEC-assigned 9-character ID of a committee. To find a committee’s official FEC ID, use a committee search request or the FEC web site. |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves the most recent lobbyist bundlers reported by a specific committee.
## Not run: get_lobbyist_bundlers(2016, 'C00579458') ## End(Not run)
## Not run: get_lobbyist_bundlers(2016, 'C00579458') ## End(Not run)
To get the most recent vote positions for a specific member of the House of Representatives or Senate. HTTP Request: GET https://api.propublica.org/congress/v1/members/member-id/votes.json
get_member_vote_position(member_id, page = 1, myAPI_Key)
get_member_vote_position(member_id, page = 1, myAPI_Key)
member_id |
The ID of the member to retrieve; it is assigned by the Biographical Directory of the United States Congress or can be retrieved from a member list request. |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves the most recent vote positions for a specific member of the House of Representatives or Senate
## Not run: get_member_vote_position('K000388') ## End(Not run)
## Not run: get_member_vote_position('K000388') ## End(Not run)
To get a list of members who have left the Senate or House or have announced plans to do so. HTTP Request: GET https://api.propublica.org/congress/v1/congress/chamber/members/leaving.json
get_members_leaving(congress, chamber, page = 1, myAPI_Key)
get_members_leaving(congress, chamber, page = 1, myAPI_Key)
congress |
111-116 |
chamber |
house or senate |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves a list of members who have left the Senate or House
## Not run: get_members_leaving(115, 'house') ## End(Not run)
## Not run: get_members_leaving(115, 'house') ## End(Not run)
To get a list of the most recent new members of the current Congress. HTTP Request: GET https://api.propublica.org/congress/v1/members/new.json
get_new_members(page = 1, myAPI_Key)
get_new_members(page = 1, myAPI_Key)
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves a list of the most recent new members of the current Congress
## Not run: get_new_members() ## End(Not run)
## Not run: get_new_members() ## End(Not run)
To get a list of presidential civilian nominations of individuals from a specific state, use the following function. HTTP Request: GET https://api.propublica.org/congress/v1/congress/nominees/state/state.json
get_nominees_by_state(congress, state, page = 1, myAPI_Key)
get_nominees_by_state(congress, state, page = 1, myAPI_Key)
congress |
107-116 |
state |
Two-letter state abbreviation |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves
## Not run: get_nominees_by_state(115, 'VA') ## End(Not run)
## Not run: get_nominees_by_state(115, 'VA') ## End(Not run)
The House of Representatives publishes quarterly reports detailing official office expenses by lawmakers. The Congress API has data beginning in the third quarter of 2009. HTTP Request: GET https://api.propublica.org/congress/v1/members/member-id/office_expenses/year/quarter.json
get_quarter_office_expenses_by_category_house_member( member_id, category, page = 1, myAPI_Key )
get_quarter_office_expenses_by_category_house_member( member_id, category, page = 1, myAPI_Key )
member_id |
The ID of the member to retrieve; it is assigned by the Biographical Directory of the United States Congress or can be retrieved from a member list request. |
category |
travel or personnel or rent-utilities or other-services or supplies or franked-mail or printing or equipment or total. |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
the amount a given lawmaker spent during a specified year and quarter in a specified category
## Not run: get_quarter_office_expenses_by_category_house_member('A000374', 'travel') ## End(Not run)
## Not run: get_quarter_office_expenses_by_category_house_member('A000374', 'travel') ## End(Not run)
The House of Representatives publishes quarterly reports detailing official office expenses by lawmakers. The Congress API has data beginning in the third quarter of 2009. HTTP Request: GET https://api.propublica.org/congress/v1/members/member-id/office_expenses/year/quarter.json
get_quarter_office_expenses_house_member( member_id, year, quarter, page = 1, myAPI_Key )
get_quarter_office_expenses_house_member( member_id, year, quarter, page = 1, myAPI_Key )
member_id |
The ID of the member to retrieve; it is assigned by the Biographical Directory of the United States Congress or can be retrieved from a member list request.l |
year |
2009-2017 |
quarter |
1,2,3,4 |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
the amount a given lawmaker spent during a specified year and quarter by category,
## Not run: get_quarter_office_expenses_house_member('A000374', 2017, 4) ## End(Not run)
## Not run: get_quarter_office_expenses_house_member('A000374', 2017, 4) ## End(Not run)
Get all Candidates in a State for an Election Cycle
get_races_for_state(state, cycle = 2018)
get_races_for_state(state, cycle = 2018)
state |
The State (US) of the election |
cycle |
Which election cycle (e.g. 2018) |
the result of the API call.
## Not run: get_races_for_state('DE') get_races_for_state('DE', 2016) ## End(Not run)
## Not run: get_races_for_state('DE') get_races_for_state('DE', 2016) ## End(Not run)
HTTP Request: GET https://api.propublica.org/campaign-finance/v1/cycle/filings/amendments
get_recent_amendments(cycle = 2018, page = 1, myAPI_Key)
get_recent_amendments(cycle = 2018, page = 1, myAPI_Key)
cycle |
The election cycle |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves the most recent filings that are amendments of earlier filings
## Not run: get_recent_amendments(2016) ## End(Not run)
## Not run: get_recent_amendments(2016) ## End(Not run)
To get a list of 20 upcoming Senate or House committee meetings, use the following function. HTTP Request: GET https://api.propublica.org/congress/v1/congress/committees/hearings.json
get_recent_committee_hearing(congress, page = 1, myAPI_Key)
get_recent_committee_hearing(congress, page = 1, myAPI_Key)
congress |
114-116 |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves the 20 most recent results and supports pagination using multiples of 20.
## Not run: get_recent_committee_hearing(115) ## End(Not run)
## Not run: get_recent_committee_hearing(115) ## End(Not run)
To get lists of recent statements published on congressional websites, use the following function. HTTP Request: GET https://api.propublica.org/congress/v1/statements/latest.json
get_recent_congressional_statements(page = 1, myAPI_Key)
get_recent_congressional_statements(page = 1, myAPI_Key)
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves the 20 most recent results and supports pagination using multiples of 20.
## Not run: get_recent_congressional_statements() ## End(Not run)
## Not run: get_recent_congressional_statements() ## End(Not run)
To get lists of statements published on congressional websites on a particular date, use the following function. HTTP Request: GET https://api.propublica.org/congress/v1/statements/date/date.json
get_recent_congressional_statements_by_date( year, month, day, page = 1, myAPI_Key )
get_recent_congressional_statements_by_date( year, month, day, page = 1, myAPI_Key )
year |
YYYY format |
month |
MM format |
day |
DD format |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves the 20 most recent results and supports pagination using multiples of 20.
## Not run: get_recent_congressional_statements_by_date(2017, '05', '08') ## End(Not run)
## Not run: get_recent_congressional_statements_by_date(2017, '05', '08') ## End(Not run)
To get lists of statements published on congressional websites using a search term, use the following function. HTTP Request: GET https://api.propublica.org/congress/v1/statements/search.json?query=term
get_recent_congressional_statements_by_term(term, page = 1, myAPI_Key)
get_recent_congressional_statements_by_term(term, page = 1, myAPI_Key)
term |
search term |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves the 20 most recent results that contain the search term in the title or body of the statement and supports pagination using multiples of 20.
## Not run: get_recent_congressional_statements_by_term('AHCA') ## End(Not run)
## Not run: get_recent_congressional_statements_by_term('AHCA') ## End(Not run)
HTTP Request: GET https://api.propublica.org/campaign-finance/v1/cycle/electioneering_communications
get_recent_electioneering_communications(cycle = 2018, page = 1, myAPI_Key)
get_recent_electioneering_communications(cycle = 2018, page = 1, myAPI_Key)
cycle |
The election cycle |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves the 20 most recent broadcast advertisements that identify one or more federal candidates (and have aired 30 days before a primary election and 60 days before the general election).
## Not run: get_recent_electioneering_communications(2016) ## End(Not run)
## Not run: get_recent_electioneering_communications(2016) ## End(Not run)
To get the latest actions from the House or Senate floor, use the following function. HTTP Request: GET https://api.propublica.org/congress/v1/congress/chamber/floor_updates.json
get_recent_house_senate_floor_actions(congress, chamber, page = 1, myAPI_Key)
get_recent_house_senate_floor_actions(congress, chamber, page = 1, myAPI_Key)
congress |
114-116 for House, 96-116 for Senate |
chamber |
house or senate |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves the 20 most recent results and supports pagination using multiples of 20. The date attribute represents the “legislative day” in which the action took place (actions that occur after midnight often are part of the previous day’s activity).
## Not run: get_recent_house_senate_floor_actions(115, 'house') ## End(Not run)
## Not run: get_recent_house_senate_floor_actions(115, 'house') ## End(Not run)
HTTP Request: GET https://api.propublica.org/campaign-finance/v1/cycle/independent_expenditures
get_recent_independent_expend(cycle = 2018, page = 1, myAPI_Key)
get_recent_independent_expend(cycle = 2018, page = 1, myAPI_Key)
cycle |
The election cycle @return List of returned JSON from endpoint that retrieves the 200 most recent independent expenditures and optionally can be offset by multiples of 20. |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
## Not run: get_recent_independent_expend(2016) ## End(Not run)
## Not run: get_recent_independent_expend(2016) ## End(Not run)
Get Recent Late Contributions https://www.propublica.org/datastore/apis HTTP Request: GET https://api.propublica.org/campaign-finance/v1/cycle/contributions/48hour
get_recent_late_contributions(cycle = 2018, page = 1, myAPI_Key)
get_recent_late_contributions(cycle = 2018, page = 1, myAPI_Key)
cycle |
The election cycle. Cycle must be even-numbered year between 2010 and 2018 |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves the most recent late contributions to candidates from the campaign-finance API from ProPublica.
## Not run: get_recent_late_contributions(2016) ## End(Not run)
## Not run: get_recent_late_contributions(2016) ## End(Not run)
Get Recent Late Contributions to a Specific Candidate https://www.propublica.org/datastore/apis HTTP Request: GET https://api.propublica.org/campaign-finance/v1/cycle/candidates/fec-id/48hour
get_recent_late_contributions_candidate( cycle = 2018, FEC_ID, page = 1, myAPI_Key )
get_recent_late_contributions_candidate( cycle = 2018, FEC_ID, page = 1, myAPI_Key )
cycle |
The election cycle |
FEC_ID |
The FEC-assigned 9-character ID of a candidate. |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves the most recent late contributions to candidates from the campaign-finance API from ProPublica.
## Not run: get_recent_late_contributions_candidate(2016, 'H4NY11138') ## End(Not run)
## Not run: get_recent_late_contributions_candidate(2016, 'H4NY11138') ## End(Not run)
Get Recent Late Contributions to a Specific Committee https://www.propublica.org/datastore/apis HTTP Request: GET https://api.propublica.org/campaign-finance/v1/cycle/committees/fec-id/48hour
get_recent_late_contributions_committee( cycle = 2018, FEC_ID, page = 1, myAPI_Key )
get_recent_late_contributions_committee( cycle = 2018, FEC_ID, page = 1, myAPI_Key )
cycle |
The election cycle |
FEC_ID |
The FEC-assigned 9-character ID of a committee. |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves the most recent late contributions to a specific committee.
## Not run: get_recent_late_contributions_committee(2016, 'C00575050') ## End(Not run)
## Not run: get_recent_late_contributions_committee(2016, 'C00575050') ## End(Not run)
HTTP Request: GET https://api.propublica.org/campaign-finance/v1/cycle/contributions/48hour/year/month/day
get_recent_late_contributions_date( cycle = 2018, year, month, day, page = 1, myAPI_Key )
get_recent_late_contributions_date( cycle = 2018, year, month, day, page = 1, myAPI_Key )
cycle |
The election cycle |
year |
The four-digit year from 2010-2018, match cycle |
month |
The two-digit month from 01-12 |
day |
The two-digit day from 01-31 |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves late contributions from a specific dates for a given campaign cycle from the campaign-finance API from ProPublica.
## Not run: get_recent_late_contributions_date(2016, year = 2016, month = '09', day = '07') ## End(Not run)
## Not run: get_recent_late_contributions_date(2016, year = 2016, month = '09', day = '07') ## End(Not run)
To get the 20 most recent lobbying representation filings, use the following function. HTTP Request: GET https://api.propublica.org/congress/v1/lobbying/latest.json
get_recent_lobbying_representation_filings(page = 1, myAPI_Key)
get_recent_lobbying_representation_filings(page = 1, myAPI_Key)
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves the 20 most recent lobbying representation filings.
## Not run: get_recent_lobbying_representation_filings() ## End(Not run)
## Not run: get_recent_lobbying_representation_filings() ## End(Not run)
To get lists of presidential nominations for civilian positions,, use the following function. HTTP Request: GET https://api.propublica.org/congress/v1/congress/nominees/type.json
get_recent_nominations_by_category(congress, type, page = 1, myAPI_Key)
get_recent_nominations_by_category(congress, type, page = 1, myAPI_Key)
congress |
107-116 |
type |
received, updated, confirmed, withdrawn |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves the 20 most recent results for the specified type: received, updated, confirmed or withdrawn.
## Not run: get_recent_nominations_by_category(115, 'confirmed') ## End(Not run)
## Not run: get_recent_nominations_by_category(115, 'confirmed') ## End(Not run)
To get lists of official communications to Congress from the president, executive branch agencies and state legislatures to congressional committees, use the following function. HTTP Request: GET https://api.propublica.org/congress/v1/congress/communications.json
get_recent_official_communications(congress, page = 1, myAPI_Key)
get_recent_official_communications(congress, page = 1, myAPI_Key)
congress |
114-116 for House, 96-116 for Senate |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves the 20 most recent official communications to Congress from the president, executive branch agencies and state legislatures to congressional committees. The data covers communications to the House of Representatives since 2015, and communications to the Senate since 1979.
## Not run: get_recent_official_communications(115) ## End(Not run)
## Not run: get_recent_official_communications(115) ## End(Not run)
Get lists of official communications to Congress from the president, executive branch agencies and state legislatures to congressional committees.
get_recent_official_communications_by_category( congress, category, page = 1, myAPI_Key )
get_recent_official_communications_by_category( congress, category, page = 1, myAPI_Key )
congress |
114-116 for House, 96-116 for Senate |
category |
ec, pm, pom |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves the 20 most recent results for the specified type: ec (Executive Communication), pm (Presidential Message) or pom (Petition or Memorial).
## Not run: get_recent_official_communications_by_category(115, 'pm') ## End(Not run)
## Not run: get_recent_official_communications_by_category(115, 'pm') ## End(Not run)
To get lists of official communications to Congress for a specific chamber, use the following function. HTTP Request: GET https://api.propublica.org/congress/v1/congress/chamber/committees/committee-id/subcommittees/subcommittee-id.json
get_recent_official_communications_by_chamber( congress, chamber, page = 1, myAPI_Key )
get_recent_official_communications_by_chamber( congress, chamber, page = 1, myAPI_Key )
congress |
114-116 for House, 96-116 for Senate |
chamber |
house or senate |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves the 20 most recent official communications to Congress for a specific chamber for the specified chamber, either house or senate.
## Not run: get_recent_official_communications_by_chamber(115, 'house') ## End(Not run)
## Not run: get_recent_official_communications_by_chamber(115, 'house') ## End(Not run)
o get lists of official communications to Congress on a specific date, use the following function. HTTP Request: GET https://api.propublica.org/congress/v1/congress/communications/category/category.json
get_recent_official_communications_by_date( year, month, day, page = 1, myAPI_Key )
get_recent_official_communications_by_date( year, month, day, page = 1, myAPI_Key )
year |
yyyy format |
month |
mm format |
day |
dd format |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves the 20 most recent results for the specified type: ec (Executive Communication), pm (Presidential Message) or pom (Petition or Memorial).
## Not run: get_recent_official_communications_by_date(2018, '03', '21') ## End(Not run)
## Not run: get_recent_official_communications_by_date(2018, '03', '21') ## End(Not run)
Lawmakers, mostly in the House but also in the Senate, can make personal explanations for missed or mistaken votes in the Congressional Record. These explanations can refer to a single vote or to multiple votes. To get lists of personal explanations, use the following URI structure. HTTP Request: GET https://api.propublica.org/congress/v1/congress/explanations.json
get_recent_personal_explanations(congress, page = 1, myAPI_Key)
get_recent_personal_explanations(congress, page = 1, myAPI_Key)
congress |
101-116 |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves the 20 most recent results in the specified Congress
## Not run: get_recent_personal_explanations(114) ## End(Not run)
## Not run: get_recent_personal_explanations(114) ## End(Not run)
Lawmakers, mostly in the House but also in the Senate, can make personal explanations for missed or mistaken votes in the Congressional Record. HTTP Request: GET https://api.propublica.org/congress/v1/members/member_id/explanations/congress.json
get_recent_personal_explanations_specific_member( member_id, congress, page = 1, myAPI_Key )
get_recent_personal_explanations_specific_member( member_id, congress, page = 1, myAPI_Key )
member_id |
The ID of the member to retrieve; it is assigned by the Biographical Directory of the United States Congress or can be retrieved from a member list request. |
congress |
110-116 |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves the 20 most recent personal explanations by a specific member in the specified Congress, and supports paginated requests using multiples of 20.
## Not run: get_recent_personal_explanations_specific_member('S001193', 115) ## End(Not run)
## Not run: get_recent_personal_explanations_specific_member('S001193', 115) ## End(Not run)
Lawmakers, mostly in the House but also in the Senate, can make personal explanations for missed or mistaken votes in the Congressional Record. Unlike the “Recent Personal Explanations” response, this response contains explanations parsed to individual votes and have an additional category attribute describing the general reason for the absence or incorrect vote. To get lists of recent personal explanation votes, use the following URI structure. HTTP Request: GET https://api.propublica.org/congress/v1/congress/explanations/votes.json
get_recent_personal_explanations_votes(congress, page = 1, myAPI_Key)
get_recent_personal_explanations_votes(congress, page = 1, myAPI_Key)
congress |
101-116 |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves the 20 most recent personal explanation votes in the specified Congress, contains explanations parsed to individual votes and have an additional category attribute describing the general reason for the absence or incorrect vote.
## Not run: get_recent_personal_explanations_votes(114) ## End(Not run)
## Not run: get_recent_personal_explanations_votes(114) ## End(Not run)
Lawmakers, mostly in the House but also in the Senate, can make personal explanations for missed or mistaken votes in the Congressional Record. Unlike the “Recent Personal Explanations” response, this response contains explanations parsed to individual votes and have an additional category attribute describing the general reason for the absence or incorrect vote. HTTP Request: GET https://api.propublica.org/congress/v1/congress/explanations/votes/category.json
get_recent_personal_explanations_votes_by_category( congress, category, page = 1, myAPI_Key )
get_recent_personal_explanations_votes_by_category( congress, category, page = 1, myAPI_Key )
congress |
101-116 |
category |
options: voted-incorrectly ( Voted yes or no by mistake), official-business (Away on official congressional business), ambiguous (No reason given), travel-difficulties ( Travel delays and issues), personal (Personal or family reason), claims-voted (Vote made but not recorded), medical ( Medical issue for lawmaker, not family), weather, memorial, misunderstanding, leave-of-absence, prior-commitment, election-related, military-service, other |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves the 20 most recent personal explanation votes filtered by a category in the specified Congress.
## Not run: get_recent_personal_explanations_votes_by_category(115, 'voted-incorrectly') ## End(Not run)
## Not run: get_recent_personal_explanations_votes_by_category(115, 'voted-incorrectly') ## End(Not run)
Lawmakers, mostly in the House but also in the Senate, can make personal explanations for missed or mistaken votes in the Congressional Record. To get recent personal explanations by a specific member that are parsed to individual votes and have an additional category attribute describing the general reason for the absence or incorrect vote, use the following function. HTTP Request: GET https://api.propublica.org/congress/v1/members/member_id/explanations/congress/votes.json
get_recent_personal_explanations_votes_specific_member( member_id, congress, page = 1, myAPI_Key )
get_recent_personal_explanations_votes_specific_member( member_id, congress, page = 1, myAPI_Key )
member_id |
The ID of the member to retrieve; it is assigned by the Biographical Directory of the United States Congress or can be retrieved from a member list request. |
congress |
110-116 |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves the 20 most recent personal explanations by a specific member in the specified Congress, and supports paginated requests using multiples of 20.
## Not run: get_recent_personal_explanations_votes_specific_member('S001193', 115) ## End(Not run)
## Not run: get_recent_personal_explanations_votes_specific_member('S001193', 115) ## End(Not run)
Lawmakers, mostly in the House but also in the Senate, can make personal explanations for missed or mistaken votes in the Congressional Record. To get recent personal explanations by a specific member that are parsed to individual votes and have an additional category attribute describing the general reason for the absence or incorrect vote, use the following function. HTTP Request: GET https://api.propublica.org/congress/v1/members/member_id/explanations/congress/votes.json
get_recent_personal_explanations_votes_specific_member_by_category( member_id, congress, category, page = 1, myAPI_Key )
get_recent_personal_explanations_votes_specific_member_by_category( member_id, congress, category, page = 1, myAPI_Key )
member_id |
The ID of the member to retrieve; it is assigned by the Biographical Directory of the United States Congress or can be retrieved from a member list request. |
congress |
110-116 |
category |
options: voted-incorrectly ( Voted yes or no by mistake), official-business (Away on official congressional business), ambiguous (No reason given), travel-difficulties ( Travel delays and issues), personal (Personal or family reason), claims-voted (Vote made but not recorded), medical ( Medical issue for lawmaker, not family), weather, memorial, misunderstanding, leave-of-absence, prior-commitment, election-related, military-service, other |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves the 20 most recent personal explanations by a specific member in the specified Congress, and supports paginated requests using multiples of 20.
## Not run: get_recent_personal_explanations_votes_specific_member_by_category('S001193', 115, 'personal') ## End(Not run)
## Not run: get_recent_personal_explanations_votes_specific_member_by_category('S001193', 115, 'personal') ## End(Not run)
You can get recent votes from the House, Senate or both chambers using this request. This request returns the 20 most recent results, sorted by date and roll call number, and you can paginate through votes using the offset querystring parameter that accepts multiples of 20. HTTP Request: GET https://api.propublica.org/congress/v1/chamber/votes/recent.json
get_recent_votes(chamber, page = 1, myAPI_Key)
get_recent_votes(chamber, page = 1, myAPI_Key)
chamber |
house, senate or both. |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves the 20 most recent votes from the House, Senate or both chambers
## Not run: get_recent_votes('senate') ## End(Not run)
## Not run: get_recent_votes('senate') ## End(Not run)
HTTP Request: GET https://api.propublica.org/campaign-finance/v1/cycle/committees/superpacs
get_recently_added_independent_expenditure_committees( cycle = 2018, page = 1, myAPI_Key )
get_recently_added_independent_expenditure_committees( cycle = 2018, page = 1, myAPI_Key )
cycle |
The election cycle |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves the 20 most recently added FEC independent expenditure-only committees, known as “super PACs”.
## Not run: get_recently_added_independent_expenditure_committees(2016) ## End(Not run)
## Not run: get_recently_added_independent_expenditure_committees(2016) ## End(Not run)
Get Top 20 Candidates in Specific Financial Category
HTTP Request: GET https://api.propublica.org/campaign-finance/v1/cycle/candidates/new (https://www.propublica.org/datastore/apis)
get_recently_candidates(cycle = 2018, page = 1, myAPI_Key)
get_recently_candidates(cycle = 2018, page = 1, myAPI_Key)
cycle |
The election cycle: Four-digit even-numbered year between 2010 and 2018 |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of the most recently added FEC candidates for a given campaign cycle from the campaign-finance API from ProPublica.
## Not run: get_recently_candidates(2016) ## End(Not run)
## Not run: get_recently_candidates(2016) ## End(Not run)
HTTP Request: GET https://api.propublica.org/campaign-finance/v1/cycle/committees/new
get_recently_committees(cycle = 2018, page = 1, myAPI_Key)
get_recently_committees(cycle = 2018, page = 1, myAPI_Key)
cycle |
The election cycle |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves the 20 most recently added FEC committees from the campaign-finance API from ProPublica.
## Not run: get_recently_committees(2016) ## End(Not run)
## Not run: get_recently_committees(2016) ## End(Not run)
To get Senate votes on presidential nominations. HTTP Request: GET https://api.propublica.org/congress/v1/congress/nominations.json
get_senate_nomination_votes(congress, page = 1, myAPI_Key)
get_senate_nomination_votes(congress, page = 1, myAPI_Key)
congress |
101-116 |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves Senate votes on presidential nominations
## Not run: get_senate_nomination_votes(114) ## End(Not run)
## Not run: get_senate_nomination_votes(114) ## End(Not run)
The attributes house_passage_vote and senate_passage_vote are populated (with the date of passage) only upon successful passage of the bill. Bills before the 113th Congress (prior to 2013) have fewer attribute values than those from the 113th Congress onward, because the more recent bill data comes from the bulk data provided by the Government Publishing Office. Details for the older bills came from scraping Thomas.gov, the former congressional site of the Library of Congress. HTTP Request: GET https://api.propublica.org/congress/v1/congress/bills/bill-id.json
get_specific_bill(congress, bill_id, page = 1, myAPI_Key)
get_specific_bill(congress, bill_id, page = 1, myAPI_Key)
congress |
105-116 |
bill_id |
a bill slug, for example hr4881 - these can be found in the recent bill response. |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves details about a particular bill, including actions taken and votes
## Not run: get_specific_bill(115, 'hr21') ## End(Not run)
## Not run: get_specific_bill(115, 'hr21') ## End(Not run)
Use this request type to search for bill subjects that contain a specified term. HTTP Request: GET https://api.propublica.org/congress/v1/bills/subjects/search.json
get_specific_bill_subject(subject, page = 1, myAPI_Key)
get_specific_bill_subject(subject, page = 1, myAPI_Key)
subject |
a word or phrase to search |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves bill subjects that contain a specified term.
## Not run: get_specific_bill_subject('meat') ## End(Not run)
## Not run: get_specific_bill_subject('meat') ## End(Not run)
To get information about a single Senate or House committee, including the members of that committee, use the following function. The committee ids can be found in the committee list responses. HTTP Request: GET https://api.propublica.org/congress/v1/congress/chamber/committees/committee-id.json
get_specific_committee(congress, chamber, committee_id, page = 1, myAPI_Key)
get_specific_committee(congress, chamber, committee_id, page = 1, myAPI_Key)
congress |
110-116 |
chamber |
house, senate or joint |
committee_id |
Committee abbreviation, for example HSAG. Use the full committees response to find abbreviations. |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves the 20 most recent results and supports pagination using multiples of 20.
## Not run: get_specific_committee(115, "senate", lists_of_committees(115, "senate")$results[[1]]$committees[[1]]$id) get_specific_committee(115, "senate", "SSAF") ## End(Not run)
## Not run: get_specific_committee(115, "senate", lists_of_committees(115, "senate")$results[[1]]$committees[[1]]$id) get_specific_committee(115, "senate", "SSAF") ## End(Not run)
To get a specific lobbying representation filing, use the following function. HTTP Request: GET https://api.propublica.org/congress/v1/lobbying/id.json
get_specific_lobbying_representation_filings(id, page = 1, myAPI_Key)
get_specific_lobbying_representation_filings(id, page = 1, myAPI_Key)
id |
numeric id attribute from search or latest responses |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves
## Not run: get_specific_lobbying_representation_filings('300986302') ## End(Not run)
## Not run: get_specific_lobbying_representation_filings('300986302') ## End(Not run)
To get details about a particular presidential civilian nomination,, use the following function. HTTP Request: GET https://api.propublica.org/congress/v1/congress/nominees/nominee-id.json
get_specific_nominations(congress, nominee_id, page = 1, myAPI_Key)
get_specific_nominations(congress, nominee_id, page = 1, myAPI_Key)
congress |
107-116 |
nominee_id |
alphanumeric ID beginning with PN - for example, PN675 |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves
## Not run: get_specific_nominations(115, 'PN40') ## End(Not run)
## Not run: get_specific_nominations(115, 'PN40') ## End(Not run)
To get a specific roll-call vote, including a complete list of member positions. HTTP Request: GET https://api.propublica.org/congress/v1/congress/chamber/sessions/session-number/votes/roll-call-number.json
get_specific_roll_call_vote( congress, chamber = c("house", "senate"), session_number, roll_call_number, page = 1, myAPI_Key )
get_specific_roll_call_vote( congress, chamber = c("house", "senate"), session_number, roll_call_number, page = 1, myAPI_Key )
congress |
102-116 for House, 80-116 for Senate |
chamber |
house or senate |
session_number |
1 or 2, depending on year (1 is odd-numbered years, 2 is even-numbered years) passed (latest_major_action_date), enacted (enacted), vetoed (vetoed). |
roll_call_number |
integer |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves a specific roll-call vote s
## Not run: get_specific_roll_call_vote(115, 'senate', 1, 17L) ## End(Not run)
## Not run: get_specific_roll_call_vote(115, 'senate', 1, 17L) ## End(Not run)
To get information about a single Senate or House subcommittee, including the members of that subcommittee, use the following function. HTTP Request: GET https://api.propublica.org/congress/v1/congress/chamber/committees/committee-id/subcommittees/subcommittee-id.json
get_specific_subcommittee( congress, chamber, committee_id, subcommittee_id, page = 1, myAPI_Key )
get_specific_subcommittee( congress, chamber, committee_id, subcommittee_id, page = 1, myAPI_Key )
congress |
114-116 |
chamber |
house or senate or joint |
committee_id |
Optional committee abbreviation, for example HSAG. Use the full committees response to find abbreviations. |
subcommittee_id |
Optional sub-committee abbreviation, for example HSAG. Use the full committees response to find abbreviations. |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves the 20 most recent hearings and supports pagination.
## Not run: get_specific_subcommittee(115, 'house', 'HSAS', 'HSAS28') get_specific_subcommittee(115, 'house', lists_of_committees(115, "senate")$results[[1]]$committees[[2]]$id, lists_of_committees(115, "senate")$results[[1]]$committees[[2]]$subcommittees[[1]]$id) ## End(Not run)
## Not run: get_specific_subcommittee(115, 'house', 'HSAS', 'HSAS28') get_specific_subcommittee(115, 'house', lists_of_committees(115, "senate")$results[[1]]$committees[[2]]$id, lists_of_committees(115, "senate")$results[[1]]$committees[[2]]$subcommittees[[1]]$id) ## End(Not run)
To get party membership counts for all states (current Congress only), use the following function. HTTP Request: GET https://api.propublica.org/congress/v1/states/members/party.json
get_state_party_counts(page = 1, myAPI_Key)
get_state_party_counts(page = 1, myAPI_Key)
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves
## Not run: get_state_party_counts() ## End(Not run)
## Not run: get_state_party_counts() ## End(Not run)
Get lists of subjects used to categorize congressional statements, use the following function. These subjects are not automatically assigned but are manually curated by ProPublica, although they are based on legislative subjects produced by the Library of Congress.
get_statement_subjects(page = 1, myAPI_Key)
get_statement_subjects(page = 1, myAPI_Key)
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves all of the subjects that have been used at least once.
## Not run: get_statement_subjects() ## End(Not run)
## Not run: get_statement_subjects() ## End(Not run)
HTTP Request: GET https://api.propublica.org/congress/v1/congress/bills/bill-id/subjects.json. Use this request type to get Library of Congress-assigned subjects about a particular bill.
get_subjects_for_bill(congress, bill_id, page = 1, myAPI_Key)
get_subjects_for_bill(congress, bill_id, page = 1, myAPI_Key)
congress |
105-116 |
bill_id |
a bill slug, for example hr4881 - these can be found in the recent bill response. |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves the 20 most recent results and supports paginated requests.
## Not run: get_subjects_for_bill(115, 'hr1628') ## End(Not run)
## Not run: get_subjects_for_bill(115, 'hr1628') ## End(Not run)
https://www.propublica.org/datastore/apis HTTP Request: GET https://api.propublica.org/campaign-finance/v1/cycle/candidates/leaders/category
get_top20_candidate_of_FinancialCategory( category, cycle = 2018, page = 1, myAPI_Key )
get_top20_candidate_of_FinancialCategory( category, cycle = 2018, page = 1, myAPI_Key )
category |
One of the values from the following categories:'candidate-loan', 'contribution-total', 'debts-owed', 'disbursements-total', 'end-cash', 'individual-total', 'pac-total', 'receipts-total' and 'refund-total'. |
cycle |
The election cycle |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves a specific FEC candidate for a given campaign cycle.
## Not run: get_top20_candidate_of_FinancialCategory('pac-total', 2016) ## End(Not run)
## Not run: get_top20_candidate_of_FinancialCategory('pac-total', 2016) ## End(Not run)
The responses include a legislative_day attribute which is the earliest the bills could be considered and a range attribute that indicates whether the bill information comes from a weekly schedule or a daily one. Combine the two for the best sense of when a bill might come up for consideration. For Senate bills, the response includes a context attribute reproducing the sentence that includes mention of the bill. These responses omit bills that have not yet been assigned a bill number or introduced, and additional bills may be considered at any time. HTTP Request: GET https://api.propublica.org/congress/v1/bills/upcoming/chamber.json
get_upcoming_bills(chamber, page = 1, myAPI_Key)
get_upcoming_bills(chamber, page = 1, myAPI_Key)
chamber |
house or senate. |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves details on bills that may be considered by the House or Senate in the near future, based on scheduled published or announced by congressional leadership.
## Not run: get_upcoming_bills('senate') ## End(Not run)
## Not run: get_upcoming_bills('senate') ## End(Not run)
HTTP Requests: GET https://api.propublica.org/congress/v1/chamber/votes/year/month.json
get_votes_by_date( chamber = c("house", "senate"), year, month, page = 1, myAPI_Key )
get_votes_by_date( chamber = c("house", "senate"), year, month, page = 1, myAPI_Key )
chamber |
house or senate |
year |
YYYY format |
month |
MM format |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves all votes for one or both chambers in a particular month s
## Not run: get_votes_by_date('house', 2018, '09') ## End(Not run)
## Not run: get_votes_by_date('house', 2018, '09') ## End(Not run)
HTTP Requests: GET https://api.propublica.org/congress/v1/chamber/votes/start-date/end-date.json
get_votes_by_date_range( chamber = c("house", "senate"), start_date, end_date, page = 1, myAPI_Key )
get_votes_by_date_range( chamber = c("house", "senate"), start_date, end_date, page = 1, myAPI_Key )
chamber |
house or senate |
start_date |
YYYY-MM-DD format |
end_date |
YYYY-MM-DD format |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves all votes in a particular date range (fewer than 30 days) s
## Not run: get_votes_by_date_range('house', '2017-01-03', '2017-01-31') ## End(Not run)
## Not run: get_votes_by_date_range('house', '2017-01-03', '2017-01-31') ## End(Not run)
You can get vote information in four categories: missed votes, party votes, lone no votes and perfect votes. Missed votes provides information about the voting attendance of each member of a specific chamber and congress. Party votes provides information about how often each member of a specific chamber and congress votes with a majority of his or her party. Lone no votes provides information lists members in a specific chamber and congress who were the only members to vote No on a roll call vote, and how often that happened. Perfect votes lists members in a specific chamber and congress who voted Yes or No on every vote for which he or she was eligible. HTTP Request: GET https://api.propublica.org/congress/v1/congress/chamber/votes/vote-type.json
get_votes_by_type( congress, chamber = c("house", "senate"), vote_type, page = 1, myAPI_Key )
get_votes_by_type( congress, chamber = c("house", "senate"), vote_type, page = 1, myAPI_Key )
congress |
102-116 for House, 80-116 for Senate |
chamber |
house or senate |
vote_type |
missed, party, loneno or perfect |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves a types of votes of each member of a specific chamber and congress. s
## Not run: get_votes_by_type(114, 'house', 'missed') ## End(Not run)
## Not run: get_votes_by_type(114, 'house', 'missed') ## End(Not run)
The results include all members who have served in that congress and chamber, including members who are no longer in office. HTTP Request: GET https://api.propublica.org/congress/v1/congress/chamber/members.json
list_members_chamber_congress(congress, chamber, page = 1, myAPI_Key)
list_members_chamber_congress(congress, chamber, page = 1, myAPI_Key)
congress |
102-118 for House, 80-118 for Senate |
chamber |
house or senate |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
list of members of a particular chamber in a particular Congress
## Not run: list_members_chamber_congress(115, 'senate') ## End(Not run)
## Not run: list_members_chamber_congress(115, 'senate') ## End(Not run)
To get a list of Senate, House or joint committees, including their subcommittees, use the following function. HTTP Request: GET https://api.propublica.org/congress/v1/congress/chamber/committees.json
lists_of_committees(congress, chamber, page = 1, myAPI_Key)
lists_of_committees(congress, chamber, page = 1, myAPI_Key)
congress |
110-116 |
chamber |
house, senate or joint |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves the 20 most recent results and supports pagination using multiples of 20.
## Not run: lists_of_committees(115, "senate") ## End(Not run)
## Not run: lists_of_committees(115, "senate") ## End(Not run)
The function attempts to convert the result of a ProPublica API call to a data.frame. If the result of the API call contains various parts, the which_part parameter can be used to specify for which of these the conversion is required. Typically the 'payload' resides in the 'results' field, which is the default, but occasionally the summary and meta fields might be of interest.
pp_convert_to_data_frame(what, which_part = c("result", "summary", "meta"))
pp_convert_to_data_frame(what, which_part = c("result", "summary", "meta"))
what |
Return value from one of the get_ functions. |
which_part |
Which part are we converting. Defaults to 'results', but 'summary' and 'meta' may be useful in some cases. |
The function also replaces . (dot) with _ (underscore) in column names for compatibility with database inserts (e.g. DBI::dbWriteTable)
a data.frame
## Not run: tmp <- get_candidates_in_race('MI','house',11) pp_convert_to_data_frame(tmp) pp_convert_to_data_frame(tmp,'summary') ## End(Not run)
## Not run: tmp <- get_candidates_in_race('MI','house',11) pp_convert_to_data_frame(tmp) pp_convert_to_data_frame(tmp,'summary') ## End(Not run)
This function is primarily meant to be used by other functions in the package, but is made available in case a "raw query" is required.
pp_query( query, API = c("campaign-finance", "congress"), version = "v1", page = 1, myAPI_Key )
pp_query( query, API = c("campaign-finance", "congress"), version = "v1", page = 1, myAPI_Key )
query |
The query to be executed |
API |
Which API are you accessing |
version |
API version. Currently v1. |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
a list object with the return values.
## Not run: pp_query('115/bills/hr21.json', API = 'congress', version='v1') pp_query('2018/races/MI/house/11.json', API='campaign-finance',version='v1') ## End(Not run)
## Not run: pp_query('115/bills/hr21.json', API = 'congress', version='v1') pp_query('2018/races/MI/house/11.json', API='campaign-finance',version='v1') ## End(Not run)
Use this request type to get the 20 bills most recently introduced or updated by a particular member. Results can include more than one Congress. HTTP Request: GET https://api.propublica.org/congress/v1/members/member-id/bills/type.json
recent_bills_by_member(member_id, type, page = 1, myAPI_Key)
recent_bills_by_member(member_id, type, page = 1, myAPI_Key)
member_id |
member-id The ID of the member to retrieve; it is assigned by the Biographical Directory of the United States Congress or can be retrieved from a member list request. |
type |
introduced or updated |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
the 20 bills most recently introduced or updated by a particular member. Results can include more than one Congress.
## Not run: recent_bills_by_member('L000287', 'introduced') ## End(Not run)
## Not run: recent_bills_by_member('L000287', 'introduced') ## End(Not run)
Use this request type to get the 20 most recently updated bills for a specific legislative subject. Results can include more than one Congress. HTTP Request: GET https://api.propublica.org/congress/v1/bills/subjects/subject.json
recent_bills_by_subject(subject, page = 1, myAPI_Key)
recent_bills_by_subject(subject, page = 1, myAPI_Key)
subject |
A slug version of a legislative subject, displayed as url_name in subject responses. |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves the 20 most recently updated bills for a specific legislative subject.
## Not run: recent_bills_by_subject('meat') ## End(Not run)
## Not run: recent_bills_by_subject('meat') ## End(Not run)
For the current Congress, “recent bills” can be one of four types (see the descriptions below). For previous Congresses, “recent bills” means the last 20 bills of that Congress. In the responses, an active value of true means that the bill has seen action beyond introduction and committee referral. Requests include a chamber value; to get recent bills from the House and Senate, use both as the value. You can paginate through bills using the page-parameter that accepts multiples of 20. Bills before the 113th Congress (prior to 2013) have fewer attribute values than those from the 113th Congress onward, because the more recent bill data comes from the bulk data provided by the Government Publishing Office. The order of the results depends on the value of type and all results are sorted in descending order.
recent_bills_by_type( congress, chamber = c("house", "senate", "both"), type = c("introduced", "updated", "active", "passed", "enacted", "vetoed"), page = 1, myAPI_Key )
recent_bills_by_type( congress, chamber = c("house", "senate", "both"), type = c("introduced", "updated", "active", "passed", "enacted", "vetoed"), page = 1, myAPI_Key )
congress |
105-116 |
chamber |
house, senate or both |
type |
introduced (introduced_date), updated (latest_major_action_date), active (latest_major_action_date) passed (latest_major_action_date), enacted (enacted), vetoed (vetoed). |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
summaries of the 20 most recent bills by type. The order of the results depends on the value of type and all results are sorted in descending order.
## Not run: recent_bills_by_type(115, 'house', 'introduced') ## End(Not run)
## Not run: recent_bills_by_type(115, 'house', 'introduced') ## End(Not run)
This function is primarily meant to be used by pp_query to determine the API keys if not passed explicitly.
retrieve_key(API = c("congress", "campaign-finance"))
retrieve_key(API = c("congress", "campaign-finance"))
API |
Which API are you accessing |
the key from config.yml or global environment variables key_congress/key_campaign_finance
## Not run: retrieve_key('congress') retrieve_key('campaign-finance') ## End(Not run)
## Not run: retrieve_key('congress') retrieve_key('campaign-finance') ## End(Not run)
Returns recent lobbying representation filings for a given search term, in batches of twenty.
search_lobbying_representation_filings(query, page = 1, myAPI_Key)
search_lobbying_representation_filings(query, page = 1, myAPI_Key)
query |
keyword or phrase |
page |
Results come in batches of 20. The page parameter specifies which one to retrieve. |
myAPI_Key |
API key from Propublica To use the congress API, you must sign up for an API key. |
List of returned JSON from endpoint that retrieves
## Not run: search_lobbying_representation_filings('Facebook') ## End(Not run)
## Not run: search_lobbying_representation_filings('Facebook') ## End(Not run)
A dataset containing some information about US Congressional Districts
us_congressional_districts
us_congressional_districts
A data frame with 435 rows and 3 variables:
The district name
The state the district is in
Two letter state abbreviation
District number. Except for at-large districts.
...
Validate that year cycle is correct
validate_cycle(cycle)
validate_cycle(cycle)
cycle |
An election cycle (e.g. 2018) |
TRUE if correct FALSE otherwise
validate_cycle(1996)#TRUE validate_cycle(1979)#FALSE validate_cycle(16) #FALSE
validate_cycle(1996)#TRUE validate_cycle(1979)#FALSE validate_cycle(16) #FALSE
Validate that a district abbreviation is correct
validate_district(us_district)
validate_district(us_district)
us_district |
An integer corresponding to the district. |
TRUE if correct FALSE otherwise
## Not run: validate_district(1)#TRUE validate_district(111) #FALSE validate_district(us_congressional_districts$district[1]) #FALSE validate_district(as.numeric(us_congressional_districts$district_number[1])) #TRUE ## End(Not run)
## Not run: validate_district(1)#TRUE validate_district(111) #FALSE validate_district(us_congressional_districts$district[1]) #FALSE validate_district(as.numeric(us_congressional_districts$district_number[1])) #TRUE ## End(Not run)
Validate that a abbreviation is correct
validate_state(us_state)
validate_state(us_state)
us_state |
State abbreviation (e.g. NY) |
TRUE if correct FALSE otherwise