Data API Examples

Below are listed examples for each of the data API scripts.

METARs

Type Examples Description
Single station /cgi-bin/data/metar.php?ids=KORD Returns the latest METAR from a station
Single station, multiple hours /cgi-bin/data/metar.php?ids=KORD&hours=12 Returns the last 12 hours of METAR from a station
Single station, decoded output /cgi-bin/data/metar.php?ids=KORD&format=decoded Outputs decoded data
Single station, ADDS XML output /cgi-bin/data/metar.php?ids=KORD&format=xml Outputs ADDS Dataserver compatible XML
Single station, IWXXM output /cgi-bin/data/metar.php?ids=KORD&format=iwxxm Returns IWXXM ver 3
JSON output /cgi-bin/data/metar.php?ids=KORD&format=json Returns JSON output
Multiple stations /cgi-bin/data/metar.php?ids=KORD,KSEA,KATL Returns the latest METAR from a set of stations
Multiple station, ADDS XML output /cgi-bin/data/metar.php?ids=KORD,KSEA,KATL&format=xml Outputs ADDS Dataserver compatible XML
Multiple station, IWXXM output /cgi-bin/data/metar.php?ids=KORD,KSEA,KATL&format=iwxxm Returns IWXXM ver 3, embeds within collection
Multiple stations, lists /cgi-bin/data/metar.php?ids=@TOP Returns the latest METAR from a preset of stations
Multiple stations, state /cgi-bin/data/metar.php?ids=@NY Returns the latest METAR from a preset of stations
Multiple stations, bounding box /cgi-bin/data/metar.php?bbox=35,-95,40,-85 Returns 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=1 Last minute based on receipt time
Archived data Return data from 12Z on 30 July 2022

TAFs

Type Examples Description
Single station /cgi-bin/data/taf.php?ids=KORD Returns the latest TAF from a station
Single station, multiple hours /cgi-bin/data/taf.php?ids=KORD&hours=12 Returns the last 12 hours of TAFs from a station
Single station, decoded output /cgi-bin/data/taf.php?ids=KORD&format=decoded Outputs decoded data
Single station, HTML output /cgi-bin/data/taf.php?ids=KORD&format=html Outputs decoded data in HTML format
Single station, ADDS XML output /cgi-bin/data/taf.php?ids=KORD&format=xml Outputs ADDS Dataserver compatible XML
Single station, IWXXM output /cgi-bin/data/taf.php?ids=KORD&format=iwxxm Returns 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=5 Last 5 minutes based on receipt time

PIREPs

Type Examples Description
Near a station /cgi-bin/data/pirep.php?id=KORD Returns the latest AIREPs/PIREPs within 200 sm of KORD
Decoded output /cgi-bin/data/pirep.php?id=KORD&format=decoded Returns the latest AIREPs/PIREPs in decoded format
HTML output /cgi-bin/data/pirep.php?id=KORD&format=html Returns the latest AIREPs/PIREPs in HTML
ADDS XML output /cgi-bin/data/pirep.php?id=KORD&format=xml Outputs ADDS Dataserver compatible XML
Age /cgi-bin/data/pirep.php?id=KORD&age=4 Shows PIREPs for last 4 hours
Distance /cgi-bin/data/pirep.php?id=KORD&distance=300 Shows 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=turb Shows turbulence PIREPs
Type /cgi-bin/data/pirep.php?id=KORD&type=icing Shows icing PIREPs

CONUS AIRMETs/SIGMETs

Type Examples Description
Latest SIGMETs /cgi-bin/data/airsigmet.php Returns the active SIGMETs
HTML output /cgi-bin/data/airsigmet.php?format=html Outputs HTML like old website
ADDS XML output /cgi-bin/data/airsigmet.php?format=xml Outputs ADDS Dataserver compatible XML
Output for specific location /cgi-bin/data/airsigmet.php?loc=bos Outputs AIRMET/SIGMETs for Boston region
Output for specific hazard /cgi-bin/data/airsigmet.php?hazard=turb Outputs turbulence AIRMET/SIGMETs
Output by type /cgi-bin/data/airsigmet.php?type=sigmet Outputs only SIGMETs. Options are airmet,sigmet

International SIGMETs

Type Examples Description
Latest SIGMETs /cgi-bin/data/isigmet.php Returns the active SIGMETs
HTML output /cgi-bin/data/isigmet.php?format=html Outputs HTML like old website
ADDS XML output /cgi-bin/data/isigmet.php?format=xml Outputs ADDS Dataserver compatible XML
Output for specific location /cgi-bin/data/isigmet.php?loc=eur Outputs SIGMETs for Europe region
Output for specific hazard /cgi-bin/data/isigmet.php?hazard=turb Outputs turbulence SIGMETs

G-AIRMETs

Type Examples Description
Latest G-AIRMETs, decoded output /cgi-bin/data/gairmet.php Returns the active G-AIRMETs
ADDS XML output /cgi-bin/data/gairmet.php?format=xml Outputs ADDS Dataserver compatible XML

Center Weather Advisories

