Endpoint: rivers

The rivers endpoint provides access to the latest river and lakes gauge observations. The primary source of this gauge observations is the NOAA Advanced Hydrologic Prediction Service (AHPS). The gauge observations include information on the current water level or flow, flood stages, and low water thresholds.

https://api.aerisapi.com/rivers/

Data CoverageContinental US, Alaska, Hawaii

Included With AMP Developer,  AMP Premium

Supported Actions

The following actions are supported with the rivers endpoint:

:id Requesting data by using the :id action is used for returning data for a particular item that has an ID associated with it. This is the primary method for requesting general weather information for a single location (observations, forecasts, advisories, etc.) as the location's name or a zip code serves as the id. Other endpoints may expect a certain value for the ID, such as storm cells whose ID value is a combination of the radar site identifier and unique identifier assigned to every storm cell. Refer to an enpoint's detailed documentation for specific information regarding how to use the :id action.
closest The closest action will query the API for data that is closest to the requested place and return the results, if any, in order from closest to farthest. If no limit is provided in the request, then only the closest single result will be returned.

If your request does not return results, you may try setting or increasing the radius being used.
within The within action allows for returning data within a variety of different geometrical regions. Currently supported geometries include a circle (requires a center point and radius), square (requires two coordinate points defining the top-left and bottom-right corners) and polygon (requires at least three coordinate points). Unlike the closest action, the results will not be returned in any particular order based on distance.
search The search action is used as a more general query method and expects the query to be defined with the custom query for the request. Unlike the closest action, results will not be returned in any particular order.

Supported Parameters

The following parameters are optional unless otherwise noted:

p p=:place Defines the location to query data for. Refer to the list of supported place value formats.
limit limit=:total The total number of results to return as an integer. Each endpoint may have a set maximum for this value depending on usage.

The default limit is 1 if not specified.
radius radius=:distance:unit When requesting the closest results within a circle, the radius determines how far from the specified location to search. A valid unit value must be included in your radius value, e.g., "5mi", "10km", "25miles". If no unit is provided, your value is assumed to be in meters by default.

Most endpoints utilize a default radius of 50 miles, though some endpoints, such as lightning, may have tighter restrictions specified.
skip skip=:number Used to skip over a specific number of results in the data set.
filter filter=:string Predefined filters for limiting the results. The filter value can be a single, comma-delimited or a semicolon delimited string of filter names.
query query=:string Used to filter results based on certain fields in the data set. See Advanced Queries for more details.
sort sort=:string Used to sort results based on certain fields in the data set. See Sorting for more details.
fields fields=:string Provides a comma separated list of values for the API to return. This parameter is often used to limit the amount of data returned. See Reducing Output.
format format=:string Defines the API output format. The available options include:
format=json - Standard JSON output. This is the default.
format=geojson - API will output GeoJSON


callback callback=:functionName Used with JSONP implementation.

Defines the callback function to use for the response. The response will be enclosed as C(response), where C is the callback function provided.
from from=:string Returns the results starting form the value specified.

Supports a UNIX timestamp or a specific date string. Alternatively, common date formats supported by the PHP strtotime() function will be accepted; however, commas are not accepted.

Examples:
from=tomorrow
from=friday
from=1302883980
from=7/10/2011
from=2011/07/10
from=+2hours
from=2017-02-27 5:00 PM
to to=:string Returns the results between now and the value specified. When used in conjunction with the from parameter, the value of to will be relative to the value of from, not relative to the current time.

Supports a UNIX timestamp or a specific date string. Alternatively, common date formats supported by the PHP strtotime() function will be accepted; however, commas are not accepted.

Examples:
to=+6hours
to=+5days
to=1302883980
to=7/10/2011
to=2011/07/10
to=2017-02-27 5:00 PM

Supported Filters

The following filters can be passed to the filter parameter to reduce the results that are returned:

outofservice Return observations for gauges marked as out of service
inservice Return observations for gauges that are not marked as out of service
obsnotcurrent Return observations for gauges that have not reported updated information recently
notdefined Return observations for gauges that do not have defined flood categories
lowthreshold Return observations for gauges that are currently reporting at or below their low water threshold
noflooding Return observations for gauges that are known not to be flooding
action Return observations for gauges that are known to be near flood level.
flood Return observations for gauges that are known to have minor flooding
minor Return observations for gauges that are known to have minor flooding
moderate Return observations for gauges that are known to have moderate flooding
major Return observations for gauges that are known to have major flooding
allflood Return observations for gauges that are known to have any level of flooding
heighttype Return observations for gauges that report water height
flowtype Return observations for gauges that report water flow rate

Supported Query Properties

