Type: | Package |
Title: | Access Functions for ProPublica's APIs |
Version: | 1.1.4 |
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. |
License: | GPL-3 | file LICENSE |
BugReports: | https://github.com/dietrichson/ProPublicaR/issues |
Depends: | R (≥ 3.1) |
Imports: | dplyr, stringr, httr, config, lubridate |
Suggests: | testthat, httptest, knitr |
Encoding: | UTF-8 |
LazyData: | true |
RoxygenNote: | 7.2.1 |
Collate: | 'a_get_new_members.R' 'bills_legislation_by_keyword.R' 'compare_two_member_bill_sponsorships.R' 'compare_two_member_vote_positions.R' 'data.R' 'get_a_bill.R' 'get_amendments_bill.R' 'get_bills_cosponsored_member.R' 'get_candidate.R' 'get_candidate_by_name.R' 'get_candidates_in_race.R' 'get_committee.R' 'get_committee_by_name.R' 'get_committee_electioneering_communications.R' 'get_committee_filings.R' 'get_committee_leadership.R' 'get_congress_member.R' 'get_congressional_statement_by_bill.R' 'get_congressional_statement_by_member.R' 'get_congressional_statement_by_subjects.R' 'get_cosponsors_specific_bill.R' 'get_current_members_by_statedistrict.R' 'get_electioneering_communications_by_date.R' 'get_electioneering_communications_committee.R' 'get_electronic_filing_byDate.R' 'get_electronic_filing_by_committees.R' 'get_electronic_filing_by_types.R' 'get_electronic_filing_form_types.R' 'get_hearing_specific_committee.R' 'get_house_senate_floor_actions_by_date.R' 'get_independent_expenditure_by_committee.R' 'get_independent_expenditure_by_date.R' 'get_independent_expenditure_office_totals.R' 'get_independent_expenditure_race_totals_committee.R' 'get_independent_expenditure_support_candidate.R' 'get_independent_expenditure_support_presidential_candidate.R' 'get_lobbyist_bundlers.R' 'get_member_vote_position.R' 'get_members_leaving.R' 'get_nominees_by_state.R' 'get_quarter_office_expenses_by_category_house_member.R' 'get_quarter_office_expenses_house_member.R' 'get_races_for_state.R' 'get_recent_amendments.R' 'get_recent_committee_hearing.R' 'get_recent_congressional_statements.R' 'get_recent_congressional_statements_by_date.R' 'get_recent_congressional_statements_by_term.R' 'get_recent_electioneering_communications.R' 'get_recent_house_senate_floor_actions.R' 'get_recent_independent_expend.R' 'get_recent_late_contributions.R' 'get_recent_late_contributions_candidate.R' 'get_recent_late_contributions_committee.R' 'get_recent_late_contributions_date.R' 'get_recent_lobbying_representation_filings.R' 'get_recent_nominations_by_category.R' 'get_recent_official_communications.R' 'get_recent_official_communications_by_category.R' 'get_recent_official_communications_by_chamber.R' 'get_recent_official_communications_by_date.R' 'get_recent_personal_explanations.R' 'get_recent_personal_explanations_specific_member.R' 'get_recent_personal_explanations_votes.R' 'get_recent_personal_explanations_votes_by_category.R' 'get_recent_personal_explanations_votes_specific_member.R' 'get_recent_personal_explanations_votes_specific_member_by_category.R' 'get_recent_votes.R' 'get_recently_added_independent_expenditure_committees.R' 'get_recently_candidates.R' 'get_recently_committees.R' 'get_related_bills.R' 'get_senate_nomination_votes.R' 'get_specific_bill.R' 'get_specific_bill_subject.R' 'get_specific_committee.R' 'get_specific_lobbying_representation_filings.R' 'get_specific_nominations.R' 'get_specific_roll_call_vote.R' 'get_specific_subcommittee.R' 'get_state_party_counts.R' 'get_statement_subjects.R' 'get_subjects_for_bill.R' 'get_top20_candidate_of_FinancialCategory.R' 'get_upcoming_bills.R' 'get_votes_by_date.R' 'get_votes_by_date_range.R' 'get_votes_by_type.R' 'list_members_chamber_congress.R' 'lists_of_committees.R' 'pp_convert_to_data_frame.R' 'pp_query.R' 'recent_bills_by_member.R' 'recent_bills_by_subject.R' 'recent_bills_by_type.R' 'retrieve_key.R' 'search_lobbying_representation_filings.R' 'validate_cycle.R' 'validate_district.R' 'validate_state.R' 'zzz.R' |
NeedsCompilation: | no |
Packaged: | 2023-09-06 17:09:29 UTC; r227303 |
Author: | Aleksander Dietrichson [aut, cre], Joselina Davit [aut] |
Maintainer: | Aleksander Dietrichson <dietrichson@gmail.com> |
Repository: | CRAN |
Date/Publication: | 2023-09-06 17:20:02 UTC |
Search Bills: to search the title and full text of legislation by keyword to get the 20 most recent bills
Description
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.
Usage
bills_legislation_by_keyword(
query_keyword,
sort = c("date", "_score"),
dir = c("desc", "asc"),
page = 1,
myAPI_Key
)
Arguments
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. |
Value
a list object with the return values about title and full text of legislation by keyword
Examples
## Not run:
bills_legislation_by_keyword(query_keyword = 'megahertz')
## End(Not run)
Compare Two Members’ Bill Sponsorships
Description
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
Usage
compare_two_member_bill_sponsorships(
first_member_id,
second_member_id,
congress,
chamber,
page = 1,
myAPI_Key
)
Arguments
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. |
Value
List of bill sponsorship comparison between two members who served in the same Congress and chamber
Examples
## Not run:
compare_two_member_bill_sponsorships('G000575', 'D000624', '114', 'house')
## End(Not run)
Compare Two Members Vote Positions
Description
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
Usage
compare_two_member_vote_positions(
first_member_id,
second_member_id,
congress,
chamber,
page = 1,
myAPI_Key
)
Arguments
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. |
Value
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
Examples
## Not run:
compare_two_member_vote_positions('G000575', 'D000624', '114', 'house')
## End(Not run)
Get a Specific Bill
Description
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.
Usage
get_a_bill(congress, bill_id, page = 1, myAPI_Key)
Arguments
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. |
Details
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.
Value
List with the result of the query
Examples
## Not run:
get_a_bill(115, 'hr21')
## End(Not run)
Get Amendments for a Specific Bill
Description
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.
Usage
get_amendments_bill(congress, bill_id, page = 1, myAPI_Key)
Arguments
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. |
Value
List of returned JSON from endpoint that retrieves the 20 most recent results and supports paginated requests.
Examples
## Not run:
get_amendments_bill(115, 'hr1628')
## End(Not run)
Get Bills Cosponsored by a Specific Member
Description
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
Usage
get_bills_cosponsored_member(
member_id,
type = c("cosponsored", "withdrawn"),
page = 1,
myAPI_Key
)
Arguments
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. |
Value
List of returned JSON from endpoint that retrieves the 20 most recent bill cosponsorships for a particular member
Examples
## 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
Description
Get Candidate Info https://www.propublica.org/datastore/apis GET https://api.propublica.org/campaign-finance/v1/cycle/candidates/fec-id
Usage
get_candidate(FEC_ID, cycle = 2018, page = 1, myAPI_Key)
Arguments
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. |
Value
a list object with the return values about candidate basic information
Examples
## Not run:
get_candidate('P60005915', 2016)
## End(Not run)
Get Candidate Info
Description
https://www.propublica.org/datastore/apis HTTP Request: GET https://api.propublica.org/campaign-finance/v1/cycle/candidates/search
Usage
get_candidate_by_name(NAME, cycle = 2018, page = 1, myAPI_Key)
Arguments
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. |
Value
List of returned JSON from endpoint that retrieves federal candidates by last name, using a query string parameter.
Examples
## Not run:
get_candidate_by_name('Wilson', 2016)
## End(Not run)
Get Candidates in Race
Description
Get Candidates in Race
Usage
get_candidates_in_race(
state,
chamber,
district,
cycle = 2018,
return_value = c("results", "query"),
page = 1,
myAPI_Key
)
Arguments
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. |
Value
The result of the API call (list), unless return_value=query
(mostly for debugging), in which case the query string is returned.
Examples
## 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
Description
Get Committee Info HTTP Request: GET https://api.propublica.org/campaign-finance/v1/cycle/committees/fec-id
Usage
get_committee(FEC_ID, cycle = 2018, page = 1, myAPI_Key)
Arguments
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. |
Value
List of returned JSON from endpoint that retrieves ca specific FEC committee for a given campaign cycle from the campaign-finance API from ProPublica.
Examples
## Not run:
get_committee('C00553560', 2016)
## End(Not run)
Get Committee by name
Description
HTTP Request: GET https://api.propublica.org/campaign-finance/v1/cycle/committees/search
Usage
get_committee_by_name(NAME, cycle = 2018, page = 1, myAPI_Key)
Arguments
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. |
Value
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.
Examples
## Not run:
get_committee_by_name('Americans FOR A BETTER TOMORROW TODAY', 2016)
## End(Not run)
Get Electioneering Communications by Specific Committee
Description
HTTP Request: GET https://api.propublica.org/campaign-finance/v1/cycle/committees/fec-id/electioneering_communications
Usage
get_committee_electioneering_communications(
cycle = 2018,
FEC_ID,
page = 1,
myAPI_Key
)
Arguments
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. |
Value
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.
Examples
## Not run:
get_committee_electioneering_communications(2016, 'C30002034')
## End(Not run)
Get Committee Filings
Description
HTTP Request GET https://api.propublica.org/campaign-finance/v1/cycle/committees/fec-id/filings
Usage
get_committee_filings(FEC_ID, cycle = 2018, page = 1, myAPI_Key)
Arguments
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. |
Value
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.
Examples
## Not run:
get_committee_filings('C00553560', 2016)
## End(Not run)
Get Leadership Committees
Description
HTTP Request: GET https://api.propublica.org/campaign-finance/v1/cycle/committees/leadership
Usage
get_committee_leadership(cycle = 2018, page = 1, myAPI_Key)
Arguments
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. |
Value
List of returned JSON from endpoint that retrieves committees designated as “leadership PACs” by the FEC from the campaign-finance API from ProPublica.
Examples
## Not run:
get_committee_leadership(2016)
## End(Not run)
Get a Specific Member
Description
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
Usage
get_congress_member(member_id, page = 1, myAPI_Key)
Arguments
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. |
Value
List of returned JSON from endpoint that retrieves biographical and Congressional role information for a particular member of Congress
Examples
## Not run:
get_congress_member('K000388')
## End(Not run)
Get Congressional Statements by Bill
Description
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
Usage
get_congressional_statement_by_bill(congress, bill_id, page = 1, myAPI_Key)
Arguments
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. |
Value
List of returned JSON from endpoint that retrieves the 20 most recent results and supports pagination using multiples of 20.
Examples
## Not run:
get_congressional_statement_by_bill(115, 's19')
## End(Not run)
Get Congressional Statements by Member
Description
Get lists of statements published on a specific member’s congressional website during a particular congress, use the following function.
Usage
get_congressional_statement_by_member(member_id, congress, page = 1, myAPI_Key)
Arguments
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. |
Value
List of returned JSON from endpoint that retrieves the 20 most recent results and supports pagination using multiples of 20.
Examples
## Not run:
get_congressional_statement_by_member("C001084", 115)
## End(Not run)
Get Congressional Statements by Subject
Description
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
Usage
get_congressional_statement_by_subjects(subject, page = 1, myAPI_Key)
Arguments
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. |
Value
List of returned JSON from endpoint that retrieves the 20 most recent results and supports pagination using multiples of 20.
Examples
## 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)
Get Cosponsors for a Specific Bill
Description
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.
Usage
get_cosponsors_specific_bill(congress, bill_id, page = 1, myAPI_Key)
Arguments
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. |
Value
List of returned JSON from endpoint that retrieves information about the cosponsors of a particular bill
Examples
## Not run:
get_cosponsors_specific_bill(114, 'hr4249')
## End(Not run)
Get Current Members by State/District
Description
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
Usage
get_current_members_by_statedistrict(
state,
chamber,
district,
page = 1,
myAPI_Key
)
Arguments
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. |
Value
List of returned JSON from endpoint that retrieves biographical and Congressional role information for a particular member of Congress by State/District
Examples
## Not run:
get_current_members_by_statedistrict( 'MI', 'house', 11)
get_current_members_by_statedistrict( 'RI', 'senate')
## End(Not run)
Get Electioneering Communications by Date
Description
HTTP Request: GET https://api.propublica.org/campaign-finance/v1/cycle/electioneering_communications/year/month/day
Usage
get_electioneering_communications_by_date(
cycle = 2018,
year,
month,
day,
page = 1,
myAPI_Key
)
Arguments
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. |
Value
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.
Examples
## Not run:
get_electioneering_communications_by_date(2016, 2012, '10', '01')
## End(Not run)
Get Electioneering Communications by Specific Committee
Description
HTTP Request: GET https://api.propublica.org/campaign-finance/v1/cycle/committees/fec-id/electioneering_communications
Usage
get_electioneering_communications_committee(
cycle = 2018,
FEC_ID,
page = 1,
myAPI_Key
)
Arguments
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. |
Value
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).
Examples
## Not run:
get_electioneering_communications_committee(2016, 'C30002034')
## End(Not run)
Get Electronic Filings by Date
Description
HTTP Request: GET https://api.propublica.org/campaign-finance/v1/cycle/filings/year/month/day
Usage
get_electronic_filing_byDate(
cycle = 2018,
year,
month,
day,
page = 1,
myAPI_Key
)
Arguments
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. |
Value
List of returned JSON from endpoint that retrieves information about FEC reports filed electronically on a specific date.
Examples
## Not run:
get_electronic_filing_byDate(2016, 2016, '01', '10')
## End(Not run)
Search for Electronic Filings by committee name o partial name
Description
HTTP Request: GET https://api.propublica.org/campaign-finance/v1/cycle/filings/search
Usage
get_electronic_filing_by_committees(NAME, cycle = 2018, page = 1, myAPI_Key)
Arguments
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. |
Value
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.
Examples
## Not run:
get_electronic_filing_by_committees(NAME = "UNITED EGG", 2016)
## End(Not run)
Get Electronic Filings By Type
Description
HTTP Request: GET https://api.propublica.org/campaign-finance/v1/cycle/filings/types/form-type-id
Usage
get_electronic_filing_by_types(cycle = 2018, form_type_id, page = 1, myAPI_Key)
Arguments
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. |
Value
List of returned JSON from endpoint that retrieves a list of available form types for FEC electronic filings.
Examples
## 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)
Get Electronic Filing Form Types
Description
HTTP Request: GET https://api.propublica.org/campaign-finance/v1/cycle/filings/types
Usage
get_electronic_filing_form_types(cycle = 2018, page = 1, myAPI_Key)
Arguments
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. |
Value
List of returned JSON from endpoint that retrieves a list of available form types for FEC electronic filings.
Examples
## Not run:
get_electronic_filing_form_types(2016)
## End(Not run)
Get Hearings for a Specific Committee
Description
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
Usage
get_hearing_specific_committee(
congress,
chamber,
committee_id,
page = 1,
myAPI_Key
)
Arguments
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. |
Value
List of returned JSON from endpoint that retrieves the 20 most recent hearings and supports pagination.
Examples
## 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)
Get House and Senate Floor Actions by Date
Description
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
Usage
get_house_senate_floor_actions_by_date(
chamber,
year,
month,
day,
page = 1,
myAPI_Key
)
Arguments
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. |
Value
List of returned JSON from endpoint that retrieves the 20 most recent results for that date and supports pagination using multiples of 20.
Examples
## Not run:
get_house_senate_floor_actions_by_date('senate', 2017, '05', '02')
## End(Not run)
Get Independent Expenditures by Specific Committee
Description
#HTTP Request: GET https://api.propublica.org/campaign-finance/v1/cycle/committees/fec-id/independent_expenditures
Usage
get_independent_expenditure_by_committee(
cycle = 2018,
FEC_ID,
page = 1,
myAPI_Key
)
Arguments
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. |
Value
List of returned JSON from endpoint that retrieves the 20 most recent independent expenditures by a given committee.
Examples
## Not run:
get_independent_expenditure_by_committee(2016, FEC_ID ='C00575423')
## End(Not run)
Get Independent Expenditures by Date
Description
HTTP Request: GET https://api.propublica.org/campaign-finance/v1/cycle/independent_expenditures/year/month/day
Usage
get_independent_expenditure_by_date(
cycle = 2018,
year,
month,
day,
page = 1,
myAPI_Key
)
Arguments
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. |
Value
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).
Examples
## Not run:
get_independent_expenditure_by_date(2016, year = 2018, month ='01', day = '01')
## End(Not run)
Get Independent Expenditure Office Totals
Description
HTTP Request: GET https://api.propublica.org/campaign-finance/v1/cycle/independent_expenditures/race_totals/office
Usage
get_independent_expenditure_office_totals(
cycle = 2018,
office = c("house", "senate", "president"),
page = 1,
myAPI_Key
)
Arguments
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. |
Value
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).
Examples
## 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)
Get Independent Expenditure Office Totals
Description
HTTP Request: GET https://api.propublica.org/campaign-finance/v1/cycle/committees/fec-id/independent_expenditures/races
Usage
get_independent_expenditure_race_totals_committee(
cycle,
FEC_ID,
page = 1,
myAPI_Key
)
Arguments
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. |
Value
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.
Examples
## Not run:
get_independent_expenditure_race_totals_committee(2016, 'C00490375')
## End(Not run)
Get Independent Expenditures that Support or Oppose a Specific Candidate
Description
#HTTP Request: GET https://api.propublica.org/campaign-finance/v1/cycle/candidates/fec-id/independent_expenditures
Usage
get_independent_expenditure_support_candidate(
cycle = 2018,
FEC_ID,
page = 1,
myAPI_Key
)
Arguments
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. |
Value
List of returned JSON from endpoint that retrieves the 200 most recent independent expenditures in support of or opposition to a given candidate.
Examples
## Not run:
get_independent_expenditure_support_candidate(2016, FEC_ID ='P00003392')
## End(Not run)
Get Independent Expenditures that Support or Oppose Presidential Candidates
Description
#HTTP Request: GET https://api.propublica.org/campaign-finance/v1/cycle/president/independent_expenditures
Usage
get_independent_expenditure_support_presidential_candidate(
cycle = 2018,
page = 1,
myAPI_Key
)
Arguments
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. |
Value
List of returned JSON from endpoint that retrieves the 200 most recent independent expenditures in support of or opposition to any presidential candidate.
Examples
## Not run:
get_independent_expenditure_support_presidential_candidate(2016)
## End(Not run)
Get Lobbyist Bundlers for a Specific Committee
Description
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
Usage
get_lobbyist_bundlers(cycle = 2018, FEC_ID, page = 1, myAPI_Key)
Arguments
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. |
Value
List of returned JSON from endpoint that retrieves the most recent lobbyist bundlers reported by a specific committee.
Examples
## Not run:
get_lobbyist_bundlers(2016, 'C00579458')
## End(Not run)
Get a Specific Member’s Vote Positions
Description
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
Usage
get_member_vote_position(member_id, page = 1, myAPI_Key)
Arguments
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. |
Value
List of returned JSON from endpoint that retrieves the most recent vote positions for a specific member of the House of Representatives or Senate
Examples
## Not run:
get_member_vote_position('K000388')
## End(Not run)
Get Members Leaving Office
Description
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
Usage
get_members_leaving(congress, chamber, page = 1, myAPI_Key)
Arguments
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. |
Value
List of returned JSON from endpoint that retrieves a list of members who have left the Senate or House
Examples
## Not run:
get_members_leaving(115, 'house')
## End(Not run)
Get New Members
Description
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
Usage
get_new_members(page = 1, myAPI_Key)
Arguments
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. |
Value
List of returned JSON from endpoint that retrieves a list of the most recent new members of the current Congress
Examples
## Not run:
get_new_members()
## End(Not run)
Get Nominees by State
Description
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
Usage
get_nominees_by_state(congress, state, page = 1, myAPI_Key)
Arguments
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. |
Value
List of returned JSON from endpoint that retrieves
Examples
## Not run:
get_nominees_by_state(115, 'VA')
## End(Not run)
Get Quarterly Office Expenses by Category for a Specific House Member
Description
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
Usage
get_quarter_office_expenses_by_category_house_member(
member_id,
category,
page = 1,
myAPI_Key
)
Arguments
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. |
Value
the amount a given lawmaker spent during a specified year and quarter in a specified category
Examples
## Not run:
get_quarter_office_expenses_by_category_house_member('A000374', 'travel')
## End(Not run)
Get Quarterly Office Expenses by a Specific House Member
Description
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
Usage
get_quarter_office_expenses_house_member(
member_id,
year,
quarter,
page = 1,
myAPI_Key
)
Arguments
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. |
Value
the amount a given lawmaker spent during a specified year and quarter by category,
Examples
## Not run:
get_quarter_office_expenses_house_member('A000374', 2017, 4)
## End(Not run)
Get all Candidates in a State for an Election Cycle
Description
Get all Candidates in a State for an Election Cycle
Usage
get_races_for_state(state, cycle = 2018)
Arguments
state |
The State (US) of the election |
cycle |
Which election cycle (e.g. 2018) |
Value
the result of the API call.
Examples
## Not run:
get_races_for_state('DE')
get_races_for_state('DE', 2016)
## End(Not run)
Get Recent Amendments
Description
HTTP Request: GET https://api.propublica.org/campaign-finance/v1/cycle/filings/amendments
Usage
get_recent_amendments(cycle = 2018, page = 1, myAPI_Key)
Arguments
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. |
Value
List of returned JSON from endpoint that retrieves the most recent filings that are amendments of earlier filings
Examples
## Not run:
get_recent_amendments(2016)
## End(Not run)
Get Recent Committee Hearings
Description
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
Usage
get_recent_committee_hearing(congress, page = 1, myAPI_Key)
Arguments
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. |
Value
List of returned JSON from endpoint that retrieves the 20 most recent results and supports pagination using multiples of 20.
Examples
## Not run:
get_recent_committee_hearing(115)
## End(Not run)
Get Recent Congressional Statements
Description
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
Usage
get_recent_congressional_statements(page = 1, myAPI_Key)
Arguments
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. |
Value
List of returned JSON from endpoint that retrieves the 20 most recent results and supports pagination using multiples of 20.
Examples
## Not run:
get_recent_congressional_statements()
## End(Not run)
Get Congressional Statements by Date
Description
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
Usage
get_recent_congressional_statements_by_date(
year,
month,
day,
page = 1,
myAPI_Key
)
Arguments
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. |
Value
List of returned JSON from endpoint that retrieves the 20 most recent results and supports pagination using multiples of 20.
Examples
## Not run:
get_recent_congressional_statements_by_date(2017, '05', '08')
## End(Not run)
Get Congressional Statements by Search Term
Description
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
Usage
get_recent_congressional_statements_by_term(term, page = 1, myAPI_Key)
Arguments
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. |
Value
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.
Examples
## Not run:
get_recent_congressional_statements_by_term('AHCA')
## End(Not run)
Get Recent Electioneering Communications
Description
HTTP Request: GET https://api.propublica.org/campaign-finance/v1/cycle/electioneering_communications
Usage
get_recent_electioneering_communications(cycle = 2018, page = 1, myAPI_Key)
Arguments
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. |
Value
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).
Examples
## Not run:
get_recent_electioneering_communications(2016)
## End(Not run)
Get Recent House and Senate Floor Actions
Description
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
Usage
get_recent_house_senate_floor_actions(congress, chamber, page = 1, myAPI_Key)
Arguments
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. |
Value
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).
Examples
## Not run:
get_recent_house_senate_floor_actions(115, 'house')
## End(Not run)
Get Recent Independent Expenditures
Description
HTTP Request: GET https://api.propublica.org/campaign-finance/v1/cycle/independent_expenditures
Usage
get_recent_independent_expend(cycle = 2018, page = 1, myAPI_Key)
Arguments
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. |
Examples
## 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
Description
Get Recent Late Contributions https://www.propublica.org/datastore/apis HTTP Request: GET https://api.propublica.org/campaign-finance/v1/cycle/contributions/48hour
Usage
get_recent_late_contributions(cycle = 2018, page = 1, myAPI_Key)
Arguments
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. |
Value
List of returned JSON from endpoint that retrieves the most recent late contributions to candidates from the campaign-finance API from ProPublica.
Examples
## 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
Description
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
Usage
get_recent_late_contributions_candidate(
cycle = 2018,
FEC_ID,
page = 1,
myAPI_Key
)
Arguments
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. |
Value
List of returned JSON from endpoint that retrieves the most recent late contributions to candidates from the campaign-finance API from ProPublica.
Examples
## 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
Description
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
Usage
get_recent_late_contributions_committee(
cycle = 2018,
FEC_ID,
page = 1,
myAPI_Key
)
Arguments
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. |
Value
List of returned JSON from endpoint that retrieves the most recent late contributions to a specific committee.
Examples
## Not run:
get_recent_late_contributions_committee(2016, 'C00575050')
## End(Not run)
Get Recent Late Contributions by Date
Description
HTTP Request: GET https://api.propublica.org/campaign-finance/v1/cycle/contributions/48hour/year/month/day
Usage
get_recent_late_contributions_date(
cycle = 2018,
year,
month,
day,
page = 1,
myAPI_Key
)
Arguments
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. |
Value
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.
Examples
## Not run:
get_recent_late_contributions_date(2016, year = 2016, month = '09', day = '07')
## End(Not run)
Get Recent Lobbying Representation filings
Description
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
Usage
get_recent_lobbying_representation_filings(page = 1, myAPI_Key)
Arguments
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. |
Value
List of returned JSON from endpoint that retrieves the 20 most recent lobbying representation filings.
Examples
## Not run:
get_recent_lobbying_representation_filings()
## End(Not run)
Get Recent Nominations by Category
Description
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
Usage
get_recent_nominations_by_category(congress, type, page = 1, myAPI_Key)
Arguments
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. |
Value
List of returned JSON from endpoint that retrieves the 20 most recent results for the specified type: received, updated, confirmed or withdrawn.
Examples
## Not run:
get_recent_nominations_by_category(115, 'confirmed')
## End(Not run)
Get Recent Official Communications
Description
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
Usage
get_recent_official_communications(congress, page = 1, myAPI_Key)
Arguments
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. |
Value
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.
Examples
## Not run:
get_recent_official_communications(115)
## End(Not run)
Get Recent Official Communications by Category
Description
Get lists of official communications to Congress from the president, executive branch agencies and state legislatures to congressional committees.
Usage
get_recent_official_communications_by_category(
congress,
category,
page = 1,
myAPI_Key
)
Arguments
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. |
Value
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).
Examples
## Not run:
get_recent_official_communications_by_category(115, 'pm')
## End(Not run)
Get Recent Official Communications by Chamber
Description
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
Usage
get_recent_official_communications_by_chamber(
congress,
chamber,
page = 1,
myAPI_Key
)
Arguments
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. |
Value
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.
Examples
## Not run:
get_recent_official_communications_by_chamber(115, 'house')
## End(Not run)
Get Recent Official Communications by Date
Description
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
Usage
get_recent_official_communications_by_date(
year,
month,
day,
page = 1,
myAPI_Key
)
Arguments
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. |
Value
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).
Examples
## Not run:
get_recent_official_communications_by_date(2018, '03', '21')
## End(Not run)
Get Recent Personal Explanations
Description
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
Usage
get_recent_personal_explanations(congress, page = 1, myAPI_Key)
Arguments
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. |
Value
List of returned JSON from endpoint that retrieves the 20 most recent results in the specified Congress
Examples
## Not run:
get_recent_personal_explanations(114)
## End(Not run)
Get Recent Personal Explanations by a Specific Members
Description
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
Usage
get_recent_personal_explanations_specific_member(
member_id,
congress,
page = 1,
myAPI_Key
)
Arguments
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. |
Value
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.
Examples
## Not run:
get_recent_personal_explanations_specific_member('S001193', 115)
## End(Not run)
Get Recent Personal Explanation Votes
Description
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
Usage
get_recent_personal_explanations_votes(congress, page = 1, myAPI_Key)
Arguments
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. |
Value
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.
Examples
## Not run:
get_recent_personal_explanations_votes(114)
## End(Not run)
Get Recent Personal Explanation Votes by Category
Description
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
Usage
get_recent_personal_explanations_votes_by_category(
congress,
category,
page = 1,
myAPI_Key
)
Arguments
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. |
Value
List of returned JSON from endpoint that retrieves the 20 most recent personal explanation votes filtered by a category in the specified Congress.
Examples
## Not run:
get_recent_personal_explanations_votes_by_category(115, 'voted-incorrectly')
## End(Not run)
Get Recent Personal Explanation Votes by a Specific Member
Description
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
Usage
get_recent_personal_explanations_votes_specific_member(
member_id,
congress,
page = 1,
myAPI_Key
)
Arguments
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. |
Value
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.
Examples
## Not run:
get_recent_personal_explanations_votes_specific_member('S001193', 115)
## End(Not run)
Get Recent Personal Explanation Votes by a Specific Member by Category
Description
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
Usage
get_recent_personal_explanations_votes_specific_member_by_category(
member_id,
congress,
category,
page = 1,
myAPI_Key
)
Arguments
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. |
Value
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.
Examples
## Not run:
get_recent_personal_explanations_votes_specific_member_by_category('S001193', 115, 'personal')
## End(Not run)
Get Recent Votes
Description
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
Usage
get_recent_votes(chamber, page = 1, myAPI_Key)
Arguments
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. |
Value
List of returned JSON from endpoint that retrieves the 20 most recent votes from the House, Senate or both chambers
Examples
## Not run:
get_recent_votes('senate')
## End(Not run)
Get Recently Added Independent Expenditure-Only Committees.
Description
HTTP Request: GET https://api.propublica.org/campaign-finance/v1/cycle/committees/superpacs
Usage
get_recently_added_independent_expenditure_committees(
cycle = 2018,
page = 1,
myAPI_Key
)
Arguments
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. |
Value
List of returned JSON from endpoint that retrieves the 20 most recently added FEC independent expenditure-only committees, known as “super PACs”.
Examples
## 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)
Description
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)
Usage
get_recently_candidates(cycle = 2018, page = 1, myAPI_Key)
Arguments
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. |
Value
List of the most recently added FEC candidates for a given campaign cycle from the campaign-finance API from ProPublica.
Examples
## Not run:
get_recently_candidates(2016)
## End(Not run)
Get Recently Added Committees.
Description
HTTP Request: GET https://api.propublica.org/campaign-finance/v1/cycle/committees/new
Usage
get_recently_committees(cycle = 2018, page = 1, myAPI_Key)
Arguments
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. |
Value
List of returned JSON from endpoint that retrieves the 20 most recently added FEC committees from the campaign-finance API from ProPublica.
Examples
## Not run:
get_recently_committees(2016)
## End(Not run)
Get Related Bills for a Specific Bill
Description
HTTP Request: GET hhttps://api.propublica.org/congress/v1/congress/bills/bill-id/related.json. Use this request type to get Library of Congress-identified related bills for a particular bill.
Usage
get_related_bills(congress, bill_id, page = 1, myAPI_Key)
Arguments
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. |
Value
List of returned JSON from endpoint that retrieves the 20 most recent results and supports paginated requests.
Examples
## Not run:
get_related_bills(115, 'hr3219')
## End(Not run)
Get Senate Nomination Votes
Description
To get Senate votes on presidential nominations. HTTP Request: GET https://api.propublica.org/congress/v1/congress/nominations.json
Usage
get_senate_nomination_votes(congress, page = 1, myAPI_Key)
Arguments
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. |
Value
List of returned JSON from endpoint that retrieves Senate votes on presidential nominations
Examples
## Not run:
get_senate_nomination_votes(114)
## End(Not run)
Get a Specific Bill
Description
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
Usage
get_specific_bill(congress, bill_id, page = 1, myAPI_Key)
Arguments
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. |
Value
List of returned JSON from endpoint that retrieves details about a particular bill, including actions taken and votes
Examples
## Not run:
get_specific_bill(115, 'hr21')
## End(Not run)
Get a Specific Bill Subject
Description
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
Usage
get_specific_bill_subject(subject, page = 1, myAPI_Key)
Arguments
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. |
Value
List of returned JSON from endpoint that retrieves bill subjects that contain a specified term.
Examples
## Not run:
get_specific_bill_subject('meat')
## End(Not run)
Get a Specific Committee
Description
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
Usage
get_specific_committee(congress, chamber, committee_id, page = 1, myAPI_Key)
Arguments
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. |
Value
List of returned JSON from endpoint that retrieves the 20 most recent results and supports pagination using multiples of 20.
Examples
## 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)
Get a Specific Lobbying Representation filing
Description
To get a specific lobbying representation filing, use the following function. HTTP Request: GET https://api.propublica.org/congress/v1/lobbying/id.json
Usage
get_specific_lobbying_representation_filings(id, page = 1, myAPI_Key)
Arguments
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. |
Value
List of returned JSON from endpoint that retrieves
Examples
## Not run:
get_specific_lobbying_representation_filings('300986302')
## End(Not run)
Get a Specific Nomination
Description
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
Usage
get_specific_nominations(congress, nominee_id, page = 1, myAPI_Key)
Arguments
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. |
Value
List of returned JSON from endpoint that retrieves
Examples
## Not run:
get_specific_nominations(115, 'PN40')
## End(Not run)
Get a Specific Roll Call Vote
Description
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
Usage
get_specific_roll_call_vote(
congress,
chamber = c("house", "senate"),
session_number,
roll_call_number,
page = 1,
myAPI_Key
)
Arguments
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. |
Value
List of returned JSON from endpoint that retrieves a specific roll-call vote s
Examples
## Not run:
get_specific_roll_call_vote(115, 'senate', 1, 17L)
## End(Not run)
Get a Specific Subcommittee
Description
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
Usage
get_specific_subcommittee(
congress,
chamber,
committee_id,
subcommittee_id,
page = 1,
myAPI_Key
)
Arguments
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. |
Value
List of returned JSON from endpoint that retrieves the 20 most recent hearings and supports pagination.
Examples
## 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)
Get State Party Counts
Description
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
Usage
get_state_party_counts(page = 1, myAPI_Key)
Arguments
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. |
Value
List of returned JSON from endpoint that retrieves
Examples
## Not run:
get_state_party_counts()
## End(Not run)
Get Statement Subjects
Description
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.
Usage
get_statement_subjects(page = 1, myAPI_Key)
Arguments
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. |
Value
List of returned JSON from endpoint that retrieves all of the subjects that have been used at least once.
Examples
## Not run:
get_statement_subjects()
## End(Not run)
Get Subjects for a Specific Bill
Description
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.
Usage
get_subjects_for_bill(congress, bill_id, page = 1, myAPI_Key)
Arguments
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. |
Value
List of returned JSON from endpoint that retrieves the 20 most recent results and supports paginated requests.
Examples
## Not run:
get_subjects_for_bill(115, 'hr1628')
## End(Not run)
Get Top 20 Candidates in Specific Financial Category
Description
https://www.propublica.org/datastore/apis HTTP Request: GET https://api.propublica.org/campaign-finance/v1/cycle/candidates/leaders/category
Usage
get_top20_candidate_of_FinancialCategory(
category,
cycle = 2018,
page = 1,
myAPI_Key
)
Arguments
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. |
Value
List of returned JSON from endpoint that retrieves a specific FEC candidate for a given campaign cycle.
Examples
## Not run:
get_top20_candidate_of_FinancialCategory('pac-total', 2016)
## End(Not run)
Get Upcoming Bills
Description
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
Usage
get_upcoming_bills(chamber, page = 1, myAPI_Key)
Arguments
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. |
Value
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.
Examples
## Not run:
get_upcoming_bills('senate')
## End(Not run)
Get Votes by Date
Description
HTTP Requests: GET https://api.propublica.org/congress/v1/chamber/votes/year/month.json
Usage
get_votes_by_date(
chamber = c("house", "senate"),
year,
month,
page = 1,
myAPI_Key
)
Arguments
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. |
Value
List of returned JSON from endpoint that retrieves all votes for one or both chambers in a particular month s
Examples
## Not run:
get_votes_by_date('house', 2018, '09')
## End(Not run)
Get Votes by date range
Description
HTTP Requests: GET https://api.propublica.org/congress/v1/chamber/votes/start-date/end-date.json
Usage
get_votes_by_date_range(
chamber = c("house", "senate"),
start_date,
end_date,
page = 1,
myAPI_Key
)
Arguments
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. |
Value
List of returned JSON from endpoint that retrieves all votes in a particular date range (fewer than 30 days) s
Examples
## Not run:
get_votes_by_date_range('house', '2017-01-03', '2017-01-31')
## End(Not run)
Get Votes by Type
Description
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
Usage
get_votes_by_type(
congress,
chamber = c("house", "senate"),
vote_type,
page = 1,
myAPI_Key
)
Arguments
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. |
Value
List of returned JSON from endpoint that retrieves a types of votes of each member of a specific chamber and congress. s
Examples
## Not run:
get_votes_by_type(114, 'house', 'missed')
## End(Not run)
To get a list of members of a particular chamber in a particular Congress
Description
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
Usage
list_members_chamber_congress(congress, chamber, page = 1, myAPI_Key)
Arguments
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. |
Value
list of members of a particular chamber in a particular Congress
Examples
## Not run:
list_members_chamber_congress(115, 'senate')
## End(Not run)
Lists of Committees
Description
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
Usage
lists_of_committees(congress, chamber, page = 1, myAPI_Key)
Arguments
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. |
Value
List of returned JSON from endpoint that retrieves the 20 most recent results and supports pagination using multiples of 20.
Examples
## Not run:
lists_of_committees(115, "senate")
## End(Not run)
Convert a ProPublica API result a Data Frame
Description
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.
Usage
pp_convert_to_data_frame(what, which_part = c("result", "summary", "meta"))
Arguments
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. |
Details
The function also replaces . (dot) with _ (underscore) in column names for compatibility with database inserts (e.g. DBI::dbWriteTable)
Value
a data.frame
Examples
## 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)
Execute a query against the ProPublica API
Description
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.
Usage
pp_query(
query,
API = c("campaign-finance", "congress"),
version = "v1",
page = 1,
myAPI_Key
)
Arguments
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. |
Value
a list object with the return values.
Examples
## 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)
Get Recent Bills by a Specific Member
Description
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
Usage
recent_bills_by_member(member_id, type, page = 1, myAPI_Key)
Arguments
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. |
Value
the 20 bills most recently introduced or updated by a particular member. Results can include more than one Congress.
Examples
## Not run:
recent_bills_by_member('L000287', 'introduced')
## End(Not run)
Get Recent Bills by a Specific Subject
Description
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
Usage
recent_bills_by_subject(subject, page = 1, myAPI_Key)
Arguments
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. |
Value
List of returned JSON from endpoint that retrieves the 20 most recently updated bills for a specific legislative subject.
Examples
## Not run:
recent_bills_by_subject('meat')
## End(Not run)
Get Recent Bills
Description
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.
Usage
recent_bills_by_type(
congress,
chamber = c("house", "senate", "both"),
type = c("introduced", "updated", "active", "passed", "enacted", "vetoed"),
page = 1,
myAPI_Key
)
Arguments
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. |
Value
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.
Examples
## Not run:
recent_bills_by_type(115, 'house', 'introduced')
## End(Not run)
Retrieve the relevant ProPublica API key for congress API or campaign finance API
Description
This function is primarily meant to be used by pp_query to determine the API keys if not passed explicitly.
Usage
retrieve_key(API = c("congress", "campaign-finance"))
Arguments
API |
Which API are you accessing |
Value
the key from config.yml or global environment variables key_congress/key_campaign_finance
Examples
## Not run:
retrieve_key('congress')
retrieve_key('campaign-finance')
## End(Not run)
Search Lobbying Representation Filings
Description
Returns recent lobbying representation filings for a given search term, in batches of twenty.
Usage
search_lobbying_representation_filings(query, page = 1, myAPI_Key)
Arguments
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. |
Value
List of returned JSON from endpoint that retrieves
Examples
## Not run:
search_lobbying_representation_filings('Facebook')
## End(Not run)
US Congressional Districts
Description
A dataset containing some information about US Congressional Districts
Usage
us_congressional_districts
Format
A data frame with 435 rows and 3 variables:
- district
The district name
- state_name
The state the district is in
- state_abb
Two letter state abbreviation
- district_number
District number. Except for at-large districts.
...
Validate that year cycle is correct
Description
Validate that year cycle is correct
Usage
validate_cycle(cycle)
Arguments
cycle |
An election cycle (e.g. 2018) |
Value
TRUE if correct FALSE otherwise
Examples
validate_cycle(1996)#TRUE
validate_cycle(1979)#FALSE
validate_cycle(16) #FALSE
Validate that a district abbreviation is correct
Description
Validate that a district abbreviation is correct
Usage
validate_district(us_district)
Arguments
us_district |
An integer corresponding to the district. |
Value
TRUE if correct FALSE otherwise
Examples
## 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
Description
Validate that a abbreviation is correct
Usage
validate_state(us_state)
Arguments
us_state |
State abbreviation (e.g. NY) |
Value
TRUE if correct FALSE otherwise