API middleware

HydroSOS has developed a middleware API that enables each product's point data to be output in a common JSON format for easier ingestion into other portals. Note that if you already are familiar with the native dataset, then it may be quicker to use this.

Not all graph types, data types and periods are available for every dataset. Look at the dataset's variables, data resolution and graph types to build your query.

The original URLs for each dataset's data are provided.

Get datasets (products)

/datasets

Get a dataset by ID

Pass in a dataset ID.

/dataset?datasetID=ina

Get sites for dataset

Pass in a dataset ID and variable (returns GeoJSON).

/pointData?datasetID=chmi&variable=river-flows

Get data for dataset variable for date

Pass in a dataset ID, variable, date, type (status, outlook), period (daily or monthly).

/pointDataForDate?datasetID=ukceh&variable=river-flows&date=2024-03&type=status&period=monthly

Get timeseries (categoried) for site

Pass in a dataset ID, variable ID, site ID, graph type (counts, ensembles percentages,values), period (daily or monthly).

/timeseries?datasetID=usgs&variable=river-flows&siteID=01578310&&type=values&forecastDate=202404&period=daily