Data API Examples

Below are listed examples for each of the data API scripts. You can also use the API builder to construct your own requests.

METARs

TypeExamplesDescription
Single station/cgi-bin/data/metar.php?ids=KORDReturns the latest METAR from a station
Single station, multiple hours/cgi-bin/data/metar.php?ids=KORD&hours=12Returns the last 12 hours of METAR from a station
Single station, decoded output/cgi-bin/data/metar.php?ids=KORD&format=decodedOutputs decoded data
Single station, ADDS XML output/cgi-bin/data/metar.php?ids=KORD&format=xmlOutputs ADDS Dataserver compatible XML
Single station, IWXXM output/cgi-bin/data/metar.php?ids=KORD&format=iwxxmReturns IWXXM ver 3
JSON output/cgi-bin/data/metar.php?ids=KORD&format=jsonReturns JSON output
Multiple stations/cgi-bin/data/metar.php?ids=KORD,KSEA,KATLReturns the latest METAR from a set of stations
Multiple station, ADDS XML output/cgi-bin/data/metar.php?ids=KORD,KSEA,KATL&format=xmlOutputs ADDS Dataserver compatible XML
Multiple station, IWXXM output/cgi-bin/data/metar.php?ids=KORD,KSEA,KATL&format=iwxxmReturns IWXXM ver 3, embeds within collection
Multiple stations, lists/cgi-bin/data/metar.php?ids=@TOPReturns the latest METAR from a preset of stations
Multiple stations, state/cgi-bin/data/metar.php?ids=@NYReturns the latest METAR from a preset of stations
Multiple stations, bounding box/cgi-bin/data/metar.php?bbox=35,-95,40,-85Returns the latest METAR from a preset of stations
Include TAF/cgi-bin/data/metar.php?ids=KORD,KJFK&taf=on
Last minute/cgi-bin/data/metar.php?ids=all&latest=1Last minute based on receipt time
Archived dataReturn data from 12Z on 30 July 2022

TAFs

TypeExamplesDescription
Single station/cgi-bin/data/taf.php?ids=KORDReturns the latest TAF from a station
Single station, multiple hours/cgi-bin/data/taf.php?ids=KORD&hours=12Returns the last 12 hours of TAFs from a station
Single station, decoded output/cgi-bin/data/taf.php?ids=KORD&format=decodedOutputs decoded data
Single station, HTML output/cgi-bin/data/taf.php?ids=KORD&format=htmlOutputs decoded data in HTML format
Single station, ADDS XML output/cgi-bin/data/taf.php?ids=KORD&format=xmlOutputs ADDS Dataserver compatible XML
Single station, IWXXM output/cgi-bin/data/taf.php?ids=KORD&format=iwxxmReturns IWXXM ver 3
Multiple stations, bounding box/cgi-bin/data/taf.php?bbox=35,-95,40,-85
Include METAR/cgi-bin/data/taf.php?ids=KORD&metar=on
Last 5 minutes/cgi-bin/data/taf.php?ids=all&latest=5Last 5 minutes based on receipt time

PIREPs

TypeExamplesDescription
Near a station/cgi-bin/data/pirep.php?id=KORDReturns the latest AIREPs/PIREPs within 200 sm of KORD
Decoded output/cgi-bin/data/pirep.php?id=KORD&format=decodedReturns the latest AIREPs/PIREPs in decoded format
HTML output/cgi-bin/data/pirep.php?id=KORD&format=htmlReturns the latest AIREPs/PIREPs in HTML
ADDS XML output/cgi-bin/data/pirep.php?id=KORD&format=xmlOutputs ADDS Dataserver compatible XML
Age/cgi-bin/data/pirep.php?id=KORD&age=4Shows PIREPs for last 4 hours
Distance/cgi-bin/data/pirep.php?id=KORD&distance=300Shows PIREPs for 300 sm radius from KORD
Bounding box/cgi-bin/data/pirep.php?bbox=35,-95,40,-85
Type/cgi-bin/data/pirep.php?id=KORD&type=turbShows turbulence PIREPs
Type/cgi-bin/data/pirep.php?id=KORD&type=icingShows icing PIREPs

