Endpoint: observations

The observations data set provides access to current and archived weather observations from a variety of reporting stations. The primary source for observation data comes from METARs located at airports or permanent weather stations. METAR reports are generated once an hour, but if conditions change significantly, then additional special reports may be issued. Other sources, such as personal weather stations (PWS), may update more frequently but are not official stations used by NOAA.

https://api.aerisapi.com/observations/

Data CoverageGlobal

Included With API Developer,  API Basic,  API Premium

Supported Actions

The following actions are supported with the observations 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.
route BETA The route action returns data for points along a given route. This can be useful to obtain weather information along a transportation route, trails and more. The route is a series of locations, usually latitude/longitudes provided via the p query parameter or for longer routes via GeoJSON within a POST request. The route will return an array of GeoJSON points with the requested data for each point.

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 50 miles if not specified within the endpoint description.
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.
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.
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:

metar (default) Returns records using only METAR observation stations
pws Returns records using only PWS observation stations from PWSweather.com
mesonet Returns records using only MESONET observation stations
allstations Returns records using all available stations including personal weather stations.
hasprecip Returns records that contain a precipitation observation.
allownosky Includes observations that may not include sky information.

Supported Query Properties

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

temp Used to query the temperature. Values are in Celsius.
wind Used to query the wind speed. Values are in knots.
dewpt Used to query the dew point. Values are in Celsius.
rh Used to query the relative humidity.
pressure Used to query the barometric pressure. Values are in millibars.
winddir Used to query the wind direction in degrees. 0 being North.
gust Used to query wind gust speed. Values are in knots.
name Used to query the observation location's name.
state Used to query the observation station's state.

Example:
/observations/search?query=state:mn&sort=temp:-1 (Returns the observation for the location with the warmest temperature in Minnesota)
country Used to query the observation station's country.

Example:
/observations/search?query=country:us&sort=temp:-1 (Returns the observation for the location with the warmest temperature in the US)
id Used to query the observation station's ID. Similar to passing the station ID as the :id, but can be used to pull multiple stations at once

Example:
/observations/search?query=id:KMSP,id:KROA&limit=2 (Returns the latest observations for both KMSP and KROA)
precip Query against the total precipitation in millimeters (liquid equivalent).
elev Used to query the elevation of the observation.
hasprecip Used to query if an observation contains a precipitation record.
qc Quality control:
X = failed QC
C = caution (some observation attributes may be invalid)
O = OK, passed QC

By default, the API will utilize observations that have passed QC (qc=O).
qccode Quality Control Code is the numerical version of qc (quality control):
0 = failed QC
1 = caution (some observation attributes may be invalid)
10 = OK, passed QC

Sortable Fields

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

temp Sort based on temperature.

Examples:
/observations/search?query=state:mn&sort=temp:-1 (Returns the observation for the location with the warmest temperature in Minnesota)
/observations/search?query=state:mn,temp:-999&sort=temp (Returns the observation for the location with the coldest temperature in Minnesota)
dewpt Sort based on dew point.

Example:
/observations/within?p=minneapolis,mn&sort=dewpt:-1&radius=50miles (Returns the observation for the location with the warmest dewpt with-in 50 miles of Minneapolis)
rh Sort based on relative humidity.
pressure Sort based on pressure.
wind Sort based on wind speed.
winddir Sort based on wind direction in dregrees. 0 = north, 90 = east, 180 = south, 270 = west.
gust Sort based on wind gusts.

Example:
/observations/search?query=state:mn&sort=gust:-1 (Returns the observation for the location with the highest wind gusts in Minnesota)
name Sort based on the observation station's name.
state Sort based on the observation station's state.

Example:
/observations/search?query=country:us&sort=state,temp:-1&limit=250 (Returns observations sorted by state ascending, and temperatures descending)
country Sort based on the observation station's country.
id Sort based on the observation station's ID alphabetically.

Examples

Returns data for zip code 55403.
/observations/55403

Returns the observation for ICAO KMSP.
/observations/KMSP

Returns data for the closest observation to the location, specified. If no limit is specified, it defaults to a limit of 1.

If limit = 1, returns a single observation object, otherwise return an array of observation objects.
/observations/closest?p=45.25,-95.25

