Endpoint: observations/archive

The observations/archive endpoint provides access to a full day of observations from our archive based on your subscription level. A day of archived observations is based on Midnight - 11:59:59pm local time of the observation station.

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

Data CoverageGlobal

Included With API Developer,  API Premium

Supported Actions

The following actions are supported with the observations/archive 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.
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. For best practices we recommend using the to parameter as well to define a specific time frame.

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

allstations Returns records using all available stations including personal weather stations.
official Returns records using official government stations.
pws Returns records using only PWS observation stations.
mesonet Returns records using only MESONET observation stations.
hasprecip Returns records that contain a precipitation observation.

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.
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.
wind Used to query the wind speed. Values are in knots.
winddir Used to query the wind direction in degrees. 0 being North.
gust Used to query wind gust speed. Values are in knots.
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)
dt Used to query the date of the observation.
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)
hasprecip Used to query if an observation contains a precipitation record.

Sortable Fields

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

dt Sort based on date and time.

Example:
/observations/archive/98107?psort=dt:-1 (Returns observations in order from latest to earliest local time)

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]

Returns archived data for zip code 55403.
/observations/archive/55403?

Returns the archived observation for ICAO KMSP.
/observations/archive/KMSP?

Returns archived data for the closest observation to the specified location. If no limit is specified, it defaults to a limit of 1. If limit equals 1, return a single observation object, otherwise return an array of observation objects.
/observations/archive/closest?p=45.25,-95.25&

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

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

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

Returns all archived 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 archived observations within a polygon specified by a series of comma separated latitude, longitude points. There must be 3 or more points specified.
/observations/archive/within?p=45.25,-95.25,35.25,-85.25,40.5,-92.75,45.25,-95.25&

Returns up to 10 archived 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/archive/within?p=45.25,-95.25,35.25,-85.25&limit=10&

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": "KMSP",
	"loc": {
                "long": -93.233333333333,
                "lat": 44.883333333333
        },
	"place": {
                "name": "minneapolis",
                "state": "mn",
                "country": "us"
        },
	"periods": [{
		"ob": {
			"timestamp": 1415602380,
			"dateTimeISO": "2014-11-10T00:53:00-06:00",
			"tempC": -1,
			"tempF": 30,
			"dewpointC": -12,
			"dewpointF": 10,
			"humidity": 43,
			"pressureMB": 1011,
			"pressureIN": 29.85,
			"spressureMB": 978,
			"spressureIN": 28.88,
			"altimeterMB": 1009,
			"altimeterIN": 29.8,
			"windKTS": 7,
			"windKPH": 13,
			"windMPH": 8,
			"windSpeedKTS": 7,
			"windSpeedKPH": 13,
			"windSpeedMPH": 8,
			"windDirDEG": 60,
			"windDir": "ENE",
			"windGustKTS": null,
			"windGustKPH": null,
			"windGustMPH": null,
			"flightRule": "LIFR",
			"visibilityKM": 16.09344,
			"visibilityMI": 10,
			"weather": "Cloudy",
			"weatherShort": "Cloudy",
			"weatherCoded": "::OV",
			"weatherPrimary": "Cloudy",
			"weatherPrimaryCoded": "::OV",
			"cloudsCoded": "OV",
			"icon": "cloudy.png",
			"heatindexC": -1,
			"heatindexF": 30,
			"windchillC": -6,
			"windchillF": 22,
			"feelslikeC": -6,
			"feelslikeF": 22,
			"isDay": true,
			"sunrise": 1415598025,
			"sunriseISO": "2014-11-09T23:40:25-06:00",
			"sunset": 1415641654,
			"sunsetISO": "2014-11-10T11:47:34-06:00",
			"snowDepthCM": null,
			"snowDepthIN": null,
			"precipMM": null,
			"precipIN": null,
			"solradWM2": null,
			"light": 14,
                        "tempMax6hrC": 20,
                        "tempMax6hrF": 68,
                        "tempMin6hrC": 14.4,
                        "tempMin6hrF": 58,
			"sky": 100
		}, 
                "raw": "KMSP 100653Z 06007KT 10SM OVC060 M01/M12 A2981 RMK AO2 SLP103 T10061122 $"
	}],
	"profile": {
                "tz": "America/Chicago"
        }
}
								

Response Properties

The following properties will be provided in every response object:

id (string) The reporting station ID.
periods (array) An array of observation objects.
periods[#].ob.tempMax6hrC (number) The maximum temperature in Celsius in a 6 hour period.
periods[#].ob.tempMax6hrF (number) The maximum temperature in Fahrenheit in a 6 hour period.
periods[#].ob.tempMin6hrC (number) The minimum temperature in Celsius in a 6 hour period.
periods[#].ob.tempMin6hrF (number) The minimum temperature in Fahrenheit in a 6 hour period.
periods[#].ob.timestamp (number) UNIX timestamp of the observation.
periods[#].ob.dateTimeISO (string) ISO 8601 date of the observation.
periods[#].ob.tempC (number) Temperature in Celsius. Null if not available.
periods[#].ob.tempF (number) Temperature in Fahrenheit. Null if not available.
periods[#].ob.dewpointC (number) Dew point temperature in Celsius. Null if not available.
periods[#].ob.dewpointF (number) Dew point temperature in Fahrenheit. Null if not available.
periods[#].ob.humidity (number) Relative humidity. Null if not available.
periods[#].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.
periods[#].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.
periods[#].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.
periods[#].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.
periods[#].ob.altimeterMB (number) Altimeter in millibars. Null if not available.
periods[#].ob.altimeterIN (number) Altimeter in inches of mercury. Null if not available.
periods[#].ob.windSpeedKTS (number) Wind speed in knots. Null if not available.
periods[#].ob.windSpeedKPH (number) Wind speed in kilometers her hour. Null if not available.
periods[#].ob.windSpeedMPH (number) Wind speed in miles per hour. Null if not available.
periods[#].ob.windDirDEG (number) Wind direction in degrees. Null if not available.
periods[#].ob.windDir (string) Wind direction in cardinal coordinates. Null if not available.
periods[#].ob.windGustKTS (number) Wind gust speed in knots. Null if no wind gusts or not available.
periods[#].ob.windGustKPH (number) Wind gust speed in kilometers her hour. Null if no wind gusts or not available.
periods[#].ob.windGustMPH (number) Wind gust speed in miles per hour. Null if no wind gusts or if not available.
periods[#].ob.flightRule (string) Flight rule indicator, based on weather conditions only. Potential values are: "LIFR", "IFR", "MVFR", "VFR". Null if not available.
periods[#].ob.visibilityKM (number) Visibility in kilometers. Null if not available.
periods[#].ob.visibilityMI (number) Visibility in miles. Null if not available.
periods[#].ob.weather (string) A string of the weather often including cloud coverage along with any prominent weather.
periods[#].ob.weatherShort (string) A shortened weather string.
periods[#].ob.weatherCoded (string) The coded weather. See the Coded Weather page for code options.
periods[#].ob.weatherPrimary (string) A string of the primary weather.
periods[#].ob.weatherPrimaryCoded (string) The primary coded weather. See the Coded Weather page for code options.
periods[#].ob.cloudsCoded (string) The coded cloud coverage. See the Coded Weather page for code options.
periods[#].ob.sky (number) Estimated percentage of sky coverage. 0 = clear, 100 = overcast. Null if not available.
periods[#].ob.ceilingFT (number) The cloud ceiling in feet, if available and reported. Null if not available or reported.
periods[#].ob.ceilingM (number) The cloud ceiling in meters, if available and reported. Null if not available or reported.
periods[#].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.
periods[#].ob.heatindexF (number) Heat index temperature in Fahrenheit. Null if not available.
periods[#].ob.heatindexC (number) Heat index temperature in Celsius. Null if not available.
periods[#].ob.windchillF (number) Wind chill temperature in Fahrenheit. Null if not available.
periods[#].ob.windchillC (number) Wind chill temperature in Celsius. Null if not available.
periods[#].ob.feelslikeF (number) Apparent temperature in Fahrenheit. Null if not available.
periods[#].ob.feelslikeC (number) Apparent temperature in Celsius. Null if not available.
periods[#].ob.isDay (boolean) Signifies if the observation occurred during daily hours. True if between sunrise and sunset, false otherwise.
periods[#].ob.sunrise (number) Timestamp of sunrise for the observation location. NOTE: If no sunrise (Midnight sun / polar night) a boolean false will be returned
periods[#].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
periods[#].ob.sunset (number) Timestamp of sunset for the observation location. NOTE: If no sunset (Midnight sun / polar night) a boolean false will be returned
periods[#].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
periods[#].ob.snowDepthCM (number) The estimated snow depth in centimeters at the observation location. Null if not available.
periods[#].ob.snowDepthIN (number) The estimated snow depth in inches at the observation location. Null if not available.
periods[#].ob.precipMM (number) The precipitation, in millimeters, as provided by the station. Null if not available. NOTE: Some stations may report this value differently. For example:
-Precip since the top of the hour
-Running 60-minute precip. i.e. 1.2” reported at 3:23 pm would be the value from 2:23 pm to 3:23 pm
-Precip since last observation.

If attempting to calculate the daily precip amount we recommend using the Observation Summary endpoint.
periods[#].ob.precipIN (number) The precipitation, in inches, as provided by the station. Null if not available. NOTE: Some stations may report this value differently. For example:
-Precip since the top of the hour
-Running 60-minute precip. i.e. 1.2” reported at 3:23 pm would be the value from 2:23 pm to 3:23 pm
-Precip since last observation.

If attempting to calculate the daily precip amount we recommend using the Observation Summary endpoint.
periods[#].ob.solradWM2 (number) The solar radiation as observed from station or estimated if not available from station
periods[#].ob.solradMethod (string) observed = reported by station
estimated = calculated since not reported by station
periods[#].ob.light (number) The estimated light rate as a percentage based on solradWM2 when available, otherwise calculated. Null if not available.
periods[#].raw (string) Raw observation data if available. (i.e. raw metar or synops). Null if not available.
periods[#].profile.elevM (number) The elevation of the location in meters.
periods[#].profile.elevFT (number) The elevation of the location in feet.
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.