CONUS AIRMETs/SIGMETs

TypeExamplesDescription
Latest SIGMETs/cgi-bin/data/airsigmet.phpReturns the active SIGMETs
HTML output/cgi-bin/data/airsigmet.php?format=htmlOutputs HTML like old website
ADDS XML output/cgi-bin/data/airsigmet.php?format=xmlOutputs ADDS Dataserver compatible XML
Output for specific location/cgi-bin/data/airsigmet.php?loc=bosOutputs AIRMET/SIGMETs for Boston region
Output for specific hazard/cgi-bin/data/airsigmet.php?hazard=turbOutputs turbulence AIRMET/SIGMETs
Output by type/cgi-bin/data/airsigmet.php?type=sigmetOutputs only SIGMETs. Options are airmet,sigmet

International SIGMETs

TypeExamplesDescription
Latest SIGMETs/cgi-bin/data/isigmet.phpReturns the active SIGMETs
HTML output/cgi-bin/data/isigmet.php?format=htmlOutputs HTML like old website
ADDS XML output/cgi-bin/data/isigmet.php?format=xmlOutputs ADDS Dataserver compatible XML
Output for specific location/cgi-bin/data/isigmet.php?loc=eurOutputs SIGMETs for Europe region
Output for specific hazard/cgi-bin/data/isigmet.php?hazard=turbOutputs turbulence SIGMETs

G-AIRMETs

TypeExamplesDescription
Latest G-AIRMETs, decoded output/cgi-bin/data/gairmet.phpReturns the active G-AIRMETs
ADDS XML output/cgi-bin/data/gairmet.php?format=xmlOutputs ADDS Dataserver compatible XML

Center Weather Advisories

TypeExamplesDescription
Latest CWAs/cgi-bin/data/cwa.phpReturns the active CWAs
Latest CWA by CWSU/cgi-bin/data/cwa.php?loc=zmaReturns active CWAs from Miami
Latest CWA by hazard/cgi-bin/data/cwa.php?hazard=tsReturns active thunderstorm CWAs
Latest CWA in XML format/cgi-bin/data/cwa.php?format=xmlReturns active CWAs
Latest CWA in JSON format/cgi-bin/data/cwa.php?format=jsonReturns active CWAs
Latest MIS/cgi-bin/data/mis.phpReturns the active MISs

WFO Area Forecast Discussions

TypeExamplesDescription
Latest Aviation Forecast Discussion/cgi-bin/data/fcstdisc.php?cwa=keaxReturns the aviation discussion for Pleasant Hill MO
Latest Forecast Discussion/cgi-bin/data/fcstdisc.php?cwa=keax&type=afReturns the full discussion for Pleasant Hill MO

OCONUS Area Forecasts

TypeExamplesDescription
Latest area forecasts for Gulf/cgi-bin/data/areafcst.php?region=gulf
Latest area forecasts for southern Alaska/cgi-bin/data/areafcst.php?region=aksouthRegion possibilities are gulf, carib, hawaii, aknorth, akcentral, akaleutian, aksouthwest, aksouth, aksoutheast, akpanhandle

FB Wind Temperature Data

TypeExamplesDescription
Latest FB Winds for a region/cgi-bin/data/windtemp.php?region=chiReturns the FB wind data for Chicago region
Latest by forecast time/cgi-bin/data/windtemp.php?region=chi&fcst=24Returns the 24 hr forecasts
Latest by level/cgi-bin/data/windtemp.php?region=chi&level=highReturns the upper level forecasts
Decoded as JSON/cgi-bin/data/windtemp.php?level=240&fcst=12&format=jsonReturns JSON output for flight level 240 and forecast 12hr

Station Info

Station Info for a site/cgi-bin/data/stationinfo.php?ids=KORDReturns information on a site
ADDS XML output/cgi-bin/data/stationinfo.php?ids=KORD&format=xmlOutputs ADDS Dataserver compatible XML

METAR data