Type Examples Description
Latest CWAs /cgi-bin/data/cwa.php Returns the active CWAs
Latest CWA by CWSU /cgi-bin/data/cwa.php?loc=zma Returns active CWAs from Miami
Latest CWA by hazard /cgi-bin/data/cwa.php?hazard=ts Returns active thunderstorm CWAs
Latest CWA in XML format /cgi-bin/data/cwa.php?format=xml Returns active CWAs
Latest CWA in JSON format /cgi-bin/data/cwa.php?format=json Returns active CWAs
Latest MIS /cgi-bin/data/mis.php Returns the active MISs

Area Forecasts (OCONUS only)

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

Forecast Discussions

Type Examples Description
Latest Aviation Forecast Discussion /cgi-bin/data/fcstdisc.php?cwa=keax Returns the aviation discussion for Pleasant Hill MO
Latest Forecast Discussion /cgi-bin/data/fcstdisc.php?cwa=keax&type=af Returns the full discussion for Pleasant Hill MO

Station Info

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

Airport Info

Airport Info for a site /cgi-bin/data/airport.php?ids=KORD Returns information on a site
Use bounding box /cgi-bin/data/airport.php?bbox=40,-90,45,-85 Outputs all sites within bounding box
JSON output /cgi-bin/data/airport.php?ids=KORD&format=json Outputs JSON
GeoJSON output /cgi-bin/data/airport.php?ids=KORD&format=geojson Outputs GeoJSON

Navigation Aid Info

Fix Info for a site /cgi-bin/data/navaid.php?ids=MCI Returns information on a site
Use bounding box /cgi-bin/data/navaid.php?bbox=40,-90,45,-85 Outputs all sites within bounding box
JSON output /cgi-bin/data/navaid.php?ids=MCI&format=json Outputs JSON
GeoJSON output /cgi-bin/data/navaid.php?ids=MCI&format=geojson Outputs GeoJSON

Navigation Fix Info

Fix Info for a site /cgi-bin/data/fix.php?ids=BARBQ Returns information on a site
Use bounding box /cgi-bin/data/fix.php?bbox=40,-90,45,-85 Outputs all sites within bounding box
JSON output /cgi-bin/data/fix.php?ids=BARBQ&format=json Outputs JSON
GeoJSON output /cgi-bin/data/fix.php?ids=BARBQ&format=geojson Outputs GeoJSON

Feature Info

Use bounding box /cgi-bin/data/feature.php?bbox=40,-90,45,-85 Outputs all sites within bounding box
JSON output /cgi-bin/data/feature.php?bbox=40,-90,45,-85&format=json Outputs JSON
GeoJSON output /cgi-bin/data/feature.php?bbox=40,-90,45,-85&format=geojson Outputs GeoJSON

Obstacle Info

Use bounding box /cgi-bin/data/obstacle.php?bbox=40,-90,45,-85 Outputs all sites within bounding box
JSON output /cgi-bin/data/obstacle.php?bbox=40,-90,45,-85&format=json Outputs JSON
GeoJSON output /cgi-bin/data/obstacle.php?bbox=40,-90,45,-85&format=geojson Outputs GeoJSON

FB Wind Temperature Data

Type Examples Description
Latest FB Winds for a region /cgi-bin/data/windtemp.php?region=chi Returns the FB wind data for Chicago region
Latest by forecast time /cgi-bin/data/windtemp.php?region=chi&fcst=24 Returns the 24 hr forecasts
Latest by level /cgi-bin/data/windtemp.php?region=chi&level=high Returns the upper level forecasts
Decoded as JSON /cgi-bin/data/windtemp.php?level=240&fcst=12&format=json Returns JSON output for flight level 240 and forecast 12hr
Decoded as GeoJSON /cgi-bin/data/windtemp.php?level=240&fcst=12&format=geojson Returns GeoJSON output for flight level 240 and forecast 12hr

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=2 Obtain 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=3 Obtain 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=1 Obtain 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=1 Obtain 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=PHTO Obtain 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=PHTO Obtain 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=3 Obtain 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=true Obtain 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=KDE use 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,KSFO Obtain 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=3 obtain 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=4 Obtain 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=KORD Obtain 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=KORD Obtain 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=issue Obtain 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 KSEA Request 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=KDE obtain 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,KSFO Use 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=3 obtain 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_secs Obtain all aircraft reports collected between the start and end times
hoursBeforeNow /cgi-bin/data/dataserver.php?dataSource=aircraftreports&requestType=retrieve&format=xml&hoursBeforeNow=1 Obtain 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=3 obtain 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=3 obtain 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=2 Obtain 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_secs Obtain all products collected between the start and end times
hoursBeforeNow /cgi-bin/data/dataserver.php?dataSource=airsigmets&requestType=retrieve&format=xml&hoursBeforeNow=1 Obtain 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=2 Obtain 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=3 obtain 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_secs Obtain all products valid between the start and end times
hoursBeforeNow /cgi-bin/data/dataserver.php?dataSource=gairmets&requestType=retrieve&format=xml&hoursBeforeNow=3 Obtain all products collected in the last 3 hours
mostRecentForEachProduct - postfilter /cgi-bin/data/dataserver.php?dataSource=gairmets&requestType=retrieve&format=xml&hoursBeforeNow=3&mostRecentForEachProduct=postfilter Use 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=2 Obtain 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=3 obtain 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 KATL obtain 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=-40 obtain 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,39 obtain 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