Title: | Access the Congress.gov API |
---|---|
Description: | Download and read data on United States congressional proceedings. Data is read from the Library of Congress's Congress.gov Application Programming Interface (<https://github.com/LibraryOfCongress/api.congress.gov/>). Functions exist for all version 3 endpoints, including for bills, amendments, congresses, summaries, members, reports, communications, nominations, and treaties. |
Authors: | Christopher T. Kenny [aut, cre] |
Maintainer: | Christopher T. Kenny <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.0.4 |
Built: | 2024-11-05 04:42:47 UTC |
Source: | https://github.com/christopherkenny/congress |
Request Amendment Information
cong_amendment( congress = NULL, type = NULL, number = NULL, item = NULL, from_date = NULL, to_date = NULL, limit = 20, offset = 0, format = "json", clean = TRUE )
cong_amendment( congress = NULL, type = NULL, number = NULL, item = NULL, from_date = NULL, to_date = NULL, limit = 20, offset = 0, format = "json", clean = TRUE )
congress |
Congress number to search for. 81 or later are supported. |
type |
Type of amendment. Can be |
number |
Amendment assigned number. Numeric. |
item |
Information to request. Can be |
from_date |
start date for search, e.g. |
to_date |
end date for search, e.g. |
limit |
number of records to return. Default is 20. Will be truncated to between 1 and 250. |
offset |
number of records to skip. Default is 0. Must be non-negative. |
format |
Output format for |
clean |
Default is TRUE. Should output be returned as a |
tibble
or HTTP response if clean = FALSE
.
# Requires API Key cong_amendment() cong_amendment(congress = 117) cong_amendment(congress = 117, type = 'samdt', number = 2137) cong_amendment(congress = 117, type = 'samdt', number = 2137, item = 'actions')
# Requires API Key cong_amendment() cong_amendment(congress = 117) cong_amendment(congress = 117, type = 'samdt', number = 2137) cong_amendment(congress = 117, type = 'samdt', number = 2137, item = 'actions')
Request Bill Information
cong_bill( congress = NULL, type = NULL, number = NULL, item = NULL, from_date = NULL, to_date = NULL, limit = 20, offset = 0, format = "json", clean = TRUE )
cong_bill( congress = NULL, type = NULL, number = NULL, item = NULL, from_date = NULL, to_date = NULL, limit = 20, offset = 0, format = "json", clean = TRUE )
congress |
Congress number to search for. 81 or later are supported. |
type |
Type of bill. Can be |
number |
Bill assigned number. Numeric. |
item |
Information to request. Can be |
from_date |
start date for search, e.g. |
to_date |
end date for search, e.g. |
limit |
number of records to return. Default is 20. Will be truncated to between 1 and 250. |
offset |
number of records to skip. Default is 0. Must be non-negative. |
format |
Output format for |
clean |
Default is TRUE. Should output be returned as a |
tibble
or HTTP response if clean = FALSE
# Requires API Key cong_bill() cong_bill(congress = 117) cong_bill(congress = 117, type = 'hr', number = 3076) cong_bill(congress = 117, type = 'hr', number = 3076, item = 'actions')
# Requires API Key cong_bill() cong_bill(congress = 117) cong_bill(congress = 117, type = 'hr', number = 3076) cong_bill(congress = 117, type = 'hr', number = 3076, item = 'actions')
Request bound Congressional Record Information
cong_bound_record( year = NULL, month = NULL, day = NULL, limit = 20, offset = 0, format = "json", clean = TRUE )
cong_bound_record( year = NULL, month = NULL, day = NULL, limit = 20, offset = 0, format = "json", clean = TRUE )
year |
integer for year |
month |
integer for month |
day |
integer for day of month |
limit |
number of records to return. Default is 20. Will be truncated to between 1 and 250. |
offset |
number of records to skip. Default is 0. Must be non-negative. |
format |
Output format for |
clean |
Default is TRUE. Should output be returned as a |
tibble
or HTTP response if clean = FALSE
# Requires API Key cong_bound_record() cong_bound_record(year = 1990) cong_bound_record(year = 1990, month = 5) cong_bound_record(year = 1948, month = 5, day = 19)
# Requires API Key cong_bound_record() cong_bound_record(year = 1990) cong_bound_record(year = 1990, month = 5) cong_bound_record(year = 1948, month = 5, day = 19)
Request Committee Information
cong_committee( congress = NULL, chamber = NULL, committee = NULL, item = NULL, from_date = NULL, to_date = NULL, limit = 20, offset = 0, format = "json", clean = TRUE )
cong_committee( congress = NULL, chamber = NULL, committee = NULL, item = NULL, from_date = NULL, to_date = NULL, limit = 20, offset = 0, format = "json", clean = TRUE )
congress |
Congress number to search for. 81 or later are supported. |
chamber |
Chamber name. Can be |
committee |
Code identifying committee. Character. |
item |
Information to request. Can be |
from_date |
start date for search, e.g. |
to_date |
end date for search, e.g. |
limit |
number of records to return. Default is 20. Will be truncated to between 1 and 250. |
offset |
number of records to skip. Default is 0. Must be non-negative. |
format |
Output format for |
clean |
Default is TRUE. Should output be returned as a |
tibble
or HTTP response if clean = FALSE
# Requires API Key cong_committee() cong_committee(congress = 117) cong_committee(chamber = 'house') cong_committee(congress = 117, chamber = 'house') cong_committee(chamber = 'house', committee = 'hsed10') cong_committee(chamber = 'house', committee = 'hspw00', item = 'house-communication') cong_committee(chamber = 'senate', committee = 'jsec03') cong_committee(chamber = 'senate', committee = 'slpo00', item = 'bills') cong_committee(chamber = 'senate', committee = 'slpo00', item = 'senate-communication')
# Requires API Key cong_committee() cong_committee(congress = 117) cong_committee(chamber = 'house') cong_committee(congress = 117, chamber = 'house') cong_committee(chamber = 'house', committee = 'hsed10') cong_committee(chamber = 'house', committee = 'hspw00', item = 'house-communication') cong_committee(chamber = 'senate', committee = 'jsec03') cong_committee(chamber = 'senate', committee = 'slpo00', item = 'bills') cong_committee(chamber = 'senate', committee = 'slpo00', item = 'senate-communication')
Request Committee Meeting Information
cong_committee_meeting( congress = NULL, chamber = NULL, number = NULL, from_date = NULL, to_date = NULL, limit = 20, offset = 0, format = "json", clean = TRUE )
cong_committee_meeting( congress = NULL, chamber = NULL, number = NULL, from_date = NULL, to_date = NULL, limit = 20, offset = 0, format = "json", clean = TRUE )
congress |
Congress number to search for. 81 or later are supported. |
chamber |
Chamber name. Can be |
number |
Meeting event identifier. Character (or numeric). |
from_date |
start date for search, e.g. |
to_date |
end date for search, e.g. |
limit |
number of records to return. Default is 20. Will be truncated to between 1 and 250. |
offset |
number of records to skip. Default is 0. Must be non-negative. |
format |
Output format for |
clean |
Default is TRUE. Should output be returned as a |
tibble
or HTTP response if clean = FALSE
# Requires API Key cong_committee_meeting() cong_committee_meeting(congress = 118) cong_committee_meeting(chamber = 'house') cong_committee_meeting(congress = 118, chamber = 'house') cong_committee_meeting(congress = 118, chamber = 'house', number = '115538')
# Requires API Key cong_committee_meeting() cong_committee_meeting(congress = 118) cong_committee_meeting(chamber = 'house') cong_committee_meeting(congress = 118, chamber = 'house') cong_committee_meeting(congress = 118, chamber = 'house', number = '115538')
Request Committee Print Information
cong_committee_print( congress = NULL, chamber = NULL, number = NULL, item = NULL, from_date = NULL, to_date = NULL, limit = 20, offset = 0, format = "json", clean = TRUE )
cong_committee_print( congress = NULL, chamber = NULL, number = NULL, item = NULL, from_date = NULL, to_date = NULL, limit = 20, offset = 0, format = "json", clean = TRUE )
congress |
Congress number to search for. 81 or later are supported. |
chamber |
Chamber name. Can be |
number |
Jacket number for the print. Character (or numeric). |
item |
Information to request. Can be |
from_date |
start date for search, e.g. |
to_date |
end date for search, e.g. |
limit |
number of records to return. Default is 20. Will be truncated to between 1 and 250. |
offset |
number of records to skip. Default is 0. Must be non-negative. |
format |
Output format for |
clean |
Default is TRUE. Should output be returned as a |
tibble
or HTTP response if clean = FALSE
# Requires API Key cong_committee_print() cong_committee_print(congress = 118) cong_committee_print(chamber = 'house') cong_committee_print(congress = 118, chamber = 'house') cong_committee_print(congress = 117, chamber = 'house', number = '48144') cong_committee_print(congress = 117, chamber = 'house', number = '48144', item = 'text')
# Requires API Key cong_committee_print() cong_committee_print(congress = 118) cong_committee_print(chamber = 'house') cong_committee_print(congress = 118, chamber = 'house') cong_committee_print(congress = 117, chamber = 'house', number = '48144') cong_committee_print(congress = 117, chamber = 'house', number = '48144', item = 'text')
Request Committee Report Information
cong_committee_report( congress = NULL, type = NULL, number = NULL, item = NULL, conference = FALSE, limit = 20, offset = 0, format = "json", clean = TRUE )
cong_committee_report( congress = NULL, type = NULL, number = NULL, item = NULL, conference = FALSE, limit = 20, offset = 0, format = "json", clean = TRUE )
congress |
Congress number to search for. 81 or later are supported. |
type |
Type of committee report. Can be |
number |
Committee report assigned number. Numeric. |
item |
Information to request. Can be |
conference |
Filter to conference reports. Default is |
limit |
number of records to return. Default is 20. Will be truncated to between 1 and 250. |
offset |
number of records to skip. Default is 0. Must be non-negative. |
format |
Output format for |
clean |
Default is TRUE. Should output be returned as a |
tibble
or HTTP response if clean = FALSE
# Requires API Key cong_committee_report() cong_committee_report(conference = TRUE) cong_committee_report(congress = 116) cong_committee_report(congress = 116, type = 'hrpt') cong_committee_report(congress = 116, type = 'hrpt', number = 617) cong_committee_report(congress = 116, type = 'hrpt', number = 617, item = 'text')
# Requires API Key cong_committee_report() cong_committee_report(conference = TRUE) cong_committee_report(congress = 116) cong_committee_report(congress = 116, type = 'hrpt') cong_committee_report(congress = 116, type = 'hrpt', number = 617) cong_committee_report(congress = 116, type = 'hrpt', number = 617, item = 'text')
Request Congress Information
cong_congress( congress = NULL, from_date = NULL, to_date = NULL, limit = 20, offset = 0, format = "json", clean = TRUE )
cong_congress( congress = NULL, from_date = NULL, to_date = NULL, limit = 20, offset = 0, format = "json", clean = TRUE )
congress |
Congress number to search for. 81 or later are supported. |
from_date |
start date for search, e.g. |
to_date |
end date for search, e.g. |
limit |
number of records to return. Default is 20. Will be truncated to between 1 and 250. |
offset |
number of records to skip. Default is 0. Must be non-negative. |
format |
Output format for |
clean |
Default is TRUE. Should output be returned as a |
tibble
or HTTP response if clean = FALSE
# Requires API Key cong_congress() cong_congress(congress = 116)
# Requires API Key cong_congress() cong_congress(congress = 116)
Request daily Congressional Record Information
cong_daily_record( volume = NULL, issue = NULL, item = NULL, limit = 20, offset = 0, format = "json", clean = TRUE )
cong_daily_record( volume = NULL, issue = NULL, item = NULL, limit = 20, offset = 0, format = "json", clean = TRUE )
volume |
Volume of the daily Congressional record. Character (or numeric). |
issue |
Issue of the daily Congressional record. Character (or numeric). |
item |
Information to request. Can be |
limit |
number of records to return. Default is 20. Will be truncated to between 1 and 250. |
offset |
number of records to skip. Default is 0. Must be non-negative. |
format |
Output format for |
clean |
Default is TRUE. Should output be returned as a |
tibble
or HTTP response if clean = FALSE
# Requires API Key cong_daily_record() cong_daily_record(volume = 166) cong_daily_record(volume = 168, issue = 153) cong_daily_record(volume = 167, issue = 21, item = 'articles')
# Requires API Key cong_daily_record() cong_daily_record(volume = 166) cong_daily_record(volume = 168, issue = 153) cong_daily_record(volume = 167, issue = 21, item = 'articles')
Request Hearing Information
cong_hearing( congress = NULL, chamber = NULL, number = NULL, limit = 20, offset = 0, format = "json", clean = TRUE )
cong_hearing( congress = NULL, chamber = NULL, number = NULL, limit = 20, offset = 0, format = "json", clean = TRUE )
congress |
Congress number to search for. 81 or later are supported. |
chamber |
Chamber name. Can be |
number |
Jacket number for the hearing. Character (or numeric). |
limit |
number of records to return. Default is 20. Will be truncated to between 1 and 250. |
offset |
number of records to skip. Default is 0. Must be non-negative. |
format |
Output format for |
clean |
Default is TRUE. Should output be returned as a |
tibble
or HTTP response if clean = FALSE
# Requires API Key cong_hearing() cong_hearing(congress = 116) cong_hearing(chamber = 'house') cong_hearing(congress = 116, chamber = 'house') cong_hearing(congress = 116, chamber = 'house', number = 41365)
# Requires API Key cong_hearing() cong_hearing(congress = 116) cong_hearing(chamber = 'house') cong_hearing(congress = 116, chamber = 'house') cong_hearing(congress = 116, chamber = 'house', number = 41365)
Request House Communication Information
cong_house_communication( congress = NULL, type = NULL, number = NULL, from_date = NULL, to_date = NULL, limit = 20, offset = 0, format = "json", clean = TRUE )
cong_house_communication( congress = NULL, type = NULL, number = NULL, from_date = NULL, to_date = NULL, limit = 20, offset = 0, format = "json", clean = TRUE )
congress |
Congress number to search for. 81 or later are supported. |
type |
Type of communication. Can be |
number |
Communication assigned number. Numeric. |
from_date |
start date for search, e.g. |
to_date |
end date for search, e.g. |
limit |
number of records to return. Default is 20. Will be truncated to between 1 and 250. |
offset |
number of records to skip. Default is 0. Must be non-negative. |
format |
Output format for |
clean |
Default is TRUE. Should output be returned as a |
tibble
or HTTP response if clean = FALSE
# Requires API Key cong_house_communication() cong_house_communication(congress = 117) cong_house_communication(congress = 117, type = 'ec') cong_house_communication(congress = 117, type = 'ec', number = 3324)
# Requires API Key cong_house_communication() cong_house_communication(congress = 117) cong_house_communication(congress = 117, type = 'ec') cong_house_communication(congress = 117, type = 'ec', number = 3324)
Request House Requirement data
cong_house_requirement( number = NULL, item = NULL, limit = 20, offset = 0, format = "json", clean = TRUE )
cong_house_requirement( number = NULL, item = NULL, limit = 20, offset = 0, format = "json", clean = TRUE )
number |
Requirement's assigned number. Numeric. |
item |
Information to request. Can be |
limit |
number of records to return. Default is 20. Will be truncated to between 1 and 250. |
offset |
number of records to skip. Default is 0. Must be non-negative. |
format |
Output format for |
clean |
Default is TRUE. Should output be returned as a |
tibble
or HTTP response if clean = FALSE
# Requires API Key cong_house_requirement() cong_house_requirement(number = 12478) cong_house_requirement(number = 8070, 'matching-communications')
# Requires API Key cong_house_requirement() cong_house_requirement(number = 12478) cong_house_requirement(number = 8070, 'matching-communications')
Request Member Information
cong_member( bioguide = NULL, item = NULL, from_date = NULL, to_date = NULL, limit = 20, offset = 0, format = "json", clean = TRUE )
cong_member( bioguide = NULL, item = NULL, from_date = NULL, to_date = NULL, limit = 20, offset = 0, format = "json", clean = TRUE )
bioguide |
Bioguide identifier for a member of Congress. |
item |
Information to request. Can be |
from_date |
start date for search, e.g. |
to_date |
end date for search, e.g. |
limit |
number of records to return. Default is 20. Will be truncated to between 1 and 250. |
offset |
number of records to skip. Default is 0. Must be non-negative. |
format |
Output format for |
clean |
Default is TRUE. Should output be returned as a |
tibble
or HTTP response if clean = FALSE
# Requires API Key cong_member() cong_member(bioguide = 'L000174', clean = TRUE) cong_member(bioguide = 'L000174', item = 'sponsored-legislation')
# Requires API Key cong_member() cong_member(bioguide = 'L000174', clean = TRUE) cong_member(bioguide = 'L000174', item = 'sponsored-legislation')
Request Nomination Information
cong_nomination( congress = NULL, number = NULL, item = NULL, from_date = NULL, to_date = NULL, limit = 20, offset = 0, format = "json", clean = TRUE )
cong_nomination( congress = NULL, number = NULL, item = NULL, from_date = NULL, to_date = NULL, limit = 20, offset = 0, format = "json", clean = TRUE )
congress |
Congress number to search for. 81 or later are supported. |
number |
Nomination assigned number. Numeric. |
item |
Information to request. Can be |
from_date |
start date for search, e.g. |
to_date |
end date for search, e.g. |
limit |
number of records to return. Default is 20. Will be truncated to between 1 and 250. |
offset |
number of records to skip. Default is 0. Must be non-negative. |
format |
Output format for |
clean |
Default is TRUE. Should output be returned as a |
tibble
or HTTP response if clean = FALSE
# Requires API Key cong_nomination() cong_nomination(congress = 118) cong_nomination(congress = 117, number = 2467) cong_nomination(congress = 117, number = 2467, item = 'actions') cong_nomination(congress = 117, number = 2467, item = 1)
# Requires API Key cong_nomination() cong_nomination(congress = 118) cong_nomination(congress = 117, number = 2467) cong_nomination(congress = 117, number = 2467, item = 'actions') cong_nomination(congress = 117, number = 2467, item = 1)
Request Congressional Record Information
cong_record( year = NULL, month = NULL, day = NULL, limit = 20, offset = 0, format = "json", clean = TRUE )
cong_record( year = NULL, month = NULL, day = NULL, limit = 20, offset = 0, format = "json", clean = TRUE )
year |
integer for year |
month |
integer for month |
day |
integer for day of month |
limit |
number of records to return. Default is 20. Will be truncated to between 1 and 250. |
offset |
number of records to skip. Default is 0. Must be non-negative. |
format |
Output format for |
clean |
Default is TRUE. Should output be returned as a |
tibble
or HTTP response if clean = FALSE
# Requires API Key cong_record() cong_record(year = 2022, month = 6, day = 28)
# Requires API Key cong_record() cong_record(year = 2022, month = 6, day = 28)
Request next set of responses
cong_request_next(response, max_req = 1)
cong_request_next(response, max_req = 1)
response |
A tibble::tibble from a |
max_req |
A max number of additional requests to make. Default is 1. |
a tibble with responses bound by row to new results
# Requires API Key cong_bill() |> cong_request_next()
# Requires API Key cong_bill() |> cong_request_next()
Request Senate Communication Information
cong_senate_communication( congress = NULL, type = NULL, number = NULL, from_date = NULL, to_date = NULL, limit = 20, offset = 0, format = "json", clean = TRUE )
cong_senate_communication( congress = NULL, type = NULL, number = NULL, from_date = NULL, to_date = NULL, limit = 20, offset = 0, format = "json", clean = TRUE )
congress |
Congress number to search for. 81 or later are supported. |
type |
Type of communication. Can be |
number |
Communication assigned number. Numeric. |
from_date |
start date for search, e.g. |
to_date |
end date for search, e.g. |
limit |
number of records to return. Default is 20. Will be truncated to between 1 and 250. |
offset |
number of records to skip. Default is 0. Must be non-negative. |
format |
Output format for |
clean |
Default is TRUE. Should output be returned as a |
tibble
or HTTP response if clean = FALSE
# Requires API Key cong_senate_communication() cong_senate_communication(congress = 117) cong_senate_communication(congress = 117, type = 'ec') cong_senate_communication(congress = 117, type = 'ec', number = 2561)
# Requires API Key cong_senate_communication() cong_senate_communication(congress = 117) cong_senate_communication(congress = 117, type = 'ec') cong_senate_communication(congress = 117, type = 'ec', number = 2561)
Request Bill Summary Information
cong_summaries( congress = NULL, type = NULL, from_date = NULL, to_date = NULL, limit = 20, offset = 0, format = "json", clean = TRUE )
cong_summaries( congress = NULL, type = NULL, from_date = NULL, to_date = NULL, limit = 20, offset = 0, format = "json", clean = TRUE )
congress |
Congress number to search for. 81 or later are supported. |
type |
Type of bill. Can be |
from_date |
start date for search, e.g. |
to_date |
end date for search, e.g. |
limit |
number of records to return. Default is 20. Will be truncated to between 1 and 250. |
offset |
number of records to skip. Default is 0. Must be non-negative. |
format |
Output format for |
clean |
Default is TRUE. Should output be returned as a |
tibble
or HTTP response if clean = FALSE
# Requires API Key cong_summaries() cong_summaries(congress = 117) cong_summaries(congress = 117, type = 'hr')
# Requires API Key cong_summaries() cong_summaries(congress = 117) cong_summaries(congress = 117, type = 'hr')
Request Treaty Information
cong_treaty( congress = NULL, number = NULL, suffix = NULL, item = NULL, from_date = NULL, to_date = NULL, limit = 20, offset = 0, format = "json", clean = TRUE )
cong_treaty( congress = NULL, number = NULL, suffix = NULL, item = NULL, from_date = NULL, to_date = NULL, limit = 20, offset = 0, format = "json", clean = TRUE )
congress |
Congress number to search for. 81 or later are supported. |
number |
Treaty assigned number. Numeric. |
suffix |
Treaty partition letter value. Character. |
item |
Information to request. Can be |
from_date |
start date for search, e.g. |
to_date |
end date for search, e.g. |
limit |
number of records to return. Default is 20. Will be truncated to between 1 and 250. |
offset |
number of records to skip. Default is 0. Must be non-negative. |
format |
Output format for |
clean |
Default is TRUE. Should output be returned as a |
tibble
or HTTP response if clean = FALSE
# Requires API Key cong_treaty() cong_treaty(congress = 117) cong_treaty(congress = 117, number = 3) cong_treaty(congress = 114, number = 13, suffix = 'A') cong_treaty(congress = 117, number = 3, item = 'actions') cong_treaty(congress = 114, number = 13, suffix = 'A', item = 'actions')
# Requires API Key cong_treaty() cong_treaty(congress = 117) cong_treaty(congress = 117, number = 3) cong_treaty(congress = 114, number = 13, suffix = 'A') cong_treaty(congress = 117, number = 3, item = 'actions') cong_treaty(congress = 114, number = 13, suffix = 'A', item = 'actions')
Check or Get Congress API Key
has_congress_key() get_congress_key()
has_congress_key() get_congress_key()
logical if has
, key if get
has_congress_key()
has_congress_key()
Adds Congress API key to .Renviron.
set_congress_key(key, overwrite = FALSE, install = FALSE)
set_congress_key(key, overwrite = FALSE, install = FALSE)
key |
Character. API key to add to add. |
overwrite |
Defaults to FALSE. Boolean. Should existing |
install |
Defaults to FALSE. Boolean. Should this be added '~/.Renviron' file? |
key, invisibly
## Not run: set_congress_key('1234') ## End(Not run)
## Not run: set_congress_key('1234') ## End(Not run)