Searches for stations in NOAA's National Centers for Environmental Information (NCEI) using the Common Access Search Service API.
Usage
ncei_stations(
dataset,
bbox = NULL,
start_date = NULL,
end_date = NULL,
data_types = NULL,
text = NULL,
limit = 100L,
offset = 0L
)Arguments
- dataset
Character string. The dataset to search within, such as
"daily-summaries"(GHCND) or"global-hourly"(ISD). Seencei_datasets()for more dataset identifiers.- bbox
Optional numeric vector of length 4 specifying the geographic search area as
c(north, west, south, east)in decimal degrees. North and south must be between -90 and 90; west and east between -180 and 180. WhenNULLno geographic filter is applied.- start_date, end_date
Optional date range filter. Only stations with data overlapping this period are returned. Accepts
Dateobjects or"YYYY-MM-DD"strings.- data_types
Optional character vector of data type codes. Only stations that include all requested types are returned.
- text
Optional character string. Filters results to stations whose names contain this text.
- limit
Integer. Maximum number of stations to return per page (default 100, max 1000).
- offset
Integer. Zero-based pagination offset (default 0).
Value
A tibble with one row per station and the following columns:
station_idStation identifier (dataset prefix stripped, e.g.,
"USW00023183"rather than"GHCND:USW00023183").nameStation name.
latitude,longitudeDecimal-degree coordinates.
elevationElevation in metres.
start_date,end_datePeriod of record as
Dateobjects.data_coverageFraction of expected observations present (0–1).
Details
This function calls
https://www.ncei.noaa.gov/access/services/search/v1/data.
To find stations near a specific point, compute a bounding box with
ncei_bbox() and pass it to bbox. For site-level station searches
prefer closest_noaa_stations(), which computes the bounding box
automatically and filters by geodesic distance.