View source: R/check_census_api_call.R
check_census_api_call | R Documentation |
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,
check_census_api_call(call)
call |
a returned call from the US Census API |
a string vector with the message from the US Census API
if(FALSE){
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)
stop_for_status(single_call)
# Because a non valid API key was specified an message will be returned
check_census_api_call(single_call)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.