66
77## Latest Announcements
88
9- :mega : ** 11/24 /2025:** ` dataretrieval ` now features the new ` waterdata ` module,
9+ :mega : ** 12/03 /2025:** ` dataretrieval ` now features the new ` waterdata ` module,
1010which provides access to USGS's modernized [ Water Data
1111APIs] ( https://api.waterdata.usgs.gov/ ) . The Water Data API endpoints include
1212daily values, instantaneous values, field measurements, time series metadata,
@@ -69,27 +69,27 @@ input argument indicates a desired date range:
6969from dataretrieval import waterdata
7070
7171# Get daily streamflow data (returns DataFrame and metadata)
72- df , metadata = waterdata.get_daily(
72+ daily , metadata = waterdata.get_daily(
7373 monitoring_location_id = ' USGS-01646500' ,
7474 parameter_code = ' 00060' , # Discharge
7575 time = ' 2024-10-01/2025-09-30'
7676)
7777
78- print (f " Retrieved { len (df )} records " )
79- print (f " Site: { df [' monitoring_location_id' ].iloc[0 ]} " )
80- print (f " Mean discharge: { df [' value' ].mean():.2f } { df [' unit_of_measure' ].iloc[0 ]} " )
78+ print (f " Retrieved { len (daily )} records " )
79+ print (f " Site: { daily [' monitoring_location_id' ].iloc[0 ]} " )
80+ print (f " Mean discharge: { daily [' value' ].mean():.2f } { daily [' unit_of_measure' ].iloc[0 ]} " )
8181```
8282Fetch daily discharge data for multiple sites from a start date to present
8383using the following code:
8484
8585``` python
86- df , metadata = waterdata.get_daily(
86+ daily_twosites , metadata = waterdata.get_daily(
8787 monitoring_location_id = [" USGS-13018750" ," USGS-13013650" ],
8888 parameter_code = ' 00060' ,
8989 time = ' 2024-10-01/..'
9090)
9191
92- print (f " Retrieved { len (df )} records " )
92+ print (f " Retrieved { len (daily_twosites )} records " )
9393```
9494The following example downloads location information for all monitoring
9595locations that are categorized as stream sites in the state of Maryland:
@@ -103,6 +103,21 @@ locations, metadata = waterdata.get_monitoring_locations(
103103
104104print (f " Found { len (locations)} stream monitoring locations in Maryland " )
105105```
106+ Finally, this example downloads continuous (a.k.a. "instantaneous") data
107+ for one monitoring location over one year. You are * strongly advised* to
108+ break up continuous data requests into smaller time periods and smaller
109+ collections of sites to avoid timeouts and other issues:
110+
111+ ``` python
112+ # Get continuous data for a single monitoring location and water year
113+ continuous, metadata = waterdata.get_continuous(
114+ monitoring_location_id = ' USGS-01646500' ,
115+ parameter_code = ' 00065' , # Gage height
116+ time = ' 2024-10-01/2025-09-30'
117+ )
118+ print (f " Retrieved { len (continuous)} continuous gage height measurements " )
119+ ```
120+
106121Visit the
107122[ API Reference] ( https://doi-usgs.github.io/dataretrieval-python/reference/waterdata.html )
108123for more information and examples on available services and input parameters.
@@ -202,13 +217,13 @@ print(f"Found {len(flowlines)} upstream tributaries within 50km")
202217
203218### Modern USGS Water Data APIs (Recommended)
204219- ** Daily values** : Daily statistical summaries (mean, min, max)
220+ - ** Instantaneous values** : High-frequency continuous data
205221- ** Field measurements** : Discrete measurements from field visits
206222- ** Monitoring locations** : Site information and metadata
207223- ** Time series metadata** : Information about available data parameters
208224- ** Latest daily values** : Most recent daily statistical summary data
209225- ** Latest instantaneous values** : Most recent high-frequency continuous data
210226- ** Samples data** : Discrete USGS water quality data
211- - ** Instantaneous values** (* COMING SOON* ): High-frequency continuous data
212227
213228### Legacy NWIS Services (Deprecated)
214229- ** Daily values (dv)** : Legacy daily statistical data
0 commit comments