Data Web Services
Web Services for Automated Data Retrieval
Northern Water provides Kisters Water Information System (KiWIS) Web Services for users who require automated data retrieval in a variety of formats, including CSV, ASCII, HTML and XLSX. These services allow direct access to both timeseries and discrete water quality data. Users can find examples of commonly used queries on this page, broken into two sections; timeseries and water quality data types. In addition, additional configuration options and full service documentation are available through the KiWIS request information page.
Timeseries Data Structure and Examples
Northern Water's API structure follows the database's hierarchical structure and consists of three main levels: Station, Parameter and Timeseries. Calls are typically structured as either a discovery query, where the upper hierarchy is used, or a result query, where timeseries values are used.
- Station – A specific monitoring location within a site. Stations have unique names and numbers and represent distinct physical or analytical locations.
- Parameter – A measured variable at a station, such as Water Temperature (WT) or Flow (Q).
- Timeseries – A dataset associated with a parameter, often separate timeseries are available for multiple intervals (e.g., 15-minute and daily).
Web Service Query Examples
Get Station List
This query returns metadata for all stations, including stations with timeseries data and water quality data. The parameter request=getStationList retrieves all stations because no Site_no is specified. The format= field controls the output type, and returnfields= limits the columns returned. Setting AddLinks=TRUE adds hyperlinks to additional information, including:
- Timeseries_href – Lists all available time series for the station. If Timeseries_href is blank, the station contains only discrete water quality data.
- Station_href – Returns full station metadata.
- Example Query: https://data.northernwater.org/KiWIS/KiWIS?service=kisters&type=queryServices&request=getStationList&datasource=0&format=html&returnfields= site_name,station_no,station_name&Addlinks=TRUE
To view all metadata and custom attributes at the station level, add ca_sta argument.
Get Timeseries List
Changing the request to request=getTimeseriesList returns all parameters and timeseries associated with a specific station. The added metadata field “coverage” provides the period of record of datya availability for that timeseries. Adding dateformat=yyyy-MM-dd HH:mm:ss standardizes date formatting. When AddLinks=TRUE, the response includes hyperlinks to graphs and time series lists for various time periods.
Get Timeseries Values
To retrieve values, use the request: request=getTimeseriesValues. Specify the desired timeseries using the unique timeseries ID number ts_id= that was returned in the getTimeseriesList call. Time periods may be defined using:
The following combinnations of time periods can be requested.
| Time Period Prompt | Results |
|---|---|
| from + to | will search the requested range |
| from + period | will search the given period starting at the from date |
| to + period | will search the given period backdating from the to date |
| period | will search the given period backdating from the current system time |
| period=complete | will search the complete coverage |
| from | will search all data starting at the given from date until the current system time |
| to | will search all data until the given to date |
Add metadata=true and specify metadata fields with md_returnfields=.
- Example Query: https://data.northernwater.org/KiWIS/KiWIS?service=kisters&type=queryServices&request=getTimeseriesValues&datasource=0&format=html&ts_id= 28720010&period=P30d&metadata=true&md_returnfields=station_name,station_latitude,station_longitude,ts_shortname,stationparameter_name,
ts_unitname,ts_unitsymbol&dateformat=yyyy-MM-dd%20HH:mm:ss
The above query is requesting html data (format=html) for the timeseries values (request=getTimeseriesValues) for the timeseries EI-GLU Discharge (ts_id=28720010), for the last 30 days (period=P30d), with metadata included and the date following a YYYY-MM-DD HH:mm:ss format.
To include data quality and remarks, specify returnfields= and include:
- Timestamp- the Date and Time
- Value- Reported value for the Timestamp
- Quality%20Code- Northern Water’s unique quality code
- Timeseries%20Comment – Any comments from Norther Water associated with the data.
- Example Query: https://data.northernwater.org/KiWIS/KiWIS?service=kisters&type=queryServices&request=getTimeseriesValues&datasource=0&format= html&ts_id=28720010&period=P30d&metadata=true&returnfields=Timestamp,Value,Quality%20Code,Timeseries%20Comment&dateformat=yyyy-MM-dd%20HH:mm:ss
Water Quality Data Structure and Examples
Northern Water's Water Quality API and database follows a hierarchical structure consisting of seven levels: Monitoring Program, Station, Sampling Event, Sample Location, Sample, Sample Result.
- Monitoring Program – Groups of stations and for which data is collected for a program specific goal, such as baseline monitoring, or NISP compliance monitoring.
- Station – A specific monitoring location. Stations have unique names and numbers and represent distinct physical or analytical locations.
- Sampling Event – Specific date of field staff visiting a station per monitoring program guidelines.
- Sample Location – Categories of sample position. These groupings include flowing to represent near surface samples in rivers and streams, reservoir locations include Surface, Bottom, Secchi and physical are their own groupings API, is this wqm_spot_label.
- Sample – Within a sampling event, a sample represents a unique discrete sample physically collected in the field (including some QA samples such as SQR’s etc). If a sample has any indicated “replicate” samples, these represent duplicate lab analysis of the original sample. Replicates can be identified in the column sample_consecutive_no.
- Sample Result – A individual station, datetime, constituent and method combination within a sample bottle.
Get Water Quality Measuring Program List
The request=getWqmMeasuringProgramList returns all stations with discrete sample values.
- Example Query: https://data.northernwater.org/KiWIS/KiWIS?format=html&request=getWqmMeasuringProgramList
Get Water Quality Discrete Station List
The request=getWqmStationList returns all stations with discrete sample values. Use returnfields= to limit the output.
- Example Query: https://data.northernwater.org/KiWIS/KiWIS?format=html&request=getWqmStationList&returnfields=site_name,station_no,station_name
Get Sample Values
To retrieve discrete water quality sample values, change the request to request=getSampleValues, and you will need to enter the station_no= to return values and metadata. Use dateformat= to standardize timestamps.
To include all recommended Northern Water metadata, make sure queries include:
- station_name- name of the station
- sample_timestamp- date and time when the sample was collected
- parametertype_name - constituent name
- wqm_trace_no – Northern Water sampling event number consisting of the unique station ID and datetime combination for the sample
- wqm_spot_label- Location of sample collection
- sample_depth- Depth of sample, if a composite sample, start depth in interval
- sample_final_depth- Final depth if a composite sample, bottom depth in interval
- value_sign – shows if sample value is less than minimum detection limit (MDL)
- value - reported value for the timestamp
- unit_symbol – unit symbol associated with sample value
- value_labcode- descriptive laboratory flag individual sample results
sample_consecutive_no – numeric indicator of replicate sample
- sample_no - sample number where replicate type (SQR/CR) is indicated
- value_stdremark –standard remarks associated with the sample value
- value_remark- free comment associated with the sample value
- value_quality- quality code associated with sample value
- value_lower_dlimit – laboratory detection limit
- laboratory_name – name of the laboratory conducting the analysis
- value_labcomment – free comment from the laboratory associated with sample analysis
- is_replicate- numeric indicator for lab duplicate. Original is a 1, lab dup is a 2
- Example Query: https://data.northernwater.org/KiWIS/KiWIS?datasource=0&format=html&period=P1Y&request=getwqmsamplevalues&service=kisters&station_no=FS-0154&type=queryServices&returnfields=station_name,sample_timestamp,parametertype_name,wqm_trace_no,wqm_spot_label,sample_depth,sample_final_depth,
value_sign,value,unit_symbol,value_labcode,sample_no,value_stdremark,value_remark,value_quality,value_lower_qlimit,value_lower_dlimit,laboratory_name,
value_labcomment,sample_consecutive_no&dateformat=yyyy-MM-dd%20HH:mm:ss
Other fields that may be of interest:
- ca_wqmsample – returns all custom attributes built for northern water; including sampling equipment and wind and sky conditions.
- wqm_trace_team- Sampling Team