ustfd_query: Form a Query

View source: R/ustfd_query.R

ustfd_queryR Documentation

Form a Query

Description

ustfd_query() will verify the endpoint is valid and return a list suitable for passing to ustfd_url() and ustfd_request().

Usage

ustfd_query(
  endpoint,
  filter = NULL,
  fields = NULL,
  sort = NULL,
  page_size = NULL,
  page_number = NULL
)

Arguments

endpoint

required string representing an API endpoint

filter

optional list used to subset the data. See filter-syntax for more information.

fields

optional character vector of the fields to be retrieved

sort

optional string or character vector. Ordering defaults to ascending, to specify descending order precede the field name with '-'

page_size

optional integer for pagination

page_number

optional integer for pagination

Value

a list

See Also

Other ustfd_user: endpoint_exists(), ustfd_all_pages(), ustfd_datasets(), ustfd_simple(), ustfd_table_columns(), ustfd_tables()

Examples


library(ustfd)
ustfd_query(
  'v2/accounting/od/utf_qtr_yields',
   filter = list(record_date = c('>=' = lubridate::today()-10))
)
ustfd_query(
  'v2/accounting/od/utf_qtr_yields',
   filter = list(record_date = list('in' = c('2020-03-15','2020-03-16','2020-03-17')))
)
ustfd_query(
  'v2/accounting/od/utf_qtr_yields',
   filter = list(record_date = c('=' = '2020-03-15'))
)




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