Endpoint: records

The records data set provides access to daily US records (RER) as transmitted by the National Weather Service (NWS).

https://api.aerisapi.com/records/

Data CoverageContinental US, Alaska, Hawaii

Included With API Developer,  API Premium

Supported Actions

The following actions are supported with the records 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 a radius is not provided, then the default of 20 miles will be used.

If your request does not return results, you may try setting or increasing the radius being used. Note, however, that a maximum of 250 results can be returned in a single request.
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 options 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", "50miles". If no unit is provided, your value is assumed to be in meters by default.

The default radius is 25 miles if not specified.
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.
skip skip=:number Used to skip over a specific number of results in the data set.
from from=:string Returns the results starting form the value specified.

Supports a UNIX timestamp a specific date string, or a string supported by the PHP strtotime() function.

Examples:
from=tomorrow
from=friday
from=1302883980
from=7/10/2011
from=2011/07/10
from=+2hours
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 a specific date string, or a string supported by the PHP strtotime() function.

Examples:
to=+6hours
to=+5days
to=1302883980
to=7/10/2011
to=2011/07/10
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.
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.

Supported Filters

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

prcp Returns precipitation (rain normally) related records.
snow Returns snow related records.
maxt Returns maximum temperature (High temperature) related records.
mint Returns minimum temperature (Low temperature) related records.
lomx Returns maximum low temperature related records.
himn Returns minimum high temperature related records.
trace Returns precipitation / snow related records that have a value of "trace".
notrace Returns all records except those that have a value of "trace".
tied Returns records that tied a previous record.
notied Returns only records that broke a previous record, no ties.

Supported Query Properties

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

mon Query records based on the numeric month. (1-12)
day Query records based on the day of the month.
year Query records based on the year of the event.
type Query records based on the record type.
event Alias for type.
code Query records based on the numeric code for the record type.
val Query on the record value.
trace Query if the record is for a trace amount of precipitation (prcp and snow types). This is a boolean query, for example:

query=trace:true will return records that are for a trace amount.
query=trace:false will return records that are not a trace amount.
tied Query if the record ties a previous record. This is a boolean query, for example:

query=tied:true will return records that are a tie.
query=tied:false will return records that are not a tie. (New record)
pval Query the record based on the previous record value.
pyear Query the record based on the year of the previous record.
name Query records based on the closest city.
state Query records for a specific state.
country Query records for a country. (currently only the United States is supported)

Sortable Fields

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

dt Sort on the date time of the report.
mon Sort records based on the numeric month. (1-12)
day Sort records based on the day of the month.
year Sort records based on the year of the event.
code Sort records based on the numeric code for the record type.
val Sort on the record value.
trace Sort records based on the trace boolean.
tied Sort records based on if the record tied a previous one.
pval Sort on the value of the previous record.
pyear Sort based on the previous records year.
name Sort based on the name of the location where the record was observed.
state Sort based on the state the record was observed.

Examples

Returns up to 10 records near Minneapolis that may have occurred over the past two days.
/records/minneapolis,mn?from=-2days&limit=10

Returns the information for the daily record defined by id "51dc9c363a751ef417000199".
/records/51dc9c363a751ef417000199

Returns up to 100 precipitation records that occurred near Minneapolis over the past year.
/records/minneapolis,mn?from=-1year&filter=prcp&limit=100

Returns up to 500 records within a bounding box that occurred within the past week. Perfect usage for fetching storm reports to display on an interactive map.
/records/within?p=59.3534,-122.9738,25.7960,-63.5597&limit=500&from=-1week&to=now

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.


{
   "id":"51dc9c363a751ef417000199",
   "loc":{
      "long":-92.19,
      "lat":44.28
   },
   "report":{
      "timestamp":1373259600,
      "dateTimeISO":"2013-07-08T00:00:00-05:00",
      "type":"himn",
      "code":6,
      "station":{
         "id":"218227",
         "type":"COOP",
         "name":"wabasha county"
      },
      "location":"2 E of wabasha county",
      "details":{
         "text":"71.1",
         "tempF":71.1,
         "tempC":7.5
      },
      "tied":false,
      "prev":{
         "timestamp":363416400,
         "dateTimeISO":"1981-07-08T00:00:00-05:00",
         "details":{
            "text":"70",
            "tempF":70,
            "tempC":6.9
         }
      }
   },
   "place":{
      "name":"wabasha county",
      "state":"mn",
      "country":"us"
   },
   "profile":{
      "tz":"America/Chicago"
   },
   "relativeTo": {
      "lat": 44.97997,
      "long": -93.26384,
      "bearing": 166,
      "bearingENG": "SSE",
      "distanceKM": 11.117,
      "distanceMI": 6.908
   }
}
								

Response Properties

The following properties will be provided in every response object:

id (string) The ID of the record observation.
report.timestamp (number) UNIX timestamp when the event took place.
report.dateTimeISO (string) ISO 8601 date of the date/time of the event.
report.type (string) The record type:
- prcp = precipitation / rain
- snow = snow
- hsnd = snow depth
- maxt = maximum temperature
- mint = minimum temperature
- himn = high minimum temperature
- lomx = low minimum temperature
report.code (number) Numeric representation of the record type.
report.station.id (string) The ID of the station where the record occurred.
report.station.type (string) The type of station.
report.station.name (string) The name of the station.
report.location (string) The brief description of the location, usually contains the location or relative distance from a city.
report.details.text (string) The actual value from the record.
report.details.snowIN (number) If a snow record, the amount of snow in inches.
report.details.snowCM (number) If a snow record, the amount of snow in centimeters.
report.details.rainIN (number) If a rain record, the amount of rain in inches.
report.details.rainMM (number) If a rain record, the amount of rain in millimeters.
report.details.tempF (number) If a temperature record, the value in Fahrenheit.
report.details.tempC (number) If a temperature record, the value in Celsius.
report.tied (boolean) If tied a previous record = true, otherwise false.
report.prev.timestamp (number) UNIX timestamp of the previous record. Null if unavailable.
report.prev.dateTimeISO (string) ISO 8601 date of the date/time of the previous record. Null if unavailable.
report.prev.details.text (string) The actual value from the previous record.
report.prev.details.snowIN (number) If a snow record, the previous amount of snow in inches.
report.prev.details.snowCM (number) If a snow record, the previous amount of snow in centimeters.
report.prev.details.rainIN (number) If a rain record, the previous amount of rain in inches.
report.prev.details.rainMM (number) If a rain record, the previous amount of rain in millimeters.
report.prev.details.tempF (number) If a temperature record, the previous value in Fahrenheit.
report.prev.details.tempC (number) If a temperature record, the previous value in Celsius.
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.
profile.tz (string) The timezone name association with the record's location.
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.