Endpoint: observations/archive

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

Helpful Hints: This endpoint does not treat the from parameter like other endpoints. Your response will contain the entire day of observations regardless of a specified time. Additionally, please note the to parameter is not supported by this endpoint as you will retrieve a single day of observations per query.

Use our wizard to try out this endpoint

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 endpoint'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), rectangle (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. The maximum limit for this endpoint is 5.
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.
for for=:string Returns the results starting for the time frame specified. The for parameter is an alias of the from, but useful to indicate a specific time versus a time range

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:
for=tomorrow
for=friday
for=1302883980
for=MM/DD/YYYY
for=YYYY/MM/DD
for=+2hours
for=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. The maximum plimit for this endpoint is 1500.
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.
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 observations from stations that have been known to report precipitation.
hassky Return records that contain sky data in the observation.
centroid When utilized while passing an US zip code for the location, instructs the API to use the zip code centroid latitude/longitude versus the associated city latitude/longitude.
precise When utilized, the API will include additional decimal precision with imperial and metric attributes

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)
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

Default Sort: dt (asc)

You can use the following fields to sort data. Review the sorting docs page for more information on the sort functionality.

dt Used with the psort parameter. 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&

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

{
    "success": true,
    "error": null,
    "response": {
        "id": "EIDW",
        "loc": {
            "long": -6.25,
            "lat": 53.416666666667
        },
        "place": {
            "name": "dublin airport",
            "state": "  ",
            "country": "ie"
        },
        "periods": [{
            "ob": {
                "timestamp": 1528239600,
                "dateTimeISO": "2018-06-06T00:00:00+01:00",
                "tempC": 8,
                "tempF": 46,
                "dewpointC": 8,
                "dewpointF": 46,
                "humidity": 100,
                "pressureMB": 1018,
                "pressureIN": 30.06,
                "spressureMB": 1008,
                "spressureIN": 29.77,
                "altimeterMB": 1018,
                "altimeterIN": 30.06,
                "windKTS": 4,
                "windKPH": 7,
                "windMPH": 5,
                "windSpeedKTS": 4,
                "windSpeedKPH": 7,
                "windSpeedMPH": 5,
                "windDirDEG": 50,
                "windDir": "NE",
                "windGustKTS": null,
                "windGustKPH": null,
                "windGustMPH": null,
                "flightRule": "LIFR",
                "visibilityKM": 48.28032,
                "visibilityMI": 30,
                "weather": "Mostly Clear",
                "weatherShort": "Mostly Clear",
                "weatherCoded": "::FW",
                "weatherPrimary": "Mostly Clear",
                "weatherPrimaryCoded": "::FW",
                "cloudsCoded": "FW",
                "icon": "pcloudyn.png",
                "heatindexC": 8,
                "heatindexF": 46,
                "windchillC": 7,
                "windchillF": 44,
                "feelslikeC": 7,
                "feelslikeF": 44,
                "isDay": false,
                "sunrise": 1528257530,
                "sunriseISO": "2018-06-06T04:58:50+01:00",
                "sunset": 1528318122,
                "sunsetISO": "2018-06-06T21:48:42+01:00",
                "snowDepthCM": null,
                "snowDepthIN": null,
                "precipMM": null,
                "precipIN": null,
                "solradWM2": 0,
                "solradMethod": "estimated",
                "ceilingFT": null,
                "ceilingM": null,
                "light": 0,
                "QC": "O",
                "QCcode": 10,
                "sky": 19
            },
            "raw": "EIDW 052300Z 05004KT 9999 FEW015 08\/08 Q1018 NOSIG"
        }],
        "profile": {
            "tz": "Europe\/Dublin"
        }
    }
}
								

