Retrieval functions for USGS and EPA hydrologic and water quality data.

Linux: travis

Windows: Build status

Package Installation

To install the dataRetrieval package, you must be using R 3.0 or greater and run the following command:


To get inter-CRAN release updates, use the command:


Function Overview

Web service retrieval functions:

Function Inputs Description
readNWISdata ..., service NWIS data using user-specified queries
readNWISdv Common 3, parameterCd, statCd NWIS daily data with Common query
readNWISqw Common 3, parameterCd, expanded,reshape,tz NWIS water quality data with Common query
readNWISuv Common 3, parameterCd,tz NWIS instantaneous data with Common query
readNWISpCode parameterCd NWIS parameter code information
readNWISgwl Common 3 NWIS groundwater level data with Common query
readNWISpeak Common 3,asDateTime NWIS peak flow data with Common query
readNWISmeas Common 3, tz NWIS surface-water measurement data with Common query
readNWISrating siteNumber, type NWIS rating table for an active USGS streamgage
readNWISsite siteNumber NWIS site information
whatNWISsites ... NWIS site search using user-specified queries
whatNWISdata siteNumber, service NWIS data availability, including period of record and count
readWQPdata ... WQP data using user-specified queries
readWQPqw Common 3, parameterCd**,tz | WQP data with Common 3 query and either parameter code or characteristic name| |whatWQPsites | ... | WQP site search using user-specified queries |

**parameterCd in WQP function can be either USGS parameter codes, or EPA characteristic names

Reporting bugs

Please consider reporting bugs and asking questions on the Issues page:


Please email questions, comments, and feedback to:

Additionally, to subscribe to an email list concerning updates to these R packages, please send a request to

##Latest Version Updates

dataRetrieval 2.2.0


This software is in the public domain because it contains materials that originally came from the U.S. Geological Survey, an agency of the United States Department of Interior. For more information, see the official USGS copyright policy

Although this software program has been used by the U.S. Geological Survey (USGS), no warranty, expressed or implied, is made by the USGS or the U.S. Government as to the accuracy and functioning of the program and related program material nor shall the fact of distribution constitute any such warranty, and no responsibility is assumed by the USGS in connection therewith.

This software is provided "AS IS."


CRAN statistics: