atlas geek services

Atlas Geek Services home1889 Tigertail Ave Miami, FL USA               Bee current location Bee is in: Annapolis, MD                                 last updated: 07 february 2010

How to Include METARs on Your Web Site

make contact

your e-mail address:
your message:
 

Your message will be sent to bee@atlasgeekservices.com

close

NOAA's National Weather Service provides Aviation-specific weather reports, including METARs* and TAFs**, free of charge.

Here is a free script for retrieving METARs and TAFs from the NOAA site using PHP cURL.

Download this text file, rename the .txt extension to .php, and change the following:
 

Set weather location

At the top of the script is a line that says
                # SET AIRPORT IDENTIFIERS

See below this the line that says
                $codes = "ktmb,kmia";

Change "ktmb,kmia" to your airport code or codes of choice.
 

Choose report types

Next see the line that says
                # TAFS AND METARS

Below this line, see the lines setting $bmetars and $btafs to 1. This will request both METARs and TAFs from NOAA.
 

If you don't want to request METARs, set $bmetars=0, and if you don't want to request TAFs, set $btafs=0.

       

Sample output

Here is the output of the script, using KMIA and KTMB for the airport codes:

       

Aviation Digital Data Service (ADDS)

Output produced by METARs form (1822 UTC 10 March 2010)
found at http://aviationweather.gov/adds/metars/index.php
 
KTMB 101753Z 16013G19KT 10SM FEW029 OVC060 25/16 A2996 RMK AO2 SLP145 T02500161 10267 20156 58018
KTMB 101730Z 1018/1118 15014G19KT P6SM SCT030 BKN050 
     FM110000 15012G18KT P6SM VCSH SCT025 BKN050 
     FM110300 17008KT P6SM VCSH SCT030 BKN050 
     FM111300 19015G21KT P6SM VCTS FEW020 SCT030CB BKN050
        
KMIA 101753Z 12012G20KT 10SM SCT025 BKN050 BKN150 24/17 A2997 RMK AO2 SLP148 T02440172 10261 20194 58018
KMIA 101730Z 1018/1118 14016G22KT P6SM SCT025 BKN050 
     FM110000 15012G18KT P6SM VCSH SCT025 BKN050 
     FM110400 17010KT P6SM VCSH SCT030 BKN050 
     FM111300 19015G21KT P6SM VCTS FEW020 SCT030CB BKN050
        

* A METAR is an aviation routine weather report, and typically contains temperature, dew point, wind speed and direction, precipitation, cloud cover and heights, visibility, and barometric pressure. METARs are location specific, and are typically available given an airport code.

** A Terminal Aerodrome Forecast (TAF) is a format for reporting aviation-specific weather forecast information.

Miami pic