stationString - delimited by white space or commas/cgi-bin/data/dataserver.php?dataSource=metars&requestType=retrieve&format=xml&stationString=KDEN KSEA PHNL&hoursBeforeNow=2Obtain all available METARs for KDEN, KSEA and PHNL from the past two hours
stationString - using partial icaoIds/cgi-bin/data/dataserver.php?dataSource=metars&requestType=retrieve&format=xml&stationString=KSEA KDE&hoursBeforeNow=3Obtain METARs for KSEA and all icaoIds beginning with KDE (i.e. KDEN, KDEH, KDEW, ...etc.) from the past three hours
stationString - using '@' and two-letter U.S. state (or two-letter Canadian province) abbreviation to obtain METARS for a state/cgi-bin/data/dataserver.php?dataSource=metars&requestType=retrieve&format=xml&stationString=@WA&hoursBeforeNow=1Obtain METARs for all icaoIds from Washington state for the past hour
stationString - using '~' and two-letter country abbreviation to obtain METARS for a country/cgi-bin/data/dataserver.php?dataSource=metars&requestType=retrieve&format=xml&stationString=~au&hoursBeforeNow=1Obtain METARs for all icaoIds from Australia for the past hour
startTime, endTime - start and end times in seconds since January 1, 1970/cgi-bin/data/dataserver.php?dataSource=metars&requestType=retrieve&format=xml&startTime=beg_secs&endTime=end_secs&stationString=PHTOObtain all METARs for PHTO collected between these start and end times
startTime, endTime - start and end times in ISO8601 format/cgi-bin/data/dataserver.php?dataSource=metars&requestType=retrieve&format=xml&startTime=beg_iso&endTime=end_iso&stationString=PHTOObtain all METARs for PHTO collected between these start and end times
hoursBeforeNow - any positive integer or floating point value/cgi-bin/data/dataserver.php?dataSource=metars&requestType=retrieve&format=xml&stationString=KDEN&hoursBeforeNow=3Obtain all METARs for PHTO collected between these start and end times
mostRecent - get the single most recent METAR (only one value is returned)/cgi-bin/data/dataserver.php?dataSource=metars&requestType=retrieve&format=xml&stationString=PHNL KSEA&hoursBeforeNow=3&mostRecent=trueObtain the single most recent METAR from the past three hours. Only one METAR is returned.
mostRecentForEachStation -
  • constraint - request the most recent for each TAF station in the fastest fashion. Not appropriate for historical data retrieval
  • postfilter - post filter results after applying all other constraints the single most recent TAF, only one result is returned
/cgi-bin/data/dataserver.php?dataSource=metars&requestType=retrieve&format=xml&hoursBeforeNow=1.25&mostRecentForEachStation=constraint&stationString=KDEuse the constraint method to retrieve the most recent METAR for all KDE* stations that were reported in the past hour and fifteen minutes. Note: this is not appropriate for historical data retrieval.
mostRecentForEachStation - postfilter/cgi-bin/data/dataserver.php?dataSource=metars&requestType=retrieve&format=xml&startTime=beg_secs&endTime=end_secs&mostRecentForEachStation=postfilter&stationString=KORD,PHKO,KSEA,KSFOObtain the METARS for PHTO, PHKO, KSEA and KSFO from the indicated start and end times, using the postfilter method. Return only the most recent for each of these stations within the time range.
minLat, minLon, maxLat, maxLon - lon-lat rectangle in decimal degrees/cgi-bin/data/dataserver.php?dataSource=metars&requestType=retrieve&format=xml&minLat=25&minLon=-130&maxLat=65&maxLon=-40&hoursBeforeNow=3obtain METARs collected within the last 3 hours for a rectangular region (bounding box) defined by the min and max lon and lat

TAF data

