Weather Observation API Format

The WxData™ Weather Observations API provides direct access to current and 18 month historical rolling archive of U.S. observational weather data. The API returns all provided weather elements or only those that meet your needs.

If you have an existing account using the API Explorer is recommended to build API calls. Additionally, securely passing "key" and "secret" in the http header is supported. Curl example represented below:

curl "https://wxdata.com/cgi-bin/land-observations-api.pl?version=1.5&format=json&date=0000-00-00T00:00:00&enddate=0000-00-00T00:00:00&units=e&location=KNYC&weather=1&temp=1" \
-H "key: [provided-apikey]" \
-H "secret: [provided-secretkey]"

In your API call you can filter on these elements:

  • location
  • date range
  • Weather conditions
  • Surface temperature
  • Dew point
  • Heat index
  • Wind chill
  • Wind
  • Wind gust
  • Wind direction
  • Visibility
  • Relative Humidity
  • Atmospheric Pressure
  • Precipitation
  • Units (Imperial / U.S. Standard or Metric)

HTTP Methods

API supports GET

Base URL

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

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

Request Parameters

The following parameters may be used:

Parameter Description Required Values
version Version control Required
  • Options:
  • 1.5
format Return data format [XML, JSON, or CSV (downloadable spreadsheet)] Required "xml" or "json" or "csv"
key User API access key Required As provided by WxData™
secret Secret key (do not share) Required As provided by WxData™
location 4 character METAR observation station id -or- latitude longitude point Required
  • Options:
  • KNYC (NYC Central Park)
  • KORD (Chicago O'Hare)
  • KPDX (Portland, Oregon)
  • KMIA (Miami)
  • 40.7829N+73.9654W (NYC)
  • Click for all options
date Start date range (YYYY-MM-DDTHH:MM:SS) Required
  • Specific Range:
  • date=2011-06-11T16:00:00

  • Latest Observation:
  • date=0000-00-00T00:00:00
  • enddate=0000-00-00T00:00:00
enddate End date range (YYYY-MM-DDTHH:MM:SS) Required
  • Specific Range:
  • date=2017-06-30T13:00:00

  • Latest Observation:
  • date=0000-00-00T00:00:00
  • enddate=0000-00-00T00:00:00
units Imperial (U.S. Standard) or metric units Required
  • Options:
  • e (imperial)
  • m (metric)
weather Weather conditions Optional
  • Options:
  • 1 (yes, return)
  • 0 (no, do not return) (default)
temp Ambient surface temperature 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)
wind_dir Wind direction (north, south, east, west, ... ) 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 Wind speed 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)
press Atmospheric pressure 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)
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)
vis Visibility Optional
  • Options:
  • 1 (yes, return)
  • 0 (no, do not return) (default)
precip Precipitation Optional
  • Options:
  • 1 (yes, return)
  • 0 (no, do not return) (default)

Return Elements: Information About The Returned Weather Observation Data

Value Description Type
raw_metar Raw METAR observation as issued. text
metar_id WxData METAR observation identification number integer
station_id 4 char METAR station identifier text
observation_loctime Local time of weather observation data YYYY-MM-DDTHH:MM:SS
observation_loc_datetime Local time of weather observation data YYYY-MM-DD HH:MM:SS
Weather Weather conditions text
temp Ambient surface temperature (temp_c or temp_f) float
rh Relative humidity (%) integer
wind_dir Wind direction (north, south, east, west, ... ) text (20 char)
wind_deg Wind direction in degrees (0 to 360) integer
wind Wind speed (MPH or KT) float
wind_gust Wind gust (MPH or KT) float
press Atmospheric pressure (inch or millibars) float
dewpt Dew point (dewpoint_f or dewpoint_c) float
hi Heat index (heat_index_f or heat_index_c) float
wc Wind chill (wind_chill_f or wind_chill_c) float
vis Visibility (miles or kilometers) float
precip Precipitation (inches or milimeters) float

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"> <data_source name="METAR"/> <version name="V1"/> <earliest_record>2017-06-10 14:51:00</earliest_record> <time_taken_ms>4</time_taken_ms> <warning/> <data num_results="2"> <METAR> <raw_metar> PHTO 081353Z 24005KT 10SM FEW024 SCT060 20/16 A3004 RMK AO2 SLP171 T02000156 $ </raw_metar> <metar_id>23242</metar_id> <station_id>PHTO</station_id> <observation_loctime>2017-06-08T13:53:00Z</observation_loctime> <observation_loc_datetime>2017-06-08 13:53:00</observation_loc_datetime> <weather>fair</weather> <temp_c>20.0</temp_c> <relative_humidity_c>80</relative_humidity_c> <wind_dir>north</wind_dir> <wind_dir_degrees>240</wind_dir_degrees> <wind_speed_kt>5</wind_speed_kt> <wind_gust_kt>15</wind_gust_kt> <altim_in_hg>30.05</altim_in_hg> <sea_level_pressure_mb>1017.1</sea_level_pressure_mb> <dewpoint_c>15.6</dewpoint_c> <heat_index_c>35.0</heat_index_c> <wind_chill_c>-10.0</wind_chill_c> <visibility_statute_km>10.0</visibility_statute_km> <precipitation_mm>0.25</precipitation_mm> </METAR> </response>

JSON Sample Output

{ "response": { "data_source": { "name": "METARs_archive" }, "version": { "name": "1.5" }, "earliest_record": "For KNYC (KNYC) 2017-06-10 14:51:00", "time_taken_ms": "3441", "warning": "", "data": { "num_results": "24 of 24 observation records returned", "METAR": [ { "raw_metar": "METAR KNYC 310351Z AUTO 00000KT 9SM SCT012 OVC029 18/15 A3015 RMK AO2SLP199 T01780150 $", "metar_id": "17583256", "station_id": "KNYC", "observation_loctime": "May 30 2018, 11:51 pm EDT", "observation_loc_datetime": "2018-05-30 23:51:00", "weather": "Overcast", "temp_f": "64.0", "relative_humidity_f": "84", "wind_dir": "North", "wind_dir_degrees": "", "wind_speed_mph": "0.0", "wind_gust_mph": "NULL", "altim_in_hg": "30.15", "sea_level_pressure_mb": "1019.9", "dewpoint_f": "59.0", "heat_index_f": "NULL", "wind_chill_f": "NULL", "visibility_statute_mi": "9.00" "precipitation_in": "0.01", }, { "raw_metar": "METAR KNYC 310251Z AUTO 00000KT 10SM OVC010 18/15 A3015 RMK AO2 SLP200T01780150 50002 $", "metar_id": "17580714", "station_id": "KNYC", "observation_loctime": "May 30 2018, 10:51 pm EDT", "observation_loc_datetime": "2018-05-30 22:51:00", "weather": "Overcast", "temp_f": "64.0", "relative_humidity_f": "84", "wind_dir": "North", "wind_dir_degrees": "", "wind_speed_mph": "0.0", "wind_gust_mph": "NULL", "altim_in_hg": "30.15", "sea_level_pressure_mb": "1020.0", "dewpoint_f": "59.0", "heat_index_f": "NULL", "wind_chill_f": "NULL", "visibility_statute_mi": "10.00", "precipitation_in": "0.01" } ] } } }

CSV Sample Output

CSV Sample Output

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