WORLD WEATHER ONLINE XML Premium Weather Data Feed API Documentation Weather foreast by Postcode, Zipcode, Latitude and Longitude version 2.6 updated 11 th January, 2010
Index 1. Weather by Postcode, zipcode and Latitude/Longitude a. Weather API Request b. Parameter Explained c. Top Level d. Data e. Request f. Current Condition g. Weather h. Astronomy i. Hourly
WEATHER BY POSTCODE, ZIPCODE, LATITUDE AND LONGITUDE Weather API Request The Weather API feed request follows simple HTTP GET syntax: start with a base URL and then add parameters and values after a question mark (?). Multiple parameters are separated by an ampersand (&). The base URL for the Weather data feed is http://www.worldweatheronline.com/feed/premium-weather.ashx Parameter Explained q - If you want to get the forecast for a particular postcode or zipcode then you need to provide a valid postcode or zipcode in here. e.g:- q=sw1 or q=90620 lat and lon - If you want to display the forecast for a particular latitude and longitude location then you need to use these parameters. Note: Either parameter q or lat and lon could be used at once. e.g:- lat=54.23 or lon=-23.23 num_of_days - Changes the number of day forecast you need. Value should be between 1 to 7. e.g:- num_of_days=7 format - Output format. Values are xml, csv or tab e.g:- format=xml key - Your unique API Key. It must be passed with each request. e.g:- key=xxxxxxxxxxxxxxxxxxxxxxxxx tp Hourly time period interval for which forecast is required. Value should be either:- o 3 3 hourly weather forecast o 6 6 hourly weather forecast o 12 12 hourly weather forecast o 24 24 hour weather forecast. By default it is 24. e.g:- tp=3
1. Top Level XML s data The root element. 2. data element contains 3 elements request Contains the information about type of request made by user. See below for Request description. current_condition Contains the current weather condition forecast related information. See below for current _condition description. weather Contains the weather forecast related information. See below for Weather description. 3. request element contains metadata about the type of request made to retrieve weather data type query Type of request. latlon Latitude and longitude postcode Postcode zipcode - Zipcode Query to get data. For e.g:- G3, 90201, etc.
4. current_condition element contains metadata about the current weather condition information observation_time tempc windspeedmiles windspeedkmph winddirdegree winddir16point weathercode weathericonurl precipmm humidity visibility pressure cloudcover Local time in hhmm tt format. E.g.:- 06:45 AM or 11:34 PM Temperature in degree Celsius Wind speed in miles per hour Wind speed in kilometre per hour Wind direction in degree Wind direction in 16-point compass Weather condition code Weather icon url Precipitation in mm Humidity in percentage Visibility in kilometre (km). Atmospheric pressure in millibars Cloud cover in percentage 5. weather element contains metadata about the weather forecast information astronomy date maxtempc mintempc hourly Astronomical condition for the day. See astronomy element for description. Forecast date, formatted as yyyy-mm-dd. E.g:- 2008-05-31 Maximum temperature of the day in degree Celsius. Minimum temperature of the day in degree Celsius. hourly contains weather information for 3, 6 and 12 hourly time period.
6. Astronomy element contains astronomical condition. Sunrise Local Sunrise time formatted as h:mm am/pm, for example 5:41 am Sunset Local Sunset time formatted as h:mm am/pm, for example 4:30 pm 7. Hourly element contains weather information in 3, 6, 12 and 24 hourly basis time Local time in hmm format. E.g:- 100 or 1500 tempc tempf windspeedmiles windspeedkmph winddirdegree WindDir16Point WeatherCode Weathericonurl precipmm Humidity Visibility Pressure Cloud Cover Temperature in degree Celsius Temperature in degree Fahrenheit. Wind speed in miles Wind speed in kilometre per hour Wind direction in degree Wind direction in 16-point compass Weather condition code Weather icon url Precipitation in mm Humidity in percentage Visibility in kilometre (km). Atmospheric pressure in millibars Cloud cover in percentage