Use the following supported property keys when creating custom queries for your requests:

id Query by river gauge ID
dt Query by the date/time of the observation. Example:
/rivers/search?query=dt:-2hours&limit=1&sort=dt
Will return up to 100 river gauge observations that updated within the past two hours, sorted oldest to newest
status Query based on the gauge status:

out_of_service - Gauge is known to be out of service
obs_not_current - Gauge has not reported updated observations recently
not_defined - Gauge is reporting observations but has no action/flooding levels defined, thus cannot determine if flooding
low_threshold - Gauge is reporting levels below the defined low water threshold
no_flooding - Gauge is reporting observations and below flood and action levels
action - Gauge is reporting observations at or above action levels. Normally means near flood stage
minor - Gauge is reporting levels at or above the minor flood level
moderate - Gauge is reporting levels at or above the defined moderate flood level
major - Gauge is reporting levels at or above the defined major flood level
statuscode Query based on the numerical version of the status code:

out_of_service: -1
obs_not_current: 0
not_defined: 1
low_threshold: 3
no_flooding: 5
action: 7
minor: 9
moderate: 11
major: 13
hasimpacts Query stations that provide impact information based on flood levels.
name Query by river gauge name
waterbody Query by the body of water the river gauge is on
state Query by the two letter state abbreviation the river gauge is within
country Query by the two letter country abbreviation the river gauge is within

Sortable Fields

You can use the following fields to sort the data returned in your response:

id Sort by the river gauge IDs
dt Sort by the date/time of the observation
status Sort by the river status string
statuscode Sort by the numeric version of the river status
hasimpact Sort by the boolean profile.hasImpacts flag
name Sort by the gauge names
waterbody Sort by the gauge waterbody names
state Sort by the two letter state abbreviations the gauges are within
country Sort by the two letter country abbreviations the gauges are within

Examples

The /[:endpoint]/[:action]? portion within the query template below can be exchanged with any of the examples. Also, please note you will need to input your client credentials in the [ID] and [SECRET] fields which can be found under the Apps section of the members area.

https://api.aerisapi.com/[:endpoint]/[:action]?client_id=[ID]&client_secret=[SECRET]

Return observations for up to 10 gauges near Houston, Texas.
/rivers/houston,tx?limit=10&

Return observations for up to 10 gauges near Houston, Texas that are reporting flood stage
/rivers/houston,tx?filter=allflood&limit=10&

Return observations for up to 50 gauges within the state of Texas that are reporting minor flooding
/rivers/search?query=state:tx&filter=minor&limit=50&

Response

The following is an example of what each object in the response will consist of. Depending on your requested action, the response may contain multiple instances of this object within an array.

Default
GeoJSON

{
   "id":"HGTT2",
   "loc":{
      "long":-95.396944,
      "lat":29.775
   },
   "ob":{
      "timestamp":1505245500,
      "dateTimeISO":"2017-09-12T14:45:00-05:00",
      "heightFT":8.31,
      "heightM":2.53,
      "flowCFS":90,
      "flowCMS":2.55,
      "secondary":null,
      "status":"no_flooding",
      "statusCode":5,
      "impact":null
   },
   "place":{
      "name":"houston",
      "state":"tx",
      "country":"us"
   },
   "profile":{
      "tz":"America\/Chicago",
      "type":"height",
      "waterbody":"white oak bayou",
      "cats":{
         "actionFT":29,
         "actionM":8.84,
         "floodFT":32,
         "floodM":9.75,
         "moderateFT":33.5,
         "moderateM":10.21,
         "majorFT":36,
         "majorM":10.97,
         "lowthreshM":null,
         "lowthreshFT":null
      },
      "hasImpacts":true
   },
   "relativeTo":{
      "lat":29.76328,
      "long":-95.36327,
      "bearing":292,
      "bearingENG":"WNW",
      "distanceKM":3.502,
      "distanceMI":2.176
   }
}
								

{
   "type":"FeatureCollection",
   "features":[
      {
         "type":"Feature",
         "id":"HGTT2",
         "geometry":{
            "type":"Point",
            "coordinates":[
               -95.396944,
               29.775
            ]
         },
         "properties":{
            "id":"HGTT2",
            "loc":{
               "long":-95.396944,
               "lat":29.775
            },
            "ob":{
               "timestamp":1505245500,
               "dateTimeISO":"2017-09-12T14:45:00-05:00",
               "heightFT":8.31,
               "heightM":2.53,
               "flowCFS":90,
               "flowCMS":2.55,
               "secondary":null,
               "status":"no_flooding",
               "statusCode":5,
               "impact":null
            },
            "place":{
               "name":"houston",
               "state":"tx",
               "country":"us"
            },
            "profile":{
               "tz":"America\/Chicago",
               "type":"height",
               "waterbody":"white oak bayou",
               "cats":{
                  "actionFT":29,
                  "actionM":8.84,
                  "floodFT":32,
                  "floodM":9.75,
                  "moderateFT":33.5,
                  "moderateM":10.21,
                  "majorFT":36,
                  "majorM":10.97,
                  "lowthreshM":null,
                  "lowthreshFT":null
               },
               "hasImpacts":true
            },
            "relativeTo":{
               "lat":29.76328,
               "long":-95.36327,
               "bearing":292,
               "bearingENG":"WNW",
               "distanceKM":3.502,
               "distanceMI":2.176
            }
         }
      }
   ]
}
								

