R/a_get_new_members.R

Defines functions get_new_members

Documented in get_new_members

#' Get New Members
#' 
#' 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
#'
#' @param myAPI_Key API key from Propublica To use the congress API, you must sign up for an API key.
#' @param page Results come in batches of 20. The page parameter specifies which one to retrieve.
#' @return List of returned JSON from endpoint that retrieves a list of the most recent new members of the current Congress
#' @export
#'
#' @examples
#' \dontrun{
#' get_new_members()
#' }
get_new_members <- function(page = 1, myAPI_Key){
  API = 'congress'
  query <- sprintf("members/new.json")
  pp_query(query, API, page = page, myAPI_Key = myAPI_Key)
}

Try the ProPublicaR package in your browser

Any scripts or data that you put into this service are public.

ProPublicaR documentation built on Sept. 8, 2023, 5:53 p.m.