census_geocoder_api_call: Function for doing a single API call for a single target

View source: R/resource-census-geocoder.R

census_geocoder_api_callR Documentation

Function for doing a single API call for a single target

Description

Function for doing a single API call for a single target

Usage

census_geocoder_api_call(
  target,
  endpoint = census_geocoder_api_endpoint(),
  returntype = "locations",
  benchmark = purrr::flatten(purrr::keep(census_geocoder_api_benchmarks(),
    ~.x$isDefault)),
  vintage = purrr::flatten(purrr::keep(census_geocoder_api_vintage()$vintages,
    ~.x$isDefault)),
  cache_dir = workflow::build_dir("census-geocoder-cache")
)

Arguments

target

list with components for a valid call.

endpoint

service endpoint

returntype

either "locations" for basic API call or "geographies" if the call should also return which geographic entities the address exists within.

benchmark

as returned by census_geocoder_api_benchmarks

vintage

as returned by census_geocoder_api_vintage

Value

a list gently re-formatted from the API call return, including status, any error messages, and the outcome of geocoding.


sakrejda/workflow documentation built on Nov. 18, 2024, 3:02 a.m.