{
    "type": "FeatureCollection",
    "features": [{
        "type": "Feature",
        "id": "EIDW",
        "geometry": {
            "type": "Point",
            "coordinates": [-6.25, 53.416666666667]
        },
        "properties": {
            "id": "EIDW",
            "loc": {
                "long": -6.25,
                "lat": 53.416666666667
            },
            "place": {
                "name": "dublin airport",
                "state": "  ",
                "country": "ie"
            },
            "periods": [{
                "ob": {
                    "timestamp": 1528239600,
                    "dateTimeISO": "2018-06-06T00:00:00+01:00",
                    "tempC": 8,
                    "tempF": 46,
                    "dewpointC": 8,
                    "dewpointF": 46,
                    "humidity": 100,
                    "pressureMB": 1018,
                    "pressureIN": 30.06,
                    "spressureMB": 1008,
                    "spressureIN": 29.77,
                    "altimeterMB": 1018,
                    "altimeterIN": 30.06,
                    "windKTS": 4,
                    "windKPH": 7,
                    "windMPH": 5,
                    "windSpeedKTS": 4,
                    "windSpeedKPH": 7,
                    "windSpeedMPH": 5,
                    "windDirDEG": 50,
                    "windDir": "NE",
                    "windGustKTS": null,
                    "windGustKPH": null,
                    "windGustMPH": null,
                    "flightRule": "LIFR",
                    "visibilityKM": 48.28032,
                    "visibilityMI": 30,
                    "weather": "Mostly Clear",
                    "weatherShort": "Mostly Clear",
                    "weatherCoded": "::FW",
                    "weatherPrimary": "Mostly Clear",
                    "weatherPrimaryCoded": "::FW",
                    "cloudsCoded": "FW",
                    "icon": "pcloudyn.png",
                    "heatindexC": 8,
                    "heatindexF": 46,
                    "windchillC": 7,
                    "windchillF": 44,
                    "feelslikeC": 7,
                    "feelslikeF": 44,
                    "isDay": false,
                    "sunrise": 1528257530,
                    "sunriseISO": "2018-06-06T04:58:50+01:00",
                    "sunset": 1528318122,
                    "sunsetISO": "2018-06-06T21:48:42+01:00",
                    "snowDepthCM": null,
                    "snowDepthIN": null,
                    "precipMM": null,
                    "precipIN": null,
                    "solradWM2": 0,
                    "solradMethod": "estimated",
                    "ceilingFT": null,
                    "ceilingM": null,
                    "light": 0,
                    "QC": "O",
                    "QCcode": 10,
                    "sky": 19
                },
                "raw": "EIDW 052300Z 05004KT 9999 FEW015 08\/08 Q1018 NOSIG"
            }],
            "profile": {
                "tz": "Europe\/Dublin"
            }
        }
    }]
}
								

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.precipSinceLastOb (number) Will be the precipitation (liquid equivalent) since the last observation, if the station provides precipitation per observation.
periods[#].ob.precipSinceMidnight (number) Will be the precipitation (liquid equivalent) since the midnight local time of the station, if the station provides precipitation information with the individual observations.
periods[#].ob (object) The observation object
periods[#].ob.type (string) The type of observation will be one of the following:
station - actual station observations
interpolated - (Deprecated, see the conditions endpoint) Interpolated/estimated observation.
periods[#].ob.timestamp (number) UNIX timestamp of the observation.
periods[#].ob.dateTimeISO (string) ISO 8601 date of the observation.
periods[#].ob.recTimestamp (number) Unix timestamp of when the observation was received.
periods[#].ob.recDateTimeISO (string) ISO 8601 date of when the observation was received.
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. Null if unavailable.
periods[#].ob.weatherShort (string) A shortened weather string. Null if unavailable.
periods[#].ob.weatherCoded (string) The coded weather. See the Coded Weather documentation for code options. Null if unavailable.
periods[#].ob.weatherPrimary (string) A string of the primary weather. Null if unavailable.
periods[#].ob.weatherPrimaryCoded (string) The primary coded weather. See the Coded Weather documentation for code options. Null if unavailable.
periods[#].ob.cloudsCoded (string) The coded cloud coverage. See the Coded Weather documentation for code options. Null if unavailable.
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 AerisWeather 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[#].ob.QCcode (number) Quality Control Code is the numerical version of QC (quality control):
0 = failed QC
1 = caution (some observation attributes may be invalid)
3 = probation (a station will be on probation if it's new, changed location, or having significant data issues)
7 = Questioned. While the observation passes QC, some elements may be out of characteristic for the station
10 = OK, passed QC
periods[#].ob.trustFactor (number) The trust factor of the observation. This value combines both the individual observation QC value and the overall confidence in the station.
Will be a value from 0 -100 and is equivalent to the QCcode * Station Confidence.

Note: New stations will start with a lower confidence. Additionally, stations that have observations that fail QC may have their station confidence lowered.
By default the API requires a trustFactor of 80 or above.
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.
periods[#].profile.tzname (string) The time zone name abbreviation, if one. Such as EST, EDT etc.
periods[#].profile.tzoffset (number) The time zone offset in seconds from UTC time.
periods[#].profile.isDST (boolean) True is the location is in Daylight Savings Time, at the time of the observation.
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.

Last modified: September 18, 2023