GET /postal_codes/{{postal_code}},{{country}}/history

Description

Returns a collection of weather history data for a 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, weather balloon, and model data – among others). The resulting quality-checked, error-corrected, and gap-filled data is uniquely derived for every postal code location. This resource is available for U.S. and Canadian postal codes, for 2007 onward.

Requires a subscription plan with the “read_history” and “access_postal_codes” capabilities to access this resource.

This resource is available to free 30-day developer plans. For access to this resource for longer than 30 days, or for licensed use of the API in production environments, please email sales@weathersource.com or call (844) 813-2617.

Resource URL

https://api.weathersource.com/v1/{{api_key}}/postal_codes/{{postal_code}},{{country}}/history.{{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.

{{postal_code}}

A postal code value (e.g. 22222). Any spaces in the postal code must be URL encoded as %20. For example, the Canadian postal code "X0A 0K0" would be passed as X0A%200K0. More than 5.5 million postal codes are supported globally.

{{country}}

A supported 2-character ISO 3166-1 Alpha-2 country code. Postal code support is available for 151 countries.

{{format}}

The desired response format. Allowed formats are:

  • json
  • csv

Parameters


Warning: Undefined array key "private" in /var/www/html/wp-content/themes/developer.weathersource.com/single-resource.php on line 108

Warning: Undefined array key "private" in /var/www/html/wp-content/themes/developer.weathersource.com/single-resource.php on line 110

Warning: Undefined array key "private" in /var/www/html/wp-content/themes/developer.weathersource.com/single-resource.php on line 108

Warning: Undefined array key "private" in /var/www/html/wp-content/themes/developer.weathersource.com/single-resource.php on line 110

Warning: Undefined array key "private" in /var/www/html/wp-content/themes/developer.weathersource.com/single-resource.php on line 108

Warning: Undefined array key "private" in /var/www/html/wp-content/themes/developer.weathersource.com/single-resource.php on line 110

Warning: Undefined array key "private" in /var/www/html/wp-content/themes/developer.weathersource.com/single-resource.php on line 108

Warning: Undefined array key "private" in /var/www/html/wp-content/themes/developer.weathersource.com/single-resource.php on line 110
timestamp_eq optional

A response condition that returns a single element matching a timestamp.

Either timestamp_eq or timestamp_between must be provided in ISO 8601 format.

All timestamps are assumed local to the request location unless a UTC offset is provided (as part of the ISO 8601 format).

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 hour and the provided timestamp is for 8:15 a.m., the returned element will be for the 8 a.m. hour.

Allowed Values: ISO 8601 timestamp

Example Value: 2007-02-12T08:00-07:00 or 2007-02-12

timestamp_between optional

A response condition that returns a single element matching a timestamp.

Either timestamp_eq or timestamp_between must be provided in ISO 8601 format.

The total date range must not exceed 1 year in length. If a longer date range is required, multiple requests must be made.

All timestamps are assumed local to the request location unless a UTC offset is provided (as part of the ISO 8601 format).

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 hour and the provided timestamp is for 8:15 a.m., the returned element will be for the 8 a.m. hour.

Allowed Values: Two comma separated ISO 8601 timestamps

Example Value: 2007-02-12T08:00-07:00,2007-02-12T23:00-07:00

period optional

Identifies the class of weather observations (i.e. weather for a day or for an hour).

Allowed Values: hour, day

Default Value: day

fields optional

Set response to a subset of fields within each element.

For fastest response times limit, the fields to those required.

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

Field groups (available for day and hour periods):

Allowed Values: Comma separated list of field names

Default Value: all

Resource Information

API Versions v1
Rate Limited? Yes
Requires Authentication? Yes
Response Formats JSON
JSONP
CSV
HTTP Method GET

Related Documentation

Example Request

GET https://api.weathersource.com/v1/{{api_key}}/postal_codes/22222,us/history.json?period=day&timestamp_eq=2014-12-30T00:00&fields=allMeta,allTemp

[{"postal_code":"22222","country":"US","timestamp":"2014-12-30T00:00:00-05:00","feelsLikeMin":26.3,"feelsLikeAvg":33.3,"feelsLikeMax":38.9,"heatIndexMin":26.3,"heatIndexAvg":35.6,"heatIndexMax":40.4,"tempMin":26.3,"tempAvg":35.6,"tempMax":40.4,"windChillMin":26.3,"windChillAvg":33.3,"windChillMax":38.9}]