Skip Navigation Links weather.gov 
NOAA logo-Select to go to the NOAA homepage
National Oceanic and Atmospheric Administration's   
  Select to go to the NWS homepage
National Weather Service   
 
 
Local forecast by
"City, St"
NOAA is celebrating 200 years of science, service, and stewardship. Visit the NOAA 200th celebration Web site to learn more
USA.gov is the U.S. government's official web portal to all federal, state and local government web resources and services.
  Home > NDFD > NDFD XML Forecasts

Experimental National Digital Forecast Database XML Web Service

NOAA's National Weather Service offers several XML services
|Forecasts||Watch/warnings||Current Observations||Tropical Cyclone Advisories||Storm Prediction Center Forecast Products||Change Notices|

What is NDFD XML?

National Digital Forecast Database (NDFD) Extensible Markup Language (XML) is a service providing the public, government agencies, and commercial enterprises with data from the National Weather Service’s (NWS) digital forecast database.   This service, which is defined in a Service Description Document, provides NWS customers and partners the ability to request NDFD data over the internet and receive the information back in an XML format.  The request/response process is made possible by the NDFD XML Simple Object Access Protocol (SOAP) server.   To see the details of the NDFD XML SOAP service, go to the following URL and click on the NDFDgen or NDFDgenByDay link:

http://www.weather.gov/forecasts/xml/SOAP_server/ndfdXMLserver.php

If the web service description provided by the SOAP server does not meet your needs, similar information is available in the following Web Service Description Language (WSDL) document:

http://www.weather.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl

In addition to the SOAP technology, this service exploits XML to enhance the ease with which NWS customers and partners can integrate NDFD data into their computer applications.   XML is a W3C standard that allows its users to create languages with HTML-like tags and attributes.   The NDFD XML language is called Digital Weather Markup Language (DWML) and its schema can be found at the following link:

http://www.weather.gov/forecasts/xml/DWMLgen/schema/DWML.xsd

The schema defines the XML language’s vocabulary (available tags and attributes) and syntax (expected order of tags).   Knowing how NDFD XML is constructed, users can write programs to process the XML document to get at the data it contains.

To see a sample Digital Weather Markup Language document that conforms to the DWML schema, click on any of the following links:

http://www.weather.gov/forecasts/xml/DWMLgen/schema/latest_DWML.txt
http://www.weather.gov/forecasts/xml/DWMLgen/schema/latest_DWML_glance.txt
http://www.weather.gov/forecasts/xml/DWMLgen/schema/latest_DWMLByDay24hr.txt
http://www.weather.gov/forecasts/xml/DWMLgen/schema/latest_DWMLByDay12hr.txt

Why provide an Experimental NDFD XML service?

The National Weather Service is striving to serve society’s needs for weather information by evolving its services from a text-based paradigm to one based on making NWS information available quickly, efficiently, and in convenient and understandable forms.   The NDFD is one example of this transformation.   NDFD XML takes yet another step towards a digital services era by making NDFD data available for computer to computer transfer and processing.   NWS customers and partners can then enhance the value of NDFD data through the creation of value added products.

This is an experimental service. NWS will be accepting comments on this service until August 1, 2004. At the end of the period, comments will be evaluated in order to decide if the service should become official or not.

How often is NDFD XML updated?

The NDFD is updated no more then hourly. We request developers using this SOAP service for local applications only make a request for a specific point no more than once an hour. The database is currently updated by 45 minutes after the hour.

How is NDFD XML generated?

The first step to providing NDFD XML is the creation of the NDFD.   For more information on how NDFD is created, visit the NDFD home page.   With NDFD data available, a user application creates and sends a SOAP request to the NDFD XML SOAP server.   The SOAP request is processed, creating the DWML document which is returned to the requesting application for processing.   Figure 1 provides a graphical view of the process.

NDFD XML SOAP Process

Figure 1.   NDFD XML SOAP Process

You can see an example of this process in action by visiting the following URL:

http://www.weather.gov/forecasts/xml/sample_products/meteogram/DWML_graph.htm

By clicking the “submit” button, a script will request, retrieve, and parse NDFD data and then display it in a graph.

You can download this sample application by clicking on the following links:

http://www.weather.gov/forecasts/xml/sample_products/ndfdXML.tar

NOTE:   The PHP script, plotMeteogramDev.php, is an example only and will not run as is.   To run the script, you will need to install NuSOAP and VH Graph.   You can review the readme file for additional information on using the sample clients.

What does NDFD XML contain?

