climacell_core returns a tibble that contains all of the Core Layer data from the Climacell version 4 API using the Timelines interface. The intent of this function is to retrieve all of the Core Layer data in a single API call. This is especially handy when using the free API as it limits the usage of the API based on hourly rate and daily usage.

climacell_core(
  api_key,
  lat,
  long,
  timestep,
  start_time = NULL,
  end_time = NULL
)

Arguments

api_key

character string representing the private API key. Provided by user or loaded automatically from environment variable (environment variable must be called "CLIMACELL_API").

lat

a numeric value (or a string that can be coerced to numeric) representing the latitude of the location.

long

a numeric value (or a string that can be coerced to numeric) representing the longitude of the location.

timestep

a 'step' value for the time. Choose one of the following valid values: c('1d', '1h', '30m','15m','5m','1m','current').

start_time

the start time of the query. This input must be a character string that can be parsed into a data/time or a date/time value. If the input does not contain a timezone, the value will be assumed to be in UTC. It is recommended that the lubridate::now() function or Sys.time() be used to define the start_time. For this function, the start_time cannot be less than 6 hours from the current time.

end_time

the end time of the query. This input must be a character string that can be parsed into a data/time or a date/time value. If the input does not contain a timezone, the value will be assumed to be in UTC. OPTIONAL if timestep is 'current' or if the user desires to get the maximum results possible (depends on the timestep chosen).

Value

a tibble

Examples

if (FALSE) { climacell_core( api_key = Sys.getenv('CLIMACELL_API'), lat = 0, long = 0, timestep = '1d', start_time = lubridate::now(), end_time = lubridate::now + lubridate::days(5)) }