Output METAR Data on your Webpage with PHP

We have a bunch of aviation sites, many that require weather information. We often like to include raw and unformatted TAF and METAR information on a number of locations depending on the type of website.

We have made a small snippet of PHP code available on one of our sister websites that will retrieve METAR information from the noaa.gov website and make it available in a way that can be easily formatted. A list of the available METAR stations is available here.





The code will output text that will look like this:

By using the code below it will retrieve information from the noaa website on every request. For that reason, it’s best to request data for numerous locations at defined intervals and store data in a cache file – thus negating the need to make repeated requests to noaa.gov; and it speeds up the delivery time considerably.

You can download the code from this page. If you have any issue with it please let us know and we’ll only be too happy to help you out.



Related posts:
  1. Easily post an aviation Metar report into your WordPress post or page with shortcode
  2. Easily post an aviation TAF report into your WordPress post or page with shortcode
  3. Metar to Twitter – Free service
  4. FAA PPL MySQL Database
  5. Flight.org’s Aviation Twitter Addiction
  6. Add Episodes of Flight Podcast to your website or blog
  7. Royal Jordanian Join the (Social) Space Race

About Marty

Marty is an International airline pilot, helicopter pilot, hang glider, experienced flight instructor and co-host of Flight Podcast. Connect with Marty on Twitter or Google+.

Speak Your Mind

*