USGS - science for a changing world

REST Web Services

USGS Groundwater Levels REST Web Service URL Generation Tool

This tool provides a simple way to generate syntactically correct URLs to use with the USGS Groundwater Levels REST web service. Please note: this service provides historical, manually recorded groundwater levels only, in many cases decades old. Groundwater levels recorded by automated equipment are not provided by this service, but recent automated groundwater levels are available using the instantaneous values web service.

Use this tool to get comfortable with this web 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.

(or just a single site)



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 measuring groundwater levels. Note that groundwater sites typically have a site number consisting of 15 digits, all numbers. Separate sites with commas. Any number of sites can be specified, up to the limits of your browser, the HTTP GET protocol and the capabilities of the USGS's appication server.The site number may be optionally prefixed by the agency code followed by a colon, which ensures the site is unique. Examples: ?site=375907091432201 or ?sites=USGS:375907091432201. There is no default if this argument is used. To find sites of interest, we suggest using the NWIS Mapper External Link. Make sure you select groundwater sites only. If searching for real-time groundwater levels, when at zoom level 11 or greater filter on Active Sites with Real-Time data.
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 (2 digit ) Hydrologic Unit code and up to 10 minor Hydrologic Unit codes. Separate HUCs with commas. For performance reasons, no more than one major HUC (a two digit code) is allowed. A minor HUCs must be 8 digits long. 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

Latitude/Longitude Box: 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, but only six decimals of precision will be used. 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 number (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.


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 WaterML is returned by default. Example: &format=waterml.

The version of the format wanted, if available, can be appended using the syntax: &format=<format_type>,<version_number>. The version number is optional. If you do not specify the version number in your syntax, the most recently implemented version in that format will be returned instead. In some cases, if there is no known version of a format, 1.2 is used to distinguish it. Note: the current version of WaterML is 1.1. WaterML 1.2 is an unofficial variant created by the USGS needed to accommodate the discrete data provided by this service, and is referenced in a USGS name space.See the warning on JSON before using this format.


Date Range: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 value at each site is retrieved. Optionally, you can request a range of values from now (a relative range), or from some start and end date/time that you specify (an absolute range). Currently, 120 days of values are available. If no date range is specified, only the most current values are returned. Note that only 120 days of instantaneous values are available, so queries beyond this date will not work.


Show or hide period help
URL argument name is period. Use only a positive ISO-8601 duration format External Link. period returns data for a site generally from now to a time in the past. Ex: &period=P30D goes back thirty days from now to the hour and minute, not to midnight of that day. Note that when period is used all data up to the most recent value is returned if it falls within the requested period range.
Show or hide Start Date help
URL argument name is startDT. It is recommended not to be more precise than a day, since groundwater levels typically do not include the time of day measured. Use the ISO-8601 date format External Link.

Example: &startDT=2010-07-01

With Start Date and End Date you can express an absolute site time period for retrieval. Start Date and End Date values are inclusive. For example, if you specify a Start Date of 2009-06-15 and a reading is available for this date, it will appear in the results.
Show or hide End Date help
URL argument name is endDT. It is recommended not to be more precise than a day, since groundwater levels typically do not include the time of day measured. Use the ISO-8601 date format External Link.

Example: &endDT=2010-07-01T.

If endDT is not provided with startDT, now is assumed. If a time zone is used, specify it in both the startDT and endDT arguments, otherwise a HTTP 400 error code is returned.
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 sites only if any any values for any site were changed 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.

Partial URL examples:

  • ?stateCd=NY&period=P1D&modifiedSince=PT2H returns values for all sites in NY for the last twenty four hours from now if and only if any values were modified during the last two hours. Otherwise a null set of time-series data are returned.
  • ?stateCd=NY&startDt=2010-09-01&endDt=2010-09-03&modifiedSince=PT2H returns values for all sites in NY with groundwater levels in this date range if and only if any of the values were modified in the last two hours. Otherwise a null set of time-series data are returned.
  • ?stateCd=NY&startDt=2010-09-01&modifiedSince=PT2H returns all the 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 groundwater levels for all NY real-time sites are retrieved if and only if some values were updated in the last two hours.

Show or hide parameter code help
URL argument name is siteStatus. The site status indicates whether the site is active or inactive. 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. Example: &siteStatus=active
Show or hide parameter code help

URL argument names are variable or parameterCd. In this case, parameterCd means a USGS groundwater parameter, not a URL parameter. Either variable or parameterCd can be used equivalently. If parameterCd or variable is not specified in the generated URL, all groundwater level parameters are returned for the site(s) of interest. If parameterCd or variable is used, only data for those parameter codes are returned. To specify more than one parameter code, separate with commas, ex: &variable=72019,72020. The most typical groundwater level parameter code is 72019, or depth to water level, feet below land surface. Twelve groundwater level parameter codes are currently available using the service:

  1. 00000 (No measurement was taken)
  2. 62610 (Groundwater level above NGVD 1929, feet)
  3. 62611 (Groundwater level above NAVD 1988, feet)
  4. 72019 (Depth to water level, feet below land surface)
  5. 72020 (Elevation above NGVD 1929, feet)
  6. 72150 (Groundwater level relative to Mean Sea Level (MSL), feet)
  7. 72226 (Groundwater level above American Samoa Datum of 1962 (retired in 2001), feet)
  8. 72227 (Groundwater level above American Samoa Vertical Datum of 2002, feet)
  9. 72228 (Groundwater level above Guam Vertical Datum of 1963 (retired in 2003), feet)
  10. 72229 (Groundwater level above Guam Vertical Datum of 2004, feet)
  11. 72230 (Groundwater level above Local Hawaiian Datum, feet)
  12. 72231 (Groundwater level above Northern Marianas Vertical Datum of 2003, feet)
Show or hide site type help
URL argument name is siteType. You can filter for just certain groundwater site types. If the siteType argument does not appear in the URL, then by default all groundwater site types will be shown. Hold down CTRL/CMD to select more than one site type. Note: if you select a major site type (like Well) you will get its minor site types by default even if you do not select them.

Show or hide agency code help
URL argument name is agencyCd. You can filter to show only sites with a specific agency code. For example, ?stateCd=il&agencyCd=USCE would return sites in Illinois for the U.S. Army Corps of Engineers only. Only one agencyCd is allowed. 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. 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 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. 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. 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
Show or hide national aquifer help
Parameter name is aquiferCd. Use this to filter groundwater sites that exist in specified national aquifers. Note: not all groundwater 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.

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.)