Getting started overview

AviationWeather, operated by the National Weather Service's Aviation Weather Center (AWC), provides publicly accessible aviation meteorological data. Unlike commercial APIs that often require account creation, API keys, and SDKs, AviationWeather operates as a direct data service. Developers retrieve information by constructing specific HTTP GET requests to predefined URLs or through FTP access to data servers. This model is designed for direct consumption of raw weather products such as METARs (Meteorological Aerodrome Reports) and TAFs (Terminal Aerodrome Forecasts) AviationWeather Data Server Fields.

The service offers various data formats, including XML and CSV, allowing for programmatic parsing and integration into applications. The primary method for getting started involves forming a URL that specifies the desired data product, location (e.g., ICAO station identifier), and output format. This direct approach means that developers can begin fetching data immediately upon understanding the URL structure and available parameters AviationWeather Data Server Documentation.

Quick reference table

Step What to do Where
1. Understand Data Model Review available data products (METAR, TAF, etc.) and formats. AviationWeather Data Server fields documentation
2. Construct Request URL Formulate an HTTP GET request URL with desired parameters. AviationWeather Data Server documentation
3. Make First Request Execute the URL request using a web browser, curl, or programming language. Command line or preferred development environment
4. Parse Response Process the XML or CSV data returned by the server. Application code

Create an account and get keys

AviationWeather does not require users to create an account or obtain API keys to access its data services. All data provided by the Aviation Weather Center (AWC) is publicly accessible and free to use AviationWeather Data Server. This eliminates the need for registration processes, authentication tokens, or subscription management, simplifying the initial setup for developers.

Developers can proceed directly to constructing data requests using standard HTTP GET methods. The absence of an authentication layer means that requests do not need to include headers for API keys or OAuth tokens OAuth documentation. This design choice supports broad public access to critical aviation weather information, aligning with the AWC's mission to provide weather products and services that enhance aviation safety and efficiency.

Your first request

To make your first request to the AviationWeather data server, you will construct a URL that specifies the data type, station, and format. This example retrieves the most recent METAR for Denver International Airport (KDEN) in XML format.

1. Identify the data type: For METARs, the service endpoint is typically /dataserver/data?requestType=retrieve&dataSource=metars.

2. Specify the station: Use the stationString parameter with the ICAO code for the desired airport. For Denver, this is KDEN.

3. Define the output format: Use the format=xml parameter for an XML response.

4. Construct the URL: Combine these parameters into a single URL.

GET https://aviationweather.gov/dataserver/data?requestType=retrieve&dataSource=metars&stationString=KDEN&format=xml&hoursBeforeNow=1 HTTP/1.1
Host: aviationweather.gov

The hoursBeforeNow=1 parameter requests METARs from the last hour, ensuring you get recent data. You can execute this request directly in a web browser, using command-line tools like curl, or within any programming language capable of making HTTP requests MDN Web Docs on GET method.

Example using curl:

curl "https://aviationweather.gov/dataserver/data?requestType=retrieve&dataSource=metars&stationString=KDEN&format=xml&hoursBeforeNow=1"

The response will be an XML document similar to this (truncated for brevity):

<?xml version="1.0" encoding="UTF-8"?>
<response xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:noNamespaceSchemaLocation="https://aviationweather.gov/dataserver/schema/metar1_2.xsd">
  <request_index>25537550</request_index>
  <data num_results="1">
    <METAR>
      <raw_text>KDEN 291653Z 34005KT 10SM BKN250 18/M01 A2996 RMK AO2 SLP144 T01831011</raw_text>
      <station_id>KDEN</station_id>
      <observation_time>2026-05-29T16:53:00Z</observation_time>
      <latitude>39.86</latitude>
      <longitude>-104.67</longitude>
      <temp_c>18.0</temp_c>
      <dewpoint_c>-1.1</dewpoint_c>
      <wind_dir_degrees>340</wind_dir_degrees>
      <wind_speed_kt>5</wind_speed_kt>
      <visibility_sm>10.0</visibility_sm>
      <altim_in_hg>29.96063</altim_in_hg>
      <sky_condition sky_cover="BKN" cloud_base_ft_agl="25000"/>
      <flight_category>VFR</flight_category>
      <metar_type>METAR</metar_type>
      <slp_mb>1014.4</slp_mb>
      <quality_control_flags>
        <auto>TRUE</auto>
      </quality_control_flags>
      <wx_string></wx_string>
      <auto_station>TRUE</auto_station>
    </METAR>
  </data>