Returns up to 5 observations within 50 miles of zip code 55403 (Minneapolis) . Results will be sorted by distance (ascending) from zip code 55403
/observations/closest?p=55403&limit=5&radius=50mi

Returns the closest observation to zip code 55403 (Minneapolis) with a wind speed of 21.7 knots (25 mph) or higher.
/observations/closest?p=55403&query=wind:21.7

Returns all observations within the rectangle specified by the coords specified in the loc. The points should be top latitude, left longitude, bottom latitude, right longitude.
/observations/within?p=45.25,-95.25,35.25,-85.25

Returns all observations within a circle with a center at 45.25, -95.25 and a radius of 50 miles.

Note: This functionality is similar to the closest search but is faster as it does not include a distance or sorting.
/observations/within?p=45.25,-95.25&radius=50mi

Returns all observations within a polygon specified by a series of comma separated latitude, longitude points. There must be 3 or more points specified.
/observations/within?p=45.25,-95.25,35.25,-85.25,40.5,-92.75,45.25,-95.25

Returns up to 10 observations within the rectangle specified with the top left corner of 45.25, -95.25 and the bottom right corner of 35.25, -85.25.
/observations/within?p=45.25,-95.25,35.25,-85.25&limit=10

Returns all observations with a wind speed of 21.7knots (25mph) or higher, within the rectangle specified with the top left corner of 45.25, -95.25 and the bottom right corner of 35.25, -85.25.
/observations/within?p=45.25,-95.25,35.25,-85.25&query=wind:21.7

Returns the latest KMSP observation within a circle with a center at zip code 55403 (Minneapolis) and a radius of 50 miles (the default).

Note: This functionality is similar to the closest search, thus you can pass radius as needed.
/observations/search?query=id:KMSP&p=55403

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":"KMSP",
   "loc":{
      "long":-93.233333333333,
      "lat":44.883333333333
   },
   "place":{
      "name":"minneapolis",
      "state":"mn",
      "country":"us"
   },
   "profile":{
      "tz":"America/Chicago",
      "elevM":265,
      "elevFT":869
   },
   "obTimestamp":1442429580,
   "obDateTime":"2015-09-16T13:53:00-05:00",
   "ob":{
      "timestamp":1442429580,
      "dateTimeISO":"2015-09-16T13:53:00-05:00",
      "tempC":27,
      "tempF":81,
      "dewpointC":18,
      "dewpointF":64,
      "humidity":58,
      "pressureMB":1010,
      "pressureIN":29.83,
      "spressureMB":980,
      "spressureIN":28.94,
      "altimeterMB":1011,
      "altimeterIN":29.85,
      "windSpeedKTS":7,
      "windSpeedKPH":13,
      "windSpeedMPH":8,
      "windDirDEG":160,
      "windDir":"SSE",
      "windGustKTS":16,
      "windGustKPH":30,
      "windGustMPH":18,
      "flightRule":"LIFR",
      "visibilityKM":16.09344,
      "visibilityMI":10,
      "weather":"Mostly Cloudy",
      "weatherShort":"Mostly Cloudy",
      "weatherCoded":"::BK",
      "weatherPrimary":"Mostly Cloudy",
      "weatherPrimaryCoded":"::BK",
      "cloudsCoded":"BK",
      "icon":"mcloudy.png",
      "heatindexC":28,
      "heatindexF":83,
      "windchillC":27,
      "windchillF":81,
      "feelslikeC":28,
      "feelslikeF":83,
      "isDay":true,
      "sunrise":1442404419,
      "sunriseISO":"2015-09-16T06:53:39-05:00",
      "sunset":1442449286,
      "sunsetISO":"2015-09-16T19:21:26-05:00",
      "snowDepthCM":null,
      "snowDepthIN":null,
      "precipMM":0,
      "precipIN":0,
      "solradWM2": 314,
      "solradMethod": "estimated",
      "light":67,
      "windGustSpeedKTS":16,
      "windGustSpeedKPH":30,
      "windGustSpeedMPH":18,
      "sky":81
   },
   "raw":"KMSP 161853Z 16007G16KT 130V210 10SM FEW180 BKN250 27\/18 A2986 RMK AO2 PRESFR SLP104 ACC DSNT E T02670178",
   "relativeTo":{
      "lat":44.9778,
      "long":-93.265,
      "bearing":167,
      "bearingENG":"SSE",
      "distanceKM":10.796,
      "distanceMI":6.708
   }
}
								

