DEPRECATED. This resource is deprecated. New use of this resource should be avoided. Existing use of this resource should be transitioned away from.
Description
Returns a collection of weather history data for the given postal code.
Our patented OnPoint™ Weather data is not confined to weather station locations, but is computed by overlaying multiple past weather sources (including weather station, satellite, radar, and weather balloon data – among others). The resulting quality-checked, error-corrected, and gap-filled data is uniquely derived for every latitude/longitude location in the U.S. and available from 2013 onward.
Requires a subscription plan with the “read_history” and “access_postal_codes” capabilities to access this resource. This resource also has geospatial capabilities (such as “geo_north_america”) that must be available to the subscription plan for corresponding queries.
Resource URL
https://api.weathersource.com/v1/:api_key/history_by_postal_code.format
Resource URL Replacement Parts
{{api_key}} | Your API Key. If you do not have an API key, you may sign up for a free developer account 30-day trial. |
---|---|
{{format}} | The desired response format. Allowed formats are:
|
Parameters
postal_code_eq required |
A response condition defining the postal code from which to return weather history. Allowed Values: postal code Example Value: 22222 |
---|---|
country_eq required |
A response condition defining the 2-character ISO 3166-1 country code for the postal code. Allowed Values: 2-character ISO 3166-1 country code Example Value: US |
timestamp_eq optional |
A response condition that returns a single element matching a timestamp. The returned timestamp may not equal the provided value, but will be representative of the value. For example, if the period parameter is set to hourly and the provided timestamp is for 8:15 a.m., the returned element will be for the 8 a.m. hour. Either timestamp_eq or timestamp_between must be provided in ISO 8601 format. TIP: Include the timezone offset portion of the timestamp for faster responses. (i.e. 2004-02-12T08:00+00:00 not 2004-02-12T08:00) Allowed Values: ISO 8601 timestamp Example Value: 2004-02-12T08:00+00:00 or 2004-02-12 |
timestamp_between optional |
A response condition that returns the subset of elements with timestamps equal to or between those provided. Either timestamp_eq or timestamp_between must be provided in ISO 8601 format. TIP: Include the timezone offset portion of the timestamp for faster responses. (i.e. 2004-02-12T08:00+00:00 not 2004-02-12T08:00) Allowed Values: Two comma separated ISO 8601 timestamps Example Value: 2004-02-12T08:00+00:00,2004-02-12T23:00+00:00 |
period optional |
Identifies the class of weather observations. Allowed Values: hour, day Default Value: day |
limit optional |
DEPRECIATED. Specifies the quantity of elements to retrieve. Allowed Values: Integers between 1 and 25 Default Value: 5 |
offset optional |
DEPRECIATED. Specifies the first element to retrieve (index starts at 0). Allowed Values: Integers greater than or equal to 0 Default Value: 0 |
fields optional |
Set response to a subset of fields within each element. Available field names: The Hour class of weather data fields (period parameter is set to hour):
The Day class of weather data fields (period parameter is set to day):
Allowed Values: Comma separated list of field names Default Value: postal_code,country,timestamp |
Resource Information
API Versions | v1 |
---|---|
Rate Limited? | Yes |
Requires Authentication? | Yes |
Response Formats | JSON JSONP |
HTTP Method | GET |
Related Documentation
Example Request
GET https://api.weathersource.com/v1/{api_key}/history_by_postal_code.json?period=day&postal_code_eq=22222&country_eq=US×tamp_eq=2012-02-10T00:00:00-05:00&fields=postal_code,country,timestamp,tempMax,tempAvg,tempMin,precip,snowfall,windSpdMax,windSpdAvg,windSpdMin,cldCvrMax,cldCvrAvg,cldCvrMin,dewPtMax,dewPtAvg,dewPtMin,feelsLikeMax,feelsLikeAvg,feelsLikeMin,relHumMax,relHumAvg,relHumMin,sfcPresMax,sfcPresAvg,sfcPresMin,spcHumMax,spcHumAvg,spcHumMin,wetBulbMax,wetBulbAvg,wetBulbMin
[{"postal_code":"22222","country":"us","timestamp":"2012-02-10T00:00:00-05:00","cldCvrMin":36,"cldCvrAvg":77,"cldCvrMax":100,"dewPtMin":23.9,"dewPtAvg":28.7,"dewPtMax":34.4,"feelsLikeMin":26.7,"feelsLikeAvg":34.4,"feelsLikeMax":45,"precip":0.03,"relHumMin":48.7,"relHumAvg":76.4,"relHumMax":95.2,"sfcPresMin":1002.7,"sfcPresAvg":1008.6,"sfcPresMax":1012.7,"snowfall":0.4,"spcHumMin":2.7,"spcHumAvg":3.3,"spcHumMax":4.2,"tempMin":28.4,"tempAvg":36,"tempMax":45,"windSpdMin":0.6,"windSpdAvg":2.9,"windSpdMax":6.8,"wetBulbMin":27.6,"wetBulbAvg":33.4,"wetBulbMax":38.7}]