Response Properties

The following properties will be provided in every response object:

id (string) The river gauge ID
ob (object) The observation object
ob.timestamp (number) Unix timestamp of the observation time
ob.dateTimeISO (string) ISO 8601 date of the time the observation was taken
ob.heightFT (number) The water height in feet. Null if unavailable
ob.heightM (number) The water height in meters. Null if unavailable
ob.flowCFS (number) The water flow in cubic feet per second. Null if unavailable
ob.flowCMS (number) The water flow in cubic meters per second. Null if unavailable
ob.secondary (object) Secondary sensor for gauges that include backup. Normally null, since most do not include backups
ob.secondary.heightFT (number) The water height in feet. Null if unavailable
ob.secondary.heightFT (number) The water height in meters. Null if unavailable
ob.secondary.flowCFS (number) The water flow in cubic feet per second. Null if unavailable
ob.secondary.flowCMS (number) The water flow in cubic meters per second. Null if unavailable
ob.status (string) The current river/lake status:

out_of_service - Gauge is known to be out of service
obs_not_current - Gauge has not reported updated observations recently
not_defined - Gauge is reporting observations but has no action/flooding levels defined, thus cannot determine if flooding
low_threshold - Gauge is reporting levels below the defined low water threshold
no_flooding - Gauge is reporting observations and below flood and action levels
action - Gauge is reporting observations at or above action levels. Normally means near flood stage
minor - Gauge is reporting levels at or above the minor flood level
moderate - Gauge is reporting levels at or above the defined moderate flood level
major - Gauge is reporting levels at or above the defined major flood level
ob.statusCode (number) The numeric code of the river/lake status:

out_of_service: -1
obs_not_current: 0
not_defined: 1
low_threshold: 3
no_flooding: 5
action: 7
minor: 9
moderate: 11
major: 13
ob.impact (string) Local impacts, if available and river is flooding. Null if unavailable or river is not flooding
profile (object) Gauge profile object
profile.tz (string) The local timezone name for the location of the gauge
profile.waterbody (string) The water body where the gauge is located
profile.cats (object) When available, the define categories for various flood levels at the gauge location. Null if not defined
profile.cats.actionFT (number) The height, in feet, when the waterbody nears flood stage
profile.cats.actionM (number) The height, in meters, when the waterbody nears flood stage
profile.cats.floodFT (number) The height, in feet, that flooding begins
profile.cats.floodM (number) The height, in meters, that flooding begins
profile.cats.moderateFT (number) The height, in feet, that moderate flooding begins
profile.cats.moderateM (number) The height, in meters, that moderate flooding begins
profile.cats.majorFT (number) The height, in feet, that major flooding begins
profile.cats.majorM (number) The height, in meters, that major flooding begins
profile.cats.lowthreshFT (number) The height, in feet, that the water body is considered to be low
profile.cats.lowthreshM (number) The height, in meters, that the water body is considered to be low
profile.hasImpacts (number) True if the gauge include flooding impacts, false if unavailable
loc.long (number) The longitude coordinate of the record.
loc.lat (number) The latitude coordinate of the record.
place.name (string) The place or nearest place to the record.
place.state (string) The state abbreviation in which the record is located. This may be null depending on the country.
place.country (string) The country abbreviation in which the record is located.
relativeTo.lat (number) Latitude coordinate of the location used for the request. This may be different than the record's loc.lat value if there was no record exactly at the request location.
relativeTo.long (number) Longitude coordinate of the location used for the request. This may be different than the record's loc.long value if there was no record exactly at the request location.
relativeTo.bearing (number) Bearing in degrees of the record's location relative to the location used for the request.
relativeTo.bearingEng (string) Cardinal direction of the record relative to the location used for the request.
relativeTo.distanceKM (number) Distance, in kilometers, from the requested location to the record's actual location.
relativeTo.distanceMI (number) Distance, in miles, from the requested location to the record's actual location.