gagelink

v0.7.0
io.github.Adeniyikayodee/gagelink Checked 1 day ago Published 2 months ago

River level, streamflow, floods and basins from USGS, NOAA, Hub'Eau, UK Environment Agency, SWOT

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

find_locations Find monitoring locations

Search monitoring locations by state, county, hydrologic unit, site type, or bounding box. At least one filter is required. Returns identifiers of the form USGS-01646500, which every other tool takes. Pass country=FR to search the French network by river name, commune, department, or bbox, or country=GB for the Environment Agency by river, town, or station name.

ParameterTypeDescription
bboxstringwest,south,east,north in decimal degrees
countrystringWhich network to search, since a search has no identifier to read an agency from. US is USGS; FR is the French Hub'Eau network, where state is the region, county the commune, and hydrologic_unit_code…
countystringFull county name
hydrologic_unit_codestringHUC, any level
limitinteger
riverstringWatercourse name, as the agency writes it: La Seine or Le Rhone with the article in France, River Thames with the word river in the UK. France and the UK only; the USGS collection has no river-name fi…
site_typestringAs in Stream, Lake, Well
statestringFull state name, as in Maryland

describe_location Describe a location

Metadata for one monitoring location: its name, position, drainage area, timezone, the vertical datum its stage readings are measured from, and how well that offset is known. Call this before comparing any stage against an elevation, because the answer depends on the offset it returns. Most US stations publish their offset on NGVD29 while modern surveys are on NAVD88; pass on_datum to have the offset converted before you difference anything. Takes a USGS identifier, an Environment Agency one as in EA-2604TH, or a Hub'Eau one as in FR-F700000102.

ParameterTypeDescription
identifier *string
on_datumstringAlso return the station's offset expressed on this datum, with the uncertainty of the conversion. NAVD88 is what a modern survey or lidar product is on, and most stations publish their offset on NGVD2…

get_latest Latest readings

The most recent value the service holds for each parameter at a location. Latest is not the same as current: the service returns the last value it has for each parameter independently, so one response can carry a discharge from this morning beside a turbidity from years ago. Pass max_age_hours to drop the stale ones. Values arrive with their unit, datum, and whether the record is provisional or approved. Takes a USGS identifier, an Environment Agency one as in EA-2604TH, or a Hub'Eau one as in FR-F700000102, whose values are published with no unit at all and are labelled here.

ParameterTypeDescription
identifier *string
max_age_hoursnumber
parametersarrayParameter codes, as in 00060 for discharge

get_series Time series

A date range of record, returned as a handle with a summary and a small sample rather than as its points, since a year of 15-minute record is 35,000 values. Use slice_series on the handle to narrow it. Resolution is daily or continuous.

ParameterTypeDescription
end *string
identifier *string
parameter *string
start *stringISO date, as in 2026-08-01
resolutionstring

slice_series Slice a series

Narrow a series already fetched under a handle and summarise what remains. Costs no request against the hourly allowance.

ParameterTypeDescription
handle *string
endstring
startstring

get_peaks Annual peak flows

Annual peak flow record for a location, largest first. A water year can carry more than one peak, so the count of peaks is not the count of years.

ParameterTypeDescription
identifier *string
limitinteger

get_forecast River forecast and flood thresholds

Observed and forecast stage from the NOAA National Water Prediction Service, with the flood thresholds that give them meaning. Stages and thresholds here are on the gage's own datum, so they can be differenced against each other and against a gage height, but not against a surveyed elevation without the offset from describe_location. Takes the USGS identifier or the NWS location id.

ParameterTypeDescription
identifier *string

get_model_forecast Modelled forecast

National Water Model streamflow for the reach a monitoring location sits on. These are modelled values, not measurements: the model covers reaches with no gauge on them, so a figure here may have nothing observed behind it, and it carries no record-quality grade. Series are analysis_assimilation, which looks back, and short_range, medium_range, medium_range_blend, and long_range, which look forward. Not every reach publishes every series.

ParameterTypeDescription
identifier *string
seriesstring

get_satellite_passes Satellite elevations

Water surface elevation measured from orbit by the SWOT mission, for a river reach. Covers reaches no gauge stands on. Elevations are referenced to the EGM2008 geoid, not to a national datum and not to any gage datum, so they cannot be differenced against a stage or a surveyed elevation. A reach identifier is a SWORD river reach id and is not a USGS station number.

ParameterTypeDescription
end *stringISO date
feature_id *stringSWORD reach id
start *stringISO date
on_datumstringAlso return each elevation moved onto this datum. Satellite elevations are on the EGM2008 geoid and can be differenced against nothing until they are moved off it. One conversion is taken for the reac…

navigate_network Navigate the river network

Monitoring locations upstream or downstream of a point, following the river rather than a radius. Direction is upstream, upstream_main, downstream, or downstream_diversions, where upstream includes tributaries and upstream_main follows the main stem alone.

ParameterTypeDescription
identifier *string
directionstring
distance_kmnumber
limitinteger

get_basin Contributing basin

The area draining to a point. The area is computed from the delineated boundary rather than published; where a site record also states a drainage area, that figure is surveyed and is the one to quote.

ParameterTypeDescription
identifier *string

lookup_parameter Look up a parameter code

Resolve a parameter code to what it measures, or find a code by name. Readings carry a code and no name, so this is how 00065 becomes gage height.

ParameterTypeDescription
query *string

export_manifest Export the session manifest

The record of this session: every request made, every quantity returned, and the library versions. Enough to re-run the work and check the numbers. Call it last when the answer needs to be reproducible.