Weather Forecast API Format

The WxData™ Weather Forecast API provides direct hourly weather forecast data for any location in the U.S. defined by zip code or latitude/longitude. The API returns all provided weather forecast elements or only those that meet your needs.

In your API call you can filter on these elements:

  • location
  • date range
  • Surface temperature
  • Relative humidity
  • Heat index
  • Wind chill
  • Wind
  • Wind degrees
  • Wind gust

HTTP Methods

API supports GET

Base URL

HTTP: http://wxdata.com/cgi-bin/land-forecast-api.pl

HTTPS: https://wxdata.com/cgi-bin/land-forecast-api.pl

Request Parameters

The following parameters may be used:

Parameter Description Required Values
version Version control Required 1.0
format Return data format Required "xml" or "json"
key User API access key Required As provided by WxData™
secret Secret key (do not share) Required As provided by WxData™
location 5 digit zip code or latitude longitude point of desired location. Required
date Start date range (YYYY-MM-DDTHH:MM:SS). Needs to be at least 1 hour before current time, no past dates. Required
  • Example:
  • date=2011-06-11T16:00:00 (June 6, 2011)
enddate End date range (YYYY-MM-DDTHH:MM:SS) Required
  • Example:
  • date=2017-06-30T13:00:00 (June 30, 2017)
units English (U.S. Standard) or metric units Required
  • Options:
  • e (English)
  • m (metric)
temp Ambient surface temperature Optional
  • Options:
  • 1 (yes, return)
  • 0 (no, do not return) (default)
dewpt Dew point Optional
  • Options:
  • 1 (yes, return)
  • 0 (no, do not return) (default)
rh Relative humidity Optional
  • Options:
  • 1 (yes, return)
  • 0 (no, do not return) (default)
hi Heat index Optional
  • Options:
  • 1 (yes, return)
  • 0 (no, do not return) (default)
wc Wind chill Optional
  • Options:
  • 1 (yes, return)
  • 0 (no, do not return) (default)
wind Wind speed Optional
  • Options:
  • 1 (yes, return)
  • 0 (no, do not return) (default)
wind_deg Wind direction in degrees Optional
  • Options:
  • 1 (yes, return)
  • 0 (no, do not return) (default)
wind_gust Wind gust Optional
  • Options:
  • 1 (yes, return)
  • 0 (no, do not return) (default)

Return Elements: Information About The Returned Weather Observation Data

Value Description Type
city City name text
state Two character state abbreviations text
country Country of origin text
latitude Latitude of city/state location float
longitude Longitude of city/state location float
validtime datetime Local valid time of hourly forecast data presented YYYY-MM-DDTHH:MM:SS
temp Ambient surface temperature (temp_c or temp_f) integer
dewpt Dew point (dewpt_c or dewpt_f) integer
rh Relative humidity (%) integer
hi Heat index (heat_index_f or heat_index_c) float
wc Wind chill (wind_chill_f or wind_chill_c) float
wind_dir Wind direction (north, south, east, west, ... ) text (20 char)
wind_dir_degrees Wind direction in degrees (0 to 360) integer
wind_speed Wind speed (wind_speed_mph or wind_speed_kt) integer
wind_gust Wind gust (wind_gust_mph or wind_gust_kt) integer

XML Sample Output

<response xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XML-Schema-instance" version="1.2" xsi:noNamespaceSchemaLocation="http://wxdata.com/schema/metar1_2.xsd"> <weatherdata> <location> <city>New York City</city> <state>NY</state> <country>US</country> <type>forecast</type> <latitude>39.8865</latitude> <longitude>83.4483</longitude> </location> <time_taken_ms>191</time_taken_ms> <errors/> <warnings/> <forecast> <validtime datetime="2017-03-03T06:00:00"> <temp_f>78</temp_f> <dewpt_f>69</dewpt_f> <rh>77</rh> <heat_index_f>35</heat_index_f> <wind_chill_f>-10</wind_chill_f> <wind_dir_degrees>240</wind_dir_degrees> <wind_speed_mph>5</wind_speed_mph> <wind_gust_mph>15</wind_gust_mph> </validtime> <validtime datetime="2017-03-03T09:00:00"> <temp_f>78</temp_f> <dewpt_f>69</dewpt_f> <rh>77</rh> <heat_index_f>35</heat_index_f> <wind_chill_f>-10</wind_chill_f> <wind_dir_degrees>240</wind_dir_degrees> <wind_speed_mph>5</wind_speed_mph> <wind_gust_mph>15</wind_gust_mph> </validtime> </forecast> </weatherdata> </response>

JSON Sample Output

{ "weatherdata": { "location": { "city": "NEW YORK", "state": "NY", "country": "US", "zipcode": "10001", "type": "forecast", "latitude": "40.7484", "longitude": "73.9967" }, "time_taken_ms": "014", "errors": "", "warnings": "", "forecast": { "validtime": [ { "datetime": "2018-06-02 05:00:00", "temp_f": "71.0", "dewpt_f": "67.0", "rh": "87.2", "heat_index_f": "", "wind_chill_f": "", "wind_dir_degrees": "290", "wind_speed_mph": "2", "wind_gust_mph>": "3" }, { "datetime": "2018-06-02 06:00:00", "temp_f": "71.0", "dewpt_f": "67.0", "rh": "87.4", "heat_index_f": "", "wind_chill_f": "", "wind_dir_degrees": "310", "wind_speed_mph": "3", "wind_gust_mph>": "5" } ] } } }

Our weather API is currently used worldwide by users to feed their apps, services, and mission with reliable weather data.

If you have any queries, then please contact us. Pricing