Get AEMET stations.
Details
The first result of the API call on each session is (temporarily) cached in
the assigned tempdir()
for avoiding unneeded API calls.
Note
Code modified from project https://github.com/SevillaR/aemet.
API Key
You need to set your API Key globally using aemet_api_key()
.
See also
Other aemet_api_data:
aemet_alert_zones()
,
aemet_alerts()
,
aemet_beaches()
,
aemet_daily_clim()
,
aemet_extremes_clim()
,
aemet_forecast_beaches()
,
aemet_forecast_daily()
,
aemet_forecast_fires()
,
aemet_last_obs()
,
aemet_monthly
,
aemet_normal
Examples
library(tibble)
stations <- aemet_stations()
#> HTTP 500: Hit API Limits. Retrying...
#> Waiting 3s for retry backoff ■■■■■■■■■■■
#> Waiting 3s for retry backoff ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
#> Waiting 5s for retry backoff ■■■■■■■■
#> Waiting 5s for retry backoff ■■■■■■■■■■■■■■■■■■■■■
#> Waiting 5s for retry backoff ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
#> Waiting 8s for retry backoff ■■■■■■
#> Waiting 8s for retry backoff ■■■■■■■■■■■■■■■■■■■
#> Waiting 8s for retry backoff ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
#> Waiting 8s for retry backoff ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
stations
#> # A tibble: 947 × 7
#> indicativo indsinop nombre provincia altitud longitud latitud
#> <chr> <chr> <chr> <chr> <dbl> <dbl> <dbl>
#> 1 B013X "08304" ESCORCA, LLUC ILLES BA… 490 2.89 39.8
#> 2 B051A "08316" SÓLLER, PUERTO ILLES BA… 5 2.69 39.8
#> 3 B087X "" BANYALBUFAR ILLES BA… 60 2.51 39.7
#> 4 B103B "" ANDRATX - SANT ELM ILLES BA… 52 2.37 39.6
#> 5 B158X "" CALVIÀ, ES CAPDELLÀ ILLES BA… 50 2.47 39.6
#> 6 B228 "08301" PALMA, PUERTO ILLES BA… 3 2.63 39.6
#> 7 B236C "" PALMA, UNIVERSITAT ILLES BA… 95 2.64 39.6
#> 8 B248 "08303" SIERRA DE ALFABIA, BU… ILLES BA… 1030 2.71 39.7
#> 9 B278 "08306" PALMA DE MALLORCA, AE… BALEARES 5 2.74 39.6
#> 10 B275E "08302" SON BONET, AEROPUERTO BALEARES 47 2.71 39.6
#> # ℹ 937 more rows
# Cached during this R session
stations2 <- aemet_stations(verbose = TRUE)
#> Loading stations from temporal cached file saved at 2025-06-25 14:41:03 UTC
identical(stations, stations2)
#> [1] TRUE