REST Web Services

USGS Daily Values Web Service URL Generation Tool

This tool provides a simple way to generate syntactically correct URLs to use with the USGS Daily Values web service. Use it to get comfortable with the service before creating your own applications. Press the question mark icon for help with a particular field.

URL argument names and values are not case sensitive, ex: ?stateCd=ny, ?STATECD=ny, ?statecd=NY can all be used and are equivalent. See the full service description for details.

Simply enter the values you want in the fields below. Press Generate the URL button at the bottom to get the resulting URL. To see the results in your browser, next press the Run the Generated URL button.

You must have Javascript enabled for your browser to use this tool.

REQUIRED ARGUMENTS:

Major Filters:Show or hide major filter help

You must select one of the following major filters. A major filter is required to limit the list of sites and associated data that can be retrieved, ensuring fair access to the service.





Show or hide site help
You can use either site or sites for the URL argument name. sites corresponds to one or more site numbers. Separate sites with commas. The number of site you can specify is unconstrained, but are subject to limits on URL lengths supported by your browser and the application server. The site number may be optionally prefixed by the agency code followed by a colon, which ensures the site is unique. Examples: ?site=06306300 or ?sites=USGS:06306300. There is no default if this argument is used. Site numbers range from 8 to 15 characters. To find sites of interest, we suggest using the NWIS Mapper External Link.
Show or hide state help
URL argument name is stateCd. You may select no more than one state or territory. Example: ?stateCd=ny
Show or hide HUC help

URL argument name is huc. You can specify one major hydrologic unit code (2 digit code) and up to 10 minor hydrologic unit codes (8 digit codes). Separate HUCs with commas. For performance reasons, no more than one major HUC is allowed. Complete list of HUCs. External Link Note: not all sites have been associated with a hydrologic unit. As such those sites cannot be retrieved with this method. Example: ?huc=01,02070010

Show or hide Latitude/Longitude help

URL argument name is bBox for bounding box. The argument is a pair of four numbers separated by commas, beginning with the western longitude, then the southern latitude, then the eastern longitude, then the northern latitude. Note: to ensure fair access, the product of the range of latitude and longitude cannot exceed 25 degrees. Use decimal degrees rather than degrees, minutes and seconds. Decimals are not required. Up to seven digits of precision are allowed. Longitude is in the range of -180 to 180, latitude from -90 to 90. Remember, in the Western hemisphere, longitude is expressed in negative numbers. Example: ?bBox=-83,36.5,-81,38.5

Note: many sites outside the continental US do not have latitude and longitude referenced to NAD83 and therefore can not be found using these arguments. Certain sites are not associated with latitude and longitude due to homeland security concerns and cannot be found using this filter.






Show or hide county help
URL argument name is countyCd. Enter a list of county codes, separated by commas. There is no default. The county code is actually the state code External Link (digits 1-2) plus the associated county number (digits 3-5). For performance reasons, you may enter no more than 20 county codes. Example: ?countyCd=51059,51061 retrieves sites in Fairfax and Prince William counties in the state of Virginia. Reference External Link.


OPTIONAL ARGUMENTS:
Show or hide format help

URL argument name is format. Select the output format desired. If there is no format argument in the generated URL, the most currently supported version of USGS RDB format is returned. Example: &format=rdb. Note: GML will become the default output format once it is available. Formats available:

  • waterml - WaterML External Link, an XML schema published by the Open Geospatial Consortium. Version 2.0 is available. Version 1.1 is depreciated.
  • rdb - a self-describing tab-delimited format used widely by the USGS, documented in a PDF file here External Link (Adobe Acrobat Reader External Link). Version is 1.0.
  • json - The most currently supported version of WaterML translated into Javascript Object Notation External Link. The current version of WaterML will be rendered in a JSON structure as a set of name/value pairs. Note: JSON is returned with an application/json MIME type.

The version of the format wanted, if available, can be appended using the syntax: &format=<format_type>,<version_number>. The version number is optional but its use is encouraged because it means your application is less likely to break. If you do not specify the version number in your syntax, the most recently implemented version in that format will be returned instead.

Show or hide indent help
URL argument name is indent. Used to specify whether block structured data formats (&format=waterml and json only) should include indentation for easy viewing. Four space characters are inserted for every level of indentation. Otherwise the parameter is ignored. The default is off.


OPTIONAL FILTERS:

