Skip to contents

Queries the LimnoTrack water quality profiler endpoint for a given lake, returning either profiler ("pro") or meteorological ("met") data. Unlike lt_fetch(), this hits a dedicated API endpoint rather than the PostgREST interface, and requires an API key. This downloads all the data for the specified lake and type, so it may take some time for lakes with large datasets. These data correspond to data available in the LimnoTrack web interface, which uses automated quality control and filtering to remove erroneous data.

Usage

lt_get_wq(
  lake = "Karapiro",
  type = c("pro", "met"),
  api_key = NULL,
  base_url = "https://api.limnotrack.com"
)

Arguments

lake

character; lake name (e.g., "Karapiro").

type

character; either "pro" for profiler data or "met" for meteorological data. Default "pro".

api_key

character; API key for authentication. If NULL, will look for the key in the LERNZMP_KEY environment variable. If that is not set, will throw an error. To get an API key, contact LimnoTrack (admin@limnotrack.com)

base_url

character; base URL of the LimnoTrack API.

Value

A tibble::tibble of profiler or meteorological data.

Errors

ltapi_api_unavailable

The API could not be reached, or returned a 502/503/504.

ltapi_api_error

The API returned an unexpected HTTP error.

Examples

if (FALSE) { # \dontrun{
  lt_get_wq(lake = "Karapiro", type = "pro")
  lt_get_wq(lake = "Karapiro", type = "met")
} # }