NDFD XML contains forecasts for any combination of the following meteorological parameters:

Maximum Temperature
Minimum Temperature
3 hourly Temperature
Dewpoint Temperature
Apparent Temperature (Available 15 June 2005)
12 hour Probability of Precipitation
Liquid Precipitation Amounts (Quantitative Precipitation Forecast)
Snowfall Amounts
Cloud Cover Amounts
Relative Humidity (Available 15 June 2005)
Wind Direction
Wind Speed
Sensible Weather
Wave Heights

For additional information on NDFD parameter definitions and available time projection, please see the NDFD technical page.

These NDFD parameters can be retrieved in their unsummarized form using the SOAP server function NDFDgen() or summarized over either 24- or 12-hourly periods using the function NDFDgenByDay(). See the section below titled "How Do You Use the Web Service?" for more details on these two functions.

In addition to its meteorological content, NDFD XML contains meta data about the product.   A description of the meta data as well as data XML tags and attributes can be found in the Digital Weather Markup Language Specification.

How Do You Use the Web Service?

The first step to using the web service is to create a SOAP client.   The client creates and sends the SOAP request to the server.   The request sent by the client then invokes one of the server functions.   There are currently two functions NDFDgen() and NDFDgenByDay().   NDFDgen() requires the following user supplied input:

Latitude Decimal 39.0000 The latitude of the point for which you want NDFD data.   North latitude is positive.
Longitude Decimal -77.0000 The longitude of the point for which you want NDFD data.   West longitude is negative.
Product String time-series There are two products.   The “time-series” product returns all data between the start and end times for the selected weather parameters.   The “glance” product returns all data between the start and end times for the parameters maxt, mint, sky, wx, and icons
Start time XML Date String 2004-04-27T12:00 The beginning time for which you want NDFD data.   If the string is empty, the start time is assumed to be the earliest available time in the database.
End time XML Date String 2004-04-30T12:00 The ending time for which you want NDFD data.   If the string is empty, the end time is assumed to be the last available time in the database.
Parameters Array of Booleans maxt = TRUE The parameters that you want data for.   Valid parameters include the following:

Maximum Temperature maxt
Minimum Temperature mint
3 Hourly Temperature temp
Dewpoint Temperature dew
Apparent Temperature appt
12 Hour Probability of Precipitation pop12
Liquid Precipitation Amount qpf
Snowfall Amount snow
Cloud Cover Amount sky
Relative Humidity rh
Wind Speed wspd
Wind Direction wdir
Weather wx
Weather Icons icons
Wave Height waveh

You can view an example of how to invoke NDFDgen() in the following web page and the SOAP client it uses.

http://www.weather.gov/forecasts/xml/SOAP_server/ndfdXML.htm

Server function NDFDgenByDay() requires the following user supplied input:

Latitude Decimal 39.0000 The latitude of the point for which you want NDFD data.   North latitude is positive.
Longitude Decimal -77.0000 The longitude of the point for which you want NDFD data.   West longitude is negative.
Format String 12 hourly There are two formats.   The “24 hourly” format returns NDFD data summarized for a 24 hour period running from 6:00 AM to 6:00 AM.   The “12 hourly” format summarizes NDFD data into two 12 hour periods per day that run from 6:00 AM to 6:00 PM and 6:00 PM to 6:00 AM
Start Date XML Date String 2004-04-27 The beginning day for which you want NDFD data.   If the string is empty, the start date is assumed to be the earliest available day in the database.
Number of Days Integer 7 The number of days worth of NDFD data you want.

You can view an example of how to invoke NDFDgenByDay() in the following web page and the SOAP client it uses.

http://www.weather.gov/forecasts/xml/SOAP_server/ndfdSOAPByDay.htm

Once the SOAP server returns the XML document back to the client, you can then parse the DWML using SAX, the DOM, or XSLT.   The meteogramDev.php script discussed above is an example of SAX processing.

NWS XML Services Change Notices XML

Below are listed recent change notices for NWS XML services. A complete listing is available. An RSS feed of the change notices is also available. These notices are used to announce major changes, schema changes and new services.

No changes are currently listed...

 

    US Dept of Commerce
    National Oceanic and Atmospheric Administration
    National Weather Service
    1325 East West Highway
    Silver Spring, MD 20910
    Page Author: NWS Internet Services Team
Disclaimer
Information Quality
Credits
Glossary
Privacy Policy
Freedom of Information Act (FOIA)
About Us
Career Opportunities
     Page last Modified: 6 October, 2005 10:31 AM