Sends a request to the PurpleAirAPI API endpoint described at: https://api.purpleair.com/#api-groups-get-groups-list

pa_getGroupsList(
  api_key = NULL,
  baseUrl = "https://api.purpleair.com/v1/groups"
)

Arguments

api_key

PurpleAir API READ ey.

baseUrl

URL endpoint for the "Get Groups List" API.

Value

List containing all groups owned by api_key.

Examples

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

library(AirSensor)

  pa_getGroupsList(
    api_key = PURPLE_AIR_API_READ_KEY
  )

}, silent = FALSE)
#> Error in MazamaCoreUtils::stopIfNull(api_key) : 
#>   object 'PURPLE_AIR_API_READ_KEY' not found
# }