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

View source: R/ustfd.R

ustfd_requestR Documentation

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,
  ...
)

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

Value

a httr response object

See Also

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

Examples

## Not run: 
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)

## End(Not run)

ustfd documentation built on Nov. 8, 2023, 1:07 a.m.