Sends a request to the Clarity API endpoint for Open Data.

  • Measurement data from -- All open datasources

  • Measurements returned -- Hourly values for last 3 hours

  • PM2.5 Mass Concentration -- 1-Hour Mean Nowcast

Clarity_getAllOpenHourly(
  api_key = NULL,
  format = "USFS",
  baseUrl =
    "https://clarity-data-api.clarity.io/v1/open/all-recent-measurement/pm25/hourly"
)

Arguments

api_key

Clarity API READ Key. If api_key = NULL, it will be obtained using getAPIKey("Clarity-read").

format

Customized output format (currently only "USFS").

baseUrl

URL endpoint.

Value

List containing five data frames: synoptic, pm2.5_QCFlag, pm2.5, nowcast_QCFlag and nowcast.

Examples

# \donttest{
# Fail gracefully if any resources are not available
try({

library(AirSensor2)

  Clarity_getAllOpenHourly(
    api_key = Clarity_API_READ_KEY,
    format = "USFS"
  )

}, silent = FALSE)
#> Error in Clarity_getAllOpenHourly(api_key = Clarity_API_READ_KEY, format = "USFS") : 
#>   object 'Clarity_API_READ_KEY' not found
# }