{
   "type":"FeatureCollection",
   "features":[
      {
         "type":"Feature",
         "id":"KMSP",
         "geometry":{
            "type":"Point",
            "coordinates":[
               -93.233333333333,
               44.883333333333
            ]
         },
         "properties":{
            "id":"KMSP",
            "loc":{
               "long":-93.233333333333,
               "lat":44.883333333333
            },
            "place":{
               "name":"minneapolis",
               "state":"mn",
               "country":"us"
            },
            "profile":{
               "tz":"America/Chicago",
               "elevM":265,
               "elevFT":869
            },
            "obTimestamp":1442429580,
            "obDateTime":"2015-09-16T13:53:00-05:00",
            "ob":{
               "timestamp":1442429580,
               "dateTimeISO":"2015-09-16T13:53:00-05:00",
               "tempC":27,
               "tempF":81,
               "dewpointC":18,
               "dewpointF":64,
               "humidity":58,
               "pressureMB":1010,
               "pressureIN":29.83,
               "spressureMB":980,
               "spressureIN":28.94,
               "altimeterMB":1011,
               "altimeterIN":29.85,
               "windSpeedKTS":7,
               "windSpeedKPH":13,
               "windSpeedMPH":8,
               "windDirDEG":160,
               "windDir":"SSE",
               "windGustKTS":16,
               "windGustKPH":30,
               "windGustMPH":18,
               "flightRule":"LIFR",
               "visibilityKM":16.09344,
               "visibilityMI":10,
               "weather":"Mostly Cloudy",
               "weatherShort":"Mostly Cloudy",
               "weatherCoded":"::BK",
               "weatherPrimary":"Mostly Cloudy",
               "weatherPrimaryCoded":"::BK",
               "cloudsCoded":"BK",
               "icon":"mcloudy.png",
               "heatindexC":28,
               "heatindexF":83,
               "windchillC":27,
               "windchillF":81,
               "feelslikeC":28,
               "feelslikeF":83,
               "isDay":true,
               "sunrise":1442404419,
               "sunriseISO":"2015-09-16T06:53:39-05:00",
               "sunset":1442449286,
               "sunsetISO":"2015-09-16T19:21:26-05:00",
               "snowDepthCM":null,
               "snowDepthIN":null,
               "precipMM":0,
               "precipIN":0,
               "solradWM2":null,
               "light":67,
               "windGustSpeedKTS":16,
               "windGustSpeedKPH":30,
               "windGustSpeedMPH":18,
               "sky":81
            },
            "raw":"KMSP 161853Z 16007G16KT 130V210 10SM FEW180 BKN250 27\/18 A2986 RMK AO2 PRESFR SLP104 ACC DSNT E T02670178",
            "relativeTo":{
               "lat":44.9778,
               "long":-93.265,
               "bearing":167,
               "bearingENG":"SSE",
               "distanceKM":10.796,
               "distanceMI":6.708
            }
         }
      }
   ]
}
								

Response Properties

The following properties will be provided in every response object:

