check_census_api_call: A helper function to help parse API calls from the census

Description Usage Arguments Value Examples

View source: R/check_census_api_call.R

Description

The function verifies that API call was sucessful. If the call was not sucessful, this function passes the message received from the US Census API for further troublshooting,

Usage

1

Arguments

call

a returned call from the US Census API

Value

a string vector with the message from the US Census API

Examples

1
2
3
4
5
6
7
8
9
library(tidyqwi)
library(httr)
# A single call to the API without an API Key
url <- "api.census.gov/data/timeseries/qwi/sa?get=Emp&for=county:198&key=NOKEY"
single_call <- httr::GET(url)

# Because a non valid API key was specified an message will be returned

check_census_api_call(single_call)

tidyqwi documentation built on May 4, 2020, 5:10 p.m.