Optional filters, if used, further reduce the list of sites returned.

Date ranges:Show or hide date range help
URL argument names used include period, startDt and endDt depending on the type of date retrieval desired. If no date range is specified, the most current values at each site are retrieved. Optionally, you can request a range of values from now (a relative range), or from some start and end date that you specify (an absolute range).


Show or hide period help
URL argument name is period. Use only a positive ISO-8601 duration format External Link, which should not be expressed in periods of less than a day, or in increments of months (M) or years (Y). period returns data for a site generally from now to a time in the past. For format examples, click here External Link, ex: &period=P2D goes back two days from now, and &period=P52W goes back one about one year. Note that when period is used all data up to the most recent value are returned. In the case of a predictive gage, you may get predicted values in the future.
Show or hide Start Date help
URL argument name is startDT. Use the ISO-8601 date format External Link. Examples: &startDT=1990-01-01. Specify a date only. Hours, minutes, seconds and timezone values are not allowed. If startDt is specified but endDt is not, endDt is assumed to be today's date. startDt must always be specified.
Show or hide End Date help
URL argument name is endDT. Use the ISO-8601 date format External Link. Examples: &endDT=1999-12-31. Specify a date only. Hours. minutes, seconds and timezone values are not allowed.
Show or hide Modified Since help

URL argument name is modifiedSince. For any retrieval, you can use this argument to request to return values for all requested sites only if any the values in the modifiedSince date range. This is useful if you periodically need to poll a site but are only interested in processing data if some of it has changed. Use the ISO-8601 duration format External Link. If the modifiedSince argument is not specified in the generated URL, it has no effect on the query. Do not specify ranges in months or years, as these time increments vary and are thus nondeterministic.

Partial URL examples:

  • ?stateCd=NY&period=P7D&modifiedSince=PT2H returns all values for sites in NY for the last seven days from now if and only if any values were modified during the last two hours.
  • ?stateCd=NY&startDt=2010-09-01&endDt=2010-09-03&modifiedSince=PT2H inclusively returns all values for sites in NY for this date range if and only if any of the values were modified in the last two hours.
  • ?stateCd=NY&startDt=2010-09-01&modifiedSince=PT2H returns daily values for all sites in NY from 2010-09-01 up to the most recent value if and only if any of the values in this date range were modified in the last two hours.
  • ?stateCd=NY&modifiedSince=PT2H Since period, startDt or endDt are not used, the latest values for NY all time-series sites are retrieved only if any values at these sites were updated in the last two hours.


Show or hide parameter code help
URL argument name is statCd. Statistics codes are values that are calculated for the day and vary by USGS parameter. They typically include mean, minimum and maximum, such as mean (average) streamflow for the day. If you specify a statistics code, it will be used for all USGS parameters, if the statistic exists. Complete list of statistics codes External Link. Up to 20 statistics codes allowed per request. The default is all, which can be specified if desired, ex: &statCd=all.
Show or hide parameter code help
URL argument name is siteStatus. The site status indicates whether the site is active or inactive. If a site is active, it implies that it is being actively maintained. A site is considered active if:
  • it has collected time-series (automated) data within the last 183 days (6 months)
  • it has collected discrete (manually collected) data within 397 days (13 months)

If it does not meet these criteria, it is considered inactive. Some exceptions apply. If a site is flagged by a USGS water science center as discontinued, it will show as inactive. A USGS science center can also flag a new site as active even if it has not collected any data.

The default is all (both active and inactive sites). Example: &siteStatus=active

Show or hide site type help
URL argument name is siteType. You can filter for sites with certain site types. If the siteType argument does not appear in the URL, then by default all site types will be shown. Hold down CTRL/CMD to select more than one site type. The default is all. Note: if you select a major site type (like Stream) you will get its minor site types (canal, ditch and tidal stream) by default even if you do not select them.

Show or hide agency code help
URL argument name is agencyCd, which indicates the organization maintaining or funding the sites. You can filter to show only sites with one specific agency code. For example, ?stateCd=tx&agencyCd=USCE would return sites in Texas for the U.S. Army Corps of Engineers only. By default if agencyCd does not appear in the URL then sites with any agency code are returned. Agency codes are 3-5 characters long with most being 5 characters in length. List of agency codes External Link.
Show or hide altitude help