</response>

This XML contains parsed data elements such as station_id, observation_time, temp_c, and wind_speed_kt, along with the original raw_text of the METAR.

Common next steps

After successfully retrieving your first METAR, consider these common next steps to expand your use of AviationWeather data:

  1. Explore other data products: AviationWeather offers various aviation weather products beyond METARs, including TAFs (Terminal Aerodrome Forecasts), PIREPs (Pilot Reports), AIRMETs (Airmen's Meteorological Information), and SIGMETs (Significant Meteorological Information). Each product has specific parameters and data structures. For example, to retrieve TAFs, you would modify the dataSource parameter in your URL request AviationWeather Data Server fields documentation.

    GET https://aviationweather.gov/dataserver/data?requestType=retrieve&dataSource=tafs&stationString=KDEN&format=xml&hoursBeforeNow=6 HTTP/1.1
    Host: aviationweather.gov
    
  2. Understand advanced query parameters: The data server supports additional parameters for filtering and refining requests, such as specifying time ranges (startTime, endTime), limiting the number of results (mostRecent), or requesting data for multiple stations. Review the official documentation for a comprehensive list of available parameters and their usage AviationWeather Data Server documentation.

  3. Implement data parsing: For integration into applications, you will need to parse the XML or CSV response. Libraries are available in most programming languages for handling these formats. For XML, consider using DOM parsers or SAX parsers, depending on your language and performance requirements MDN Web Docs on XMLDocument. For CSV, standard CSV parsing libraries can be used.

  4. Automate data retrieval: Set up scheduled tasks or cron jobs to periodically fetch updated weather data. Aviation weather information is dynamic, and real-time updates are crucial for many applications. Be mindful of request frequency and server load; while no explicit rate limits are published, responsible usage is encouraged.

  5. Error handling: Implement robust error handling in your application to manage cases where data is unavailable, station identifiers are invalid, or network issues occur. The server typically returns an XML response indicating errors or an empty data set.

  6. Consider FTP access for bulk data: For high-volume or historical data needs, AviationWeather also provides FTP access to its data servers. This method is suitable for downloading larger datasets rather than making individual HTTP GET requests for real-time updates AviationWeather FTP Server.

Troubleshooting the first call

When making your first request to the AviationWeather data server, you might encounter issues. Here are common problems and their solutions:

  • No data returned or empty XML/CSV response:

    • Incorrect station identifier: Double-check the ICAO code for the airport. Ensure it is a valid 4-character code (e.g., KDEN, EGLL, RJTT). An invalid code will result in no data for that station.
    • Time parameters too restrictive: If you are using hoursBeforeNow or specific startTime/endTime parameters, ensure they cover a period when data is expected to be available. For example, setting hoursBeforeNow=0 might not return data if the latest observation is a few minutes old. Try increasing the value to 1 or 2.
    • Data product not available: Some data products (e.g., SIGMETs) are issued only under specific weather conditions and might not always be active for a given region. Verify that the requested data type is generally expected to be present.
  • Malformed URL:

    • Missing or incorrect parameters: Ensure all required parameters (requestType, dataSource, stationString/area) are present and correctly spelled. Parameter names are case-sensitive.
    • Improper URL encoding: While less common for simple station lookups, if you use special characters in parameters (e.g., for area-based queries), ensure they are URL-encoded to prevent misinterpretation by the server.
  • Network connectivity issues:

    • Firewall or proxy blocking: If you are making requests from a corporate network, a firewall or proxy might be blocking access to aviationweather.gov. Check your network configuration or try making the request from a different network or a personal device.
    • DNS resolution problems: Ensure that your system can resolve the domain aviationweather.gov to its IP address.
  • Server-side issues:

    • Occasionally, the AviationWeather data server may experience temporary outages or maintenance. Check the AviationWeather homepage for any service announcements or status updates.

When troubleshooting, it is often helpful to start with the simplest possible request (e.g., a single METAR for a well-known airport with hoursBeforeNow=1) and incrementally add complexity. Using a web browser to test the URL directly can help isolate whether the issue is with the URL construction or your application's code.