Sample - Make Requests for Observations and Forecasts

Version 8


    Example Requests

     

    Hourly Observation Request - By StationID

    http://weather.dtn.com/basic/rest-3.4/obsfcst.wsgi?dataTypeMode=0001&dataType=HourlyObservation&startDate=2015-03-23T00:00:00Z&endDate=2015-03-23T00:00:00Z&stationID=KMSP

    Hourly Observation Request - By Lat/Long

    http://weather.dtn.com/basic/rest-3.4/obsfcst.wsgi?dataTypeMode=0001&dataType=HourlyObservation&startDate=2015-03-23T00:00:00Z&endDate=2015-03-23T00:00:00Z&Latitude=44.880277&Longitude=-93.2166

    Hourly Observation Request - By Physical Address

    http://weather.dtn.com/basic/rest-3.4/obsfcst.wsgi?dataTypeMode=0001&dataType=HourlyObservation&startDate=2015-03-23T00:00:00Z&endDate=2015-03-23T00:00:00Z&postalAddress=11400+Rupp+Dr,+Burnsville,+MN+55337"http://weather.dtn.com/basic/rest-3.4/obsfcst.wsgi?dataTypeMode=0001&dataType=HourlyObservation&startDate=2015-03-23T00:00:00Z&endDate=2015-03-23T00:00:00Z&postalAddress=11400+Rupp+Dr,+Burnsville,+MN+55337

     

    These examples use HTTP Basic for authentication, as noted by the /basic/ in the url. To make a request for other data types, change the HourlyObservation, startDate, and endDate parameters.

     

    Back to top

     

    Request Parameters

     

    All requests must contain the following parameters:

    • dataType – The Type of data you requested.
    • dataTypeMode – The Mode of the data you requested (basic filtering).
    • startDate – The Start Date of the data you requested, in ISO format [YYYY-MM-DDTHH:MM]. You can supply offsets. For example, "2015-01-01T00:00-06:00" would provide you midnight data for the central timezone.
    • endDate – The End Date of the data you requested, in ISO format [YYYY-MM-DDTHH:MM]. You can supply offsets. For example, "2015-01-01T00:00-06:00" would provide you midnight data for the central timezone.
    • StationID, Lat/Long, or Physical Address – The Location you requested.
      • StationID - Requests data for a specific station.
      • Latitude={latitude}&Longitude={Longitude} - Latitude and longitude of the point you requested.
      • postalAddress – URL-encoded physical address. For example, 11400 Rupp Drive, Burnsville, MN 55337 would become 11400+Rupp+Dr,+Burnsville,+MN+55337.

     

    Back to top

     

    DataTypes

     

    • HourlyObservation - Gives Hourly Observations for the specified datetime range given in the request.
    • DailyObservation - Gives Daily Observations for the specified datetime range given in the request.
    • HourlyForecast - Gives Hourly Forecasts for the specified datetime given in the request.
    • DailyForecast - Gives Daily Forecasts for the specified datetime range given in the request.
    • DailyNormals -Gives Daily Normals data (10 year normals) for the specified datetime range given in the request.
      • DailyInterpolatedObservation -Gives a Daily Interpolated Observation for the datetime range given in the request.

        Note: This only uses lat/long for point lookup, since it uses weighted data pulled from the 6 closest observation stations to determine the data returned.

      • DailyInterpolatedForecast -Gives a Daily Interpolated Forecast for the datetime range given in the request.

        Note: This only uses lat/long for point lookup, since it uses weighted data pulled from the 6 closest observation stations to determine the data returned.

      • DailyInterpolatedNormal -Gives Daily Interpolated Normals for the datetime range given in the request.

        Note: This only uses lat/long for point lookup, since it uses weighted data pulled from the 6 closest observation stations to determine the data returned.

      • LatestMETAR -Returns the latest METAR reported for the given location.

        Note: This layer is for Aviation Users only and requires additional provisioning.

      • LatestTAF -Returns the latest TAF reported for the given location.

        Note: This layer is for Aviation Users only and requires additional provisioning.

      • LatestNOTAM -Returns the latest NOTAM reported for the given location.

        Note: This layer is for Aviation Users only and requires additional provisioning.

    • HourlyLatestObservation - Returns the latest observation for the given location.

     

    Back to top

     

    DataTypeModes

     

    DataModeTypes vary depending on the dataType being requested. Refer to the XSD for dataTypeModes and their definitions (http://weather.dtn.com/rest-3.4/doc/TDTNWeatherDataService.xsd).

     

    Back to top

     

    Filtering

     

    The REST web service has filtering that can be applied to requests. This will allow you to request specific data values or change the Unit of Measure, for example. Leaving off filtering parameters will make a blanket request (as seen in the examples above). If you want to make an Hourly Observation request that returns only Temperatures, your request will look like the following:

      http://weather.dtn.com/basic/rest-3.4/obsfcst.wsgi?dataTypeMode=0001&dataType=HourlyObservation&startDate=2015-03-12T00:00:00Z&endDate=2015-03-12T00:00:00Z&stationID=KMSP&temperature=1

     

    If you want to filter for temperature, but you want temperature in C instead of F (the default), your request will look like the following:

      http://weather.dtn.com/basic/rest-3.4/obsfcst.wsgi?dataTypeMode=0001&dataType=HourlyObservation&startDate=2015-03-12T00:00:00Z&endDate=2015-03-12T00:00:00Z&stationID=KMSP&temperature=C

    Note: The Unit of Measure filter is case-sensitive.

     

    Back to top

     

    Request a trial


    Click to request your trial of WeatherSentry Web Services.