Endpoint: normals

The normals endpoints provides access to the 30 year climate normal’s for US locations.

https://api.aerisapi.com/normals/

Data CoverageContinental US, Alaska, Hawaii

Included With API Developer,  API Premium

Supported Actions

The following actions are supported with the normals 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.
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
plimit plimit=:total Applied only on the periods property, the total number of periods to return as an integer. This parameter has a normal default of one (1).
psort psort=:string Applied only on the periods property, used to sort results based on certain fields contained within the periods.
pskip pskip=:number Applied only on the periods property, used to skip over a specific number of periods in the data set.
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.
pfilter pfilter=:string Predefined filters for limiting the results. The filter value can be a single, comma-delimited or a semicolon delimited string of filter names.
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.
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.

Supported Filters

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

daily (default) Return daily normals.
monthly Return monthly normal summary.
annual Return annual/yearly normal summary.
hastemp Return normals that have a temperature. Note that some normal stations could only have precip info.
hasprecip Return normals that have a precipitation information.
hassnow Return normals that have a snowfall information.

Supported Query Properties

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

id Query normals for a specific co-op/station ID.
state Query normals for a specific state.
country Query normals for a specific country (US only).
md Query normals for a month/day combination (no leading zeros).
mon Query normals for a month number (1-12).
day Query normals for a day of month (1-31).
tmax Query normals based on the normal maximum temperature (F).
tmin Query normals based on the normal minimum temperature (F).
tavg Query normals based on the normal average temperature (F).
hdd Query normals based on the normal heating degree days.
cdd Query normals based on the normal cooling degree days.
pmtd Query normals based on the normal precipitation for the month to date (inches).
pytd Query normals based on the normal precipitation for the year to date (inches).
smtd Query normals based on the normal snowfall for the month to date (inches).
sytd Query normals based on the normal snowfall for the year to date (inches).
name Query normals based on the co-op/station name.

Sortable Fields

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

id Sort on the co-op/station ID.
md Sort on the month day combination. March 9 = 309, Dec 25 = 1225
mon Sort on the month.
day Sort on the day.
name Sort on the co-op/station name.
state Sort on the co-op/station's state.
country Sort on the co-op/station's country.
tmax Sort on the normal maximum temperature.
tmin Sort on the normal minimum temperature.
tavg Sort on the normal average temperature.
hdd Sort on the normal heating degree days.
cdd Sort on the normal cooling degree days.
pmtd Sort on the normal month to date precipitation.
mytd Sort on the normal year to date precipitation.
smtd Sort on the normal month to date snowfall.
sytd Sort on the normal year to date snowfall.

Examples

Returns today's normals for the closest station to Minneapolis, MN.
/normals/minneapolis,mn

Returns today's normals for co-op station USC00214884.
/normals/usc00214884

Returns the next 7 days of normals for zip code 55403 (Minneapolis, MN).
/normals/55403?to=+1week

Returns today's normals for the 5 closest stations to zip code 55403.
/normals/closest?p=55403&limit=5

Returns today's normals for the closest station to zip code 55403 that has snowfall information available.
/normals/closest?p=55403&filter=hassnow

Returns the current month's summary for the 5 closest locations to zip code 55403.
/normals/closest?p=55403&limit=5&pfilter=monthly

Returns daily normals in Minneapolis, MN for each day of June by passing relevant parameters. For example, passing 'from=first day of june&to=last day of june' will need to be URL encoded as shown below.
/normals/minneapolis,mn?from=first%20day%20of%20june&to=last%20day%20of%20june

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": "usc00215838",
  "loc": {
    "long": -93.373,
    "lat": 45.01
  },
  "place": {
    "name": "new hope",
    "state": "mn",
    "country": "us"
  },
  "periods": [
    {
      "type": "daily",
      "mon": 4,
      "day": 7,
      "timestamp": 1433548800,
      "dateTimeISO": "2015-06-06T00:00:00+00:00",
      "temp": {
        "maxF": 53.5,
        "maxC": 11.94,
        "minF": 31.7,
        "minC": -0.17,
        "avgF": 42.6,
        "avgC": 5.89
      },
      "prcp": {
        "ytdIN": 4.47,
        "ytdMM": 114,
        "mtdIN": 0.58,
        "mtdMM": 15
      },
      "snow": {
        "ytdIN": 29.7,
        "ytdCM": 75.4,
        "mtdIN": 1,
        "mtdCM": 2.5
      },
      "hdd": 2.2,
      "cdd": 0
    }
  ],
  "profile": {
    "tz": "UTC"
  },
  "relative": {
    "lat": 44.97997,
    "long": -93.26384,
    "bearing": 291,
    "bearingENG": "WNW",
    "distanceKM": 9.21,
    "distanceMI": 5.723
  }
}
								

Response Properties

The following properties will be provided in every response object:

id (string) The co-op/station ID that the normal is based on.
periods (object) Array of objects that contain the normals, where each object is for a specific period (day, month, year etc).
periods[#].type (string) Type of normal:
- daily
- monthly
- annual
periods[#].mon (number) The number of the month the normal is for, from 1 - 12. Will be null for an annual summary (filter=annual).
periods[#].day (number) The numeric day of the month, from 1 - 31. Will be null for both a monthly and annual summary (filter=monthly or filter=annual).
periods[#].timestamp (number) UNIX timestamp of the normals valid time.
periods[#].dateTimeISO (string) ISO 8601 of the valid time of the normals.
periods[#].temp (object) Object of temperature based normals. Will be null if the observation station does not normal temperatures.
periods[#].temp.maxF (number) The normal maximum temperature in Fahrenheit.
periods[#].temp.maxC (number) The normal maximum temperature in Celsius.
periods[#].temp.minF (number) The normal minimum temperature in Fahrenheit.
periods[#].temp.minC (number) The normal minimum temperature in Celsius.
periods[#].temp.avgF (number) The normal average temperature in Fahrenheit.
periods[#].temp.avgC (number) The normal average temperature in Celsius.
periods[#].prcp (object) Object of the precipitation based normals. Will be null if the observation station does not include precipitation normals.
periods[#].prcp.mtdIN (number) The normal month to date precipitation in inches. Will be null for annual summary (filter=annual).
periods[#].prcp.mtdMM (number) The normal month to date precipitation in millimeters. Will be null for annual summary (filter=annual).
periods[#].prcp.ytdIN (number) The normal year to date precipitation in inches. Will be null for monthly summary (filter=monthly).
periods[#].prcp.ytdMM (number) The normal year to date precipitation in millimeters. Will be null for monthly summary (filter=monthly).
periods[#].snow (object) Object of the snowfall based normals. Will be null if the observation station does not include snowfall normals.
periods[#].snow.mtdIN (number) The normal month to date snowfall in inches. Will be null for annual summary (filter=annual).
periods[#].snow.mtdCM (number) The normal month to date snowfall in centimeters. Will be null for annual summary (filter=annual).
periods[#].snow.ytdIN (number) The normal year to date snowfall in inches. Will be null for monthly summary (filter=monthly).
periods[#].snow.ytdCM (number) The normal year to date snowfall in centimeters. Will be null for monthly summary (filter=monthly).
hdd (number) The normal heating degree days.
cdd (number) The normal cooling degree days.
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.
profile.tz (string) The timezone name association with the record's location.