Learn R Programming

ustfd (version 0.4.4)

ustfd_request: Retrieve Data From the U.S. Bureau Of the Fiscal Service API

Description

ustfd_request() will execute queries against the Fiscal Data API. Queries can generated using ustfd_query().

Usage

ustfd_request(
  query,
  user_agent = "http://github.com/groditi/ustfd",
  process_response = ustfd_json_response,
  ...
)

Value

a httr response object

Arguments

query

list generated by one of the query generating functions

user_agent

string, optional

process_response

function, optional. processes the httr response object. Defaults to ustfd_json_response() which will return the JSON payload parsed into a list

...

further arguments will be passed to process_response when called

See Also

Other ustfd_low_level: ustfd_json_response(), ustfd_response_meta_object(), ustfd_response_payload(), ustfd_url()

Examples

Run this code
if (FALSE) {
library(ustfd)
query <- ustfd_query('v1/accounting/dts/dts_table_2', sort =c('-record_date'))
response <- ustfd_request(query)
payload_table <- ustfd_response_payload(response)
payload_meta <- ustfd_response_meta_object(response)
}

Run the code above in your browser using DataLab