URL argument names are altMin and altMax. Enter the minimum and/or maximum altitude in feet for the sites you want retrieved. Decimal values are allowed. If both are specified, altitudes between the minimum and maximum altitudes are included. Maximum altitude must be greater than or equal to minimum altitude. Values are inclusive, so if you specify altMin at 1000 feet, you will get sites at exactly 1000 feet or more. Selecting sites based on a desired altitude datum is presently not possible. If you leave these arguments blank, site altitude is ignored. Example: ?altMin=1000&altMax=1500.
Show or hide parameter code help
URL argument names are variable or parameterCd. In this case, parameterCd means a USGS parameter, and indicates some aspect of the site being measured or calculated, such as streamflow. If parameterCd or variable is specified in the generated URL, only sites serving those parameters are returned. To specify more than one parameter code, separate with commas, ex: &variable=00060,00065. Complete list of parameter codes External Link. Up to 100 parameter codes allowed per request. The default is all, which can be specified if desired, ex: &variable=all.
Show or hide aquifer help
Parameter name is aquiferCd. Use this to filter sites that exist in specified national aquifers. Note: not all sites have been associated with national aquifers. Enter one or more national aquifer codes, separated by commas. A national aquifer code is exactly 10 characters. A complete list of national aquifer codes can be found here . Example: &aquiferCd=S500EDRTRN,N100HGHPLN returns groundwater sites for the Edwards-Trinity aquifer system and the High Plains national aquifers. The default is all, which means the results are not filtered to exclude any aquifer codes. It can be specified if desired, however, if a list is provided you cannot exceed 1000 aquifer codes. ex: &aquiferCd=all.
Show or hide local aquifer help

Parameter name is localAquiferCd. Use this to filter sites that exist in specified local aquifers. Note: not all sites have been associated with local aquifers. Enter one or more local aquifer codes in the field, separated by commas. A local aquifer code is 10 characters, beginning with the state's abbreviation followed by a colon followed by the local aquifer code. A complete list of local aquifer codes can be found here. To translate the state code associated with the local aquifer, you may need this reference. Example: &localAquiferCd=AL:111RGLT,AL:111RSDM returns groundwater sites for the Regolith and Saprolite local aquifers in Alabama. The default is all, which means the results are not filtered to exclude any local aquifer codes. It can be specified if desired, however, if a list is provided you cannot exceed 1000 local aquifer codes. ex: &localAquiferCd=all.
Surface Water Attributes:
Show or hide drainage area help
URL argument names are drainAreaMin and drainAreaMax. These arguments allows you to select surface water sites where the associated sites' drainage areas (watersheds) are within a desired size, expressed in square miles. Decimal values are allowed. If neither are specified, drainage area is ignored. If both the minimum and maximum drainage area are specified, sites between the minimum and maximum drainage areas specified are returned. If only one is provided, then only sites at or above the minimum drainage area or at or below the maximum drainage area are returned. Caution: not all sites are associated with a drainage area. Since drainage area only applies to surface water sites, this should not be used with groundwater sites other than springs. Example: &drainAreaMin=1000&drainAreaMax=5000


Groundwater Attributes:
Show or hide well depth help
URL argument names are wellDepthMin and wellDepthMax. These arguments allows you to select finished wells with the desired depth from the land surface datum, expressed in feet. Decimal values are allowed. If neither are specified, well depth is ignored. If both the minimum and maximum well depths are specified, then sites between the minimum and maximum well depth are returned. If only one is provided, then only sites at or above the well depth or at or below the well depth are returned. Example: &wellDepthMin=500&wellDepthMax=1000
Show or hide well depth help
URL argument names are holeDepthMin and holeDepthMax. These arguments allows you to select sites where the hole was initially drilled within a given range, with the depth from the land surface expressed in feet. Decimal values are allowed. If neither are specified, hole depth is ignored. If both the minimum and maximum hole depths are specified, sites between the minimum and maximum hole depth are returned. If only one is provided, then only sites at or above the hole depth or at or below the hole depth are returned. Example: &holeDepthMin=500&holeDepthMax=1000

Caution: queries that return large sets of data may cause your browser to slow down or lock as it attempts to download and format large sets of data for display. When testing services in a browser, it is suggested that you create queries that should return relatively small sets of data. When creating an application you will typically use a program like curl , wget or the Windows task scheduler to retrieve data, which should acquire data more quickly than a browser.

(Note: if you do not see the XML in the output, please View Source.)