stationString - delimited by white space or commas/cgi-bin/data/dataserver.php?dataSource=tafs&requestType=retrieve&format=xml&stationString=KDEN KSEA,PHNL&hoursBeforeNow=4Obtain all available TAFs for KDEN, KSEA and PHNL
startTime, endTime, timeType (optional) - start and end times in seconds since January 1, 1970. timeType=issue or valid (default)/cgi-bin/data/dataserver.php?dataSource=tafs&requestType=retrieve&format=xml&startTime=beg_secs&endTime=end_secs&timeType=issue&stationString=KORDObtain all TAFs for KORD for issue times between these start and end times
startTime, endTime, timeType (optional)/cgi-bin/data/dataserver.php?dataSource=tafs&requestType=retrieve&format=xml&startTime=beg_iso&endTime=end_iso&timeType=valid&stationString=KORDObtain all TAFs for KORD for valid times between these start and end times
hoursBeforeNow, timeType (optional)/cgi-bin/data/dataserver.php?dataSource=tafs&requestType=retrieve&format=xml&stationString=KDEN&hoursBeforeNow=3&timeType=issueObtain all TAFs in the last three hours based on issue time for KDEN
mostRecent - get the single most recent TAF, only one result is returned/cgi-bin/data/dataserver.php?dataSource=tafs&requestType=retrieve&format=xml&hoursBeforeNow=3&timeType=issue&mostRecent=true&stationString=PHNL KSEARequest the most recent of the two icaoId's KSEA and PHNL from three hours ago, based on issue time. Only one TAF is returned, the most recent of the two from three hours ago.
mostRecentForEachStation -
  • constraint - request the most recent for each TAF station in the fastest fashion. Not appropriate for historical data retrieval
  • postfilter - post filter results after applying all other constraints the single most recent TAF, only one result is returned
/cgi-bin/data/dataserver.php?dataSource=tafs&requestType=retrieve&format=xml&hoursBeforeNow=2&mostRecentForEachStation=constraint&stationString=KDEobtain the most recent TAF for each station that was reported in the past two hours from stations starting with KDE. The 'constraint' type should not be used for historical data retrieval
mostRecentForEachStation - postfilter/cgi-bin/data/dataserver.php?dataSource=tafs&requestType=retrieve&format=xml&hoursBeforeNow=2&mostRecentForEachStation=postfilter&stationString=KORD,PHKO,KSEA,KSFOUse the postfilter method to obtain the TAFS for KORD, PHKO, KSEA and KSFO from the indicated start and end times. From those results, return only the most recent for each of these stations.
minLat, minLon, maxLat, maxLon - lon-lat rectangle in decimal degrees/cgi-bin/data/dataserver.php?dataSource=tafs&requestType=retrieve&format=xml&minLat=25&minLon=-130&maxLat=65&maxLon=-40&hoursBeforeNow=3obtain TAFs valid within the last 3 hours for a rectangular region (bounding box) defined by the min and max lon and lat

AIREP/PIREP data

startTime, endTime - start and end times in seconds since January 1, 1970./cgi-bin/data/dataserver.php?dataSource=aircraftreports&requestType=retrieve&format=xml&startTime=beg_secs&endTime=end_secsObtain all aircraft reports collected between the start and end times
hoursBeforeNow/cgi-bin/data/dataserver.php?dataSource=aircraftreports&requestType=retrieve&format=xml&hoursBeforeNow=1Obtain all aircraft reports collected in the last hour
minLat, minLon, maxLat, maxLon - lon-lat rectangle in decimal degrees/cgi-bin/data/dataserver.php?dataSource=aircraftreports&requestType=retrieve&format=xml&minLat=25&minLon=-130&maxLat=65&maxLon=-40&hoursBeforeNow=3obtain aircraft reports collected within the last 3 hours for a rectangular region (bounding box) defined by the min and max lon and lat
radialDistance - circular area based on lat,lon and radial distance: distance in sm,longitude,latitude/cgi-bin/data/dataserver.php?dataSource=aircraftreports&requestType=retrieve&format=xml&radialDistance=20;-105,39&hoursBeforeNow=3obtain aircraft reports collected within the last 3 hours for a circular region defined by the lat, lon and distance
minAltitudeFt, maxAltitudeFt/cgi-bin/data/dataserver.php?dataSource=aircraftreports&requestType=retrieve&format=xml&minAltitudeFt=10000&maxAltitudeFt=40000&hoursBeforeNow=2Obtain all reports valid within an altitude range of 10000 to 40000 feet, collected in the last 2 hours

AIRMETs and SIGMETs

