get_data_aemet {climaemet} | R Documentation |
Client tool for AEMET API
Description
Client tool to get data and metadata from AEMET and convert json to tibble.
Usage
get_data_aemet(apidest, verbose = FALSE)
get_metadata_aemet(apidest, verbose = FALSE)
Arguments
apidest |
Character string as destination URL. See https://opendata.aemet.es/dist/index.html. |
verbose |
Logical |
Value
A tibble (if possible) or the results of the query as provided by
httr::content()
.
Source
https://opendata.aemet.es/dist/index.html
See Also
Some examples on how to use these functions on
vignette("extending-climaemet")
.
Examples
# Run this example only if AEMET_API_KEY is detected
url <- "/api/valores/climatologicos/inventarioestaciones/todasestaciones"
get_data_aemet(url)
# Metadata
get_metadata_aemet(url)
# We can get data from any API endpoint
# Plain text
plain <- get_data_aemet("/api/prediccion/nacional/hoy")
cat(plain)
# An image
image <- get_data_aemet("/api/mapasygraficos/analisis")
# Write and read
tmp <- tempfile(fileext = ".gif")
writeBin(image, tmp)
gganimate::gif_file(tmp)
[Package climaemet version 1.2.1 Index]