id (string) The reporting station ID.
ob.timestamp (number) UNIX timestamp of the observation.
ob.dateTimeISO (string) ISO 8601 date of the observation.
ob.tempC (number) Temperature in Celsius. Null if not available.
ob.tempF (number) Temperature in Fahrenheit. Null if not available.
ob.dewpointC (number) Dew point temperature in Celsius. Null if not available.
ob.dewpointF (number) Dew point temperature in Fahrenheit. Null if not available.
ob.humidity (number) Relative humidity. Null if not available.
ob.pressureMB (number) Mean Sea Level Pressure (MSLP) in millibars. Null if not available. This is the pressure reading most commonly used by meteorologists to track weather systems at the surface.
ob.pressureIN (number) Mean Sea Level Pressure (MSLP) in inches of mercury. Null if not available. This is the pressure reading most commonly used by meteorologists to track weather systems at the surface.
ob.spressureMB (number) Station pressure in millibars. The pressure Null if not available. This is the pressure that is observed at a specific elevation and is the true barometric pressure of a location.
ob.spressureIN (number) Station pressure in inches of mercury. Null if not available. This is the pressure that is observed at a specific elevation and is the true barometric pressure of a location.
ob.altimeterMB (number) Altimeter in millibars. Null if not available.
ob.altimeterIN (number) Altimeter in inches of mercury. Null if not available.
ob.windSpeedKTS (number) Wind speed in knots. Null if not available.
ob.windSpeedKPH (number) Wind speed in kilometers her hour. Null if not available.
ob.windSpeedMPH (number) Wind speed in miles per hour. Null if not available.
ob.windDirDEG (number) Wind direction in degrees. Null if not available.
ob.windDir (string) Wind direction in cardinal coordinates. Null if not available.
ob.windGustKTS (number) Wind gust speed in knots. Null if no wind gusts or not available.
ob.windGustKPH (number) Wind gust speed in kilometers her hour. Null if no wind gusts or not available.
ob.windGustMPH (number) Wind gust speed in miles per hour. Null if no wind gusts or if not available.
ob.flightRule (string) Flight rule indicator, based on weather conditions only. Potential values are: "LIFR", "IFR", "MVFR", "VFR". Null if not available.
ob.visibilityKM (number) Visibility in kilometers. Null if not available.
ob.visibilityMI (number) Visibility in miles. Null if not available.
ob.weather (string) A string of the weather often including cloud coverage along with any prominent weather.
ob.weatherShort (string) A shortened weather string.
ob.weatherCoded (string) The coded weather. See the Coded Weather page for code options.
ob.weatherPrimary (string) A string of the primary weather.
ob.weatherPrimaryCoded (string) The primary coded weather. See the Coded Weather page for code options.
ob.cloudsCoded (string) The coded cloud coverage. See the Coded Weather page for code options.
ob.sky (number) Estimated percentage of sky coverage. 0 = clear, 100 = overcast. Null if not available.
ob.ceilingFT (number) The cloud ceiling in feet, if available and reported. Null if not available or reported.
ob.ceilingM (number) The cloud ceiling in meters, if available and reported. Null if not available or reported.
ob.icon (string) Weather icon representing the observed weather from the default Aeris icon set. For more custom implementations, icons can be determined by the weatherCoded and weatherPrimaryCoded properties.
ob.heatindexF (number) Heat index temperature in Fahrenheit. Null if not available.
ob.heatindexC (number) Heat index temperature in Celsius. Null if not available.
ob.windchillF (number) Wind chill temperature in Fahrenheit. Null if not available.
ob.windchillC (number) Wind chill temperature in Celsius. Null if not available.
ob.feelslikeF (number) Apparent temperature in Fahrenheit. Null if not available.
ob.feelslikeC (number) Apparent temperature in Celsius. Null if not available.
ob.isDay (boolean) Signifies if the observation occurred during daily hours. True if between sunrise and sunset, false otherwise.
ob.sunrise (number) Timestamp of sunrise for the observation location. NOTE: If no sunrise (Midnight sun / polar night) a boolean false will be returned
ob.sunriseISO (string) ISO 8601 date of the sunrise for the observation location. NOTE: If no sunrise (Midnight sun / polar night) a boolean false will be returned
ob.sunset (number) Timestamp of sunset for the observation location. NOTE: If no sunset (Midnight sun / polar night) a boolean false will be returned
ob.sunsetISO (string) ISO 8601 date of the sunset for the observation location. NOTE: If no sunset (Midnight sun / polar night) a boolean false will be returned
ob.snowDepthCM (number) The estimated snow depth in centimeters at the observation location. Null if not available.
ob.snowDepthIN (number) The estimated snow depth in inches at the observation location. Null if not available.
ob.precipMM (number) The hourly precipitation, in millimeters, as provided by station. Null if not available. NOTE: Some stations may report this value differently.
ob.precipIN (number) The hourly precipitation, in inches, as provided by station. Null if not available. NOTE: Some stations may report this value differently.
ob.solradWM2 (number) The solar radiation as observed from station or estimated if not available from station
ob.solradMethod (string) observed = reported by station
estimated = calculated since not reported by station
ob.light (number) The estimated light rate as a percentage based on solradWM2 when available, otherwise calculated. Null if not available.
raw (string) Raw observation data if available. (i.e. raw metar or synops). Null if not available.
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.