startTime, endTime - start and end times in seconds since January 1, 1970./cgi-bin/data/dataserver.php?dataSource=airsigmets&requestType=retrieve&format=xml&startTime=beg_secs&endTime=end_secsObtain all products collected between the start and end times
hoursBeforeNow/cgi-bin/data/dataserver.php?dataSource=airsigmets&requestType=retrieve&format=xml&hoursBeforeNow=1Obtain all products collected in the last hour
minAltitudeFt, maxAltitudeFt/cgi-bin/data/dataserver.php?dataSource=airsigmets&requestType=retrieve&format=xml&minAltitudeFt=10000&maxAltitudeFt=40000&hoursBeforeNow=2Obtain all products valid within an altitude range of 10000 to 40000 feet, collected in the last 2 hours
minLat, minLon, maxLat, maxLon - lon-lat rectangle in decimal degrees/cgi-bin/data/dataserver.php?dataSource=airsigmets&requestType=retrieve&format=xml&minLat=25&minLon=-130&maxLat=65&maxLon=-40&hoursBeforeNow=3obtain products collected within the last 3 hours for a rectangular region (bounding box) defined by the min and max lon and lat

G-AIRMETs

startTime, endTime - start and end times in seconds since January 1, 1970./cgi-bin/data/dataserver.php?dataSource=gairmets&requestType=retrieve&format=xml&startTime=beg_secs&endTime=end_secsObtain all products valid between the start and end times
hoursBeforeNow/cgi-bin/data/dataserver.php?dataSource=gairmets&requestType=retrieve&format=xml&hoursBeforeNow=3Obtain all products collected in the last 3 hours
mostRecentForEachProduct - postfilter/cgi-bin/data/dataserver.php?dataSource=gairmets&requestType=retrieve&format=xml&hoursBeforeNow=3&mostRecentForEachProduct=postfilterUse the postfilter method to obtain the latest SIERRA, TANGO and ZULU products.
minAltitudeFt, maxAltitudeFt/cgi-bin/data/dataserver.php?dataSource=gairmets&requestType=retrieve&format=xml&minAltitudeFt=10000&maxAltitudeFt=40000&hoursBeforeNow=2Obtain all products valid within an altitude range of 10000 to 40000 feet, collected in the last 2 hours
minLat, minLon, maxLat, maxLon - lon-lat rectangle in decimal degrees/cgi-bin/data/dataserver.php?dataSource=gairmets&requestType=retrieve&format=xml&minLat=25&minLon=-130&maxLat=65&maxLon=-40&hoursBeforeNow=3obtain products collected within the last 3 hours for a rectangular region (bounding box) defined by the min and max lon and lat

Station information

stationString - delimited by white space or comma/cgi-bin/data/dataserver.php?idataSource=stations&requestType=retrieve&format=xml&stationString=KDEN KSEA, PHNL ZWWW KATLobtain station information for KDEN, KSEA and PHNL
minLat, minLon, maxLat, maxLon - lon-lat rectangle in decimal degrees/cgi-bin/data/dataserver.php?dataSource=stations&requestType=retrieve&format=xml&minLat=25&minLon=-130&maxLat=65&maxLon=-40obtain products collected within the last 3 hours for a rectangular region (bounding box) defined by the min and max lon and lat
radialDistance - circular area based on lat,lon and radial distance: distance in sm,longitude,latitude/cgi-bin/data/dataserver.php?dataSource=stations&requestType=retrieve&format=xml&radialDistance=20;-105,39obtain statopm information for a circular region defined by the lat, lon and distance

Cache

Access to all current observations and forecasts in one file, updated once a minute.

/data/cache/metars.cache.xml.gzAll current METARs (XML) - gzip'd
/data/cache/metars.cache.csv.gzAll current METARs (CSV) - gzip'd
/data/cache/tafs.cache.xml.gzAll current TAFs (XML) - gzip'd
/data/cache/tafs.cache.csv.gzAll current TAFs (CSV) - gzip'd
/data/cache/airsigmets.cache.xml.gzAll current AIRMETs/SIGMETs (XML) - gzip'd
/data/cache/aircraftreports.cache.xml.gzAll current AIREPs/PIREPs (XML) - gzip'd