API Reference

Documentation for DataRetrieval.jl's public functions.

Index

DataRetrieval.NWIS — Module
module NWIS

Provides functions for retrieving legacy data from the National Water Information System (NWIS). Includes functions to retrieve daily values (dv), instantaneous values (iv), and site metadata.

Note: Legacy NWIS services are being decommissioned by the USGS. Users are encouraged to migrate to the modernized DataRetrieval.WaterData functions (e.g., WaterData.daily, WaterData.continuous, WaterData.samples) which use the new Water Data APIs.

DataRetrieval.WQP — Module
module WQP

Provides functions for retrieving data from the Water Quality Portal (WQP). Includes functions to retrieve results, sites, organizations, projects, activities, detection limits, habitat metrics, project weights, and activity metrics.

DataRetrieval.WaterData — Module
module WaterData

Provides functions for retrieving data from the modernized USGS Water Data API and Samples API. Includes functions for generic OGC API retrieval, daily values (daily), continuous values (continuous), monitoring locations, field measurements, series metadata, and chemical sample results (samples, results).

DataRetrieval.NLDI — Module
module NLDI

Provides functions for retrieving data from the Network Linked Data Index (NLDI) API. Includes functions to navigate flowlines (flowlines), find upstream/downstream basin boundaries (basin), and discover linked features (features and search).

Note: If you wish to receive spatial features as genuine GeoDataFrames instead of standard Julia DataFrames containing raw GeoJSON geometries, you must add and load GeoDataFrames.jl in your environment (using GeoDataFrames).

NWIS Functions

Functions that are related to the National Water Information System (NWIS).

DataRetrieval.NWIS.url — Function
url(site_numbers; kwargs...)

Function to construct a Nwis URL based on the different available parameters.

DataRetrieval.NWIS.dv — Function
dv(site_numbers, parameter_cd; start_date="", end_date="", stat_cd="00003", format="rdb")

Function to obtain daily value data from the Nwis web service.

DataRetrieval.NWIS.pcode — Function
pcode(pcodes)

Function to obtain parameter code information from the Nwis web service.

DataRetrieval.NWIS.site — Function
site(site_numbers)

Function to obtain site information from the Nwis web service.

DataRetrieval.NWIS.unit — Function
iv(site_numbers, parameter_cd; start_date="", end_date="", format="rdb")

Function to obtain instantaneous value data from the Nwis web service.

DataRetrieval.NWIS.uv — Function
iv(site_numbers, parameter_cd; start_date="", end_date="", format="rdb")

Function to obtain instantaneous value data from the Nwis web service.

DataRetrieval.NWIS.iv — Function
iv(site_numbers, parameter_cd; start_date="", end_date="", format="rdb")

Function to obtain instantaneous value data from the Nwis web service.

WQP Functions

Functions that are related to the Water Quality Portal.

DataRetrieval.WQP.url — Function
url(service; legacy=true)

Function to construct the URL for the Wqp service.

WaterData Functions

Functions that are related to the USGS Water Data APIs.

DataRetrieval.WaterData.samples — Function
samples(; ssl_check=true, service="results", profile="fullphyschem", kwargs...)

Flexible query of the USGS Samples database.

DataRetrieval.WaterData.data — Function

data(service; cql=nothing, ssl_check=true, kwargs...)

Generalized USGS Waterdata OGC retrieval for any supported collection.

DataRetrieval.WaterData.ogc_requests — Function
ogc_requests(; endpoint="daily", request_type="queryables", ssl_check=true)

Request OGC collection metadata (queryables or schema) for a Waterdata collection.

DataRetrieval.WaterData.ogc_params — Function

ogcparams(service; sslcheck=true)

Get parameter descriptions for a Waterdata OGC collection using the collection schema endpoint.

DataRetrieval.WaterData.daily — Function
daily(; ssl_check=true, kwargs...)

Get daily observations from the USGS Waterdata OGC API (daily collection).

DataRetrieval.WaterData.continuous — Function
continuous(; ssl_check=true, kwargs...)

Get continuous observations from the USGS Waterdata OGC API (continuous collection).

DataRetrieval.WaterData.stats_por — Function
stats_por(; ssl_check=true, expand_percentiles=true, kwargs...)

Query period-of-record statistics from the Waterdata statistics API.

NLDI Functions

Functions that are related to the USGS NLDI API.

DataRetrieval.NLDI.flowlines — Function
flowlines(navigation_mode; comid=nothing, distance=5, feature_source=nothing, feature_id=nothing, stop_comid=nothing, trim_start=false, as_json=false)
DataRetrieval.NLDI.basin — Function
basin(feature_source, feature_id; simplified=true, split_catchment=false, as_json=false)
DataRetrieval.NLDI.features — Function
features(; data_source=nothing, navigation_mode=nothing, distance=50, feature_source=nothing, feature_id=nothing, comid=nothing, lat=nothing, long=nothing, as_json=false)
DataRetrieval.NLDI.search — Function
search(; feature_source=nothing, feature_id=nothing, navigation_mode=nothing, data_source=nothing, find="features", comid=nothing, lat=nothing, long=nothing, distance=50, as_json=false)
DataRetrieval.set_token! — Function
set_token!(token::AbstractString)

Set a USGS WaterData API token for this Julia session. The token is attached to requests as the X-Api-Key header and takes precedence over the API_USGS_PAT environment variable.

DataRetrieval.clear_token! — Function
clear_token!()

Clear the session token set by set_token!. If API_USGS_PAT is present in the environment, requests will continue to use that value.