PARFAIT Logo

Help for the Weather Forecast API


version 2017.10.08.24

Test Mode 1

The parameter 'test' by itself parrots that value back. This can be used to verify that you are able to successfully connect to the API.

Example Link:

http://parfait.snarkybox.com/forecast.php?test=true

What that link returns will look like this if viewed in a browser:

true

 

Test Mode 2

Adding the parameters 'lat' and 'lon' will dump the forecast xml sent by NOAA, plus parrot back a table of all the possible parameters and their current values in a simple HTML web page. The values for the 'lat' and 'lon' parameters can be found at the MapQuest Latitude/Longitude Finder website. Any Latitude/Longitude recognized by NWS as being inside of the US can be used. The values for the 'lat' and 'lon' parameters can be found here: http://developer.mapquest.com/web/tools/lat-long-finder.

Example Link:

http://parfait.snarkybox.com/forecast.php?test=true&lat=33.94&lon=-118.4

What that link returns will look like this if viewed in a browser:


<?xml version="1.0" encoding="ISO-8859-1"?>
<dwml xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0" xsi:noNamespaceSchemaLocation="http://graphical.weather.gov/xml/DWMLgen/schema/DWML.xsd">
  <head>
    <product concise-name="dwmlByDay" operational-mode="developmental" srsName="WGS 1984">
      <creation-date refresh-frequency="PT1H">2014-11-16T06:10:54-08:00</creation-date>
      <category>current observations and forecast</category>
    </product>
    <source>
      <production-center>Los Angeles/Oxnard, CA</production-center>
      <credit>http://www.wrh.noaa.gov/lox</credit>
      <more-information>http://www.nws.noaa.gov/forecasts/xml/</more-information>
    </source>
  </head>
  <data type="forecast">
    <location>
      <location-key>point1</location-key>
      <description>Los Angeles International Airport, CA</description>
      <point latitude="33.94" longitude="-118.39"/>
      <city state="CA">Los Angeles International Airport</city>
      <height datum="mean sea level">98</height>
    </location>
    <moreWeatherInformation applicable-location="point1">http://forecast.weather.gov/MapClick.php?lat=33.94&amp;lon=-118.39</moreWeatherInformation>
    <time-layout time-coordinate="local" summarization="12hourly">
      <layout-key>k-p6h-n1-1</layout-key>
      <start-valid-time>2014-11-16T08:00:00-08:00</start-valid-time>
      <end-valid-time>2014-11-22T18:00:00-08:00</end-valid-time>
    </time-layout>
    <time-layout time-coordinate="local" summarization="12hourly">
      <layout-key>k-p6h-n1-2</layout-key>
      <start-valid-time>2014-11-16T08:00:00-08:00</start-valid-time>
      <end-valid-time>2014-11-22T18:00:00-08:00</end-valid-time>
    </time-layout>
    <time-layout time-coordinate="local" summarization="12hourly">
      <layout-key>k-p12h-n13-1</layout-key>
      <start-valid-time period-name="Today">2014-11-16T06:00:00-08:00</start-valid-time>
      <start-valid-time period-name="Tonight">2014-11-16T18:00:00-08:00</start-valid-time>
      <start-valid-time period-name="Monday">2014-11-17T06:00:00-08:00</start-valid-time>
      <start-valid-time period-name="Monday Night">2014-11-17T18:00:00-08:00</start-valid-time>
      <start-valid-time period-name="Tuesday">2014-11-18T06:00:00-08:00</start-valid-time>
      <start-valid-time period-name="Tuesday Night">2014-11-18T18:00:00-08:00</start-valid-time>
      <start-valid-time period-name="Wednesday">2014-11-19T06:00:00-08:00</start-valid-time>
      <start-valid-time period-name="Wednesday Night">2014-11-19T18:00:00-08:00</start-valid-time>
      <start-valid-time period-name="Thursday">2014-11-20T06:00:00-08:00</start-valid-time>
      <start-valid-time period-name="Thursday Night">2014-11-20T18:00:00-08:00</start-valid-time>
      <start-valid-time period-name="Friday">2014-11-21T06:00:00-08:00</start-valid-time>
      <start-valid-time period-name="Friday Night">2014-11-21T18:00:00-08:00</start-valid-time>
      <start-valid-time period-name="Saturday">2014-11-22T06:00:00-08:00</start-valid-time>
    </time-layout>
    <time-layout time-coordinate="local" summarization="12hourly">
      <layout-key>k-p24h-n7-1</layout-key>
      <start-valid-time period-name="Today">2014-11-16T06:00:00-08:00</start-valid-time>
      <start-valid-time period-name="Monday">2014-11-17T06:00:00-08:00</start-valid-time>
      <start-valid-time period-name="Tuesday">2014-11-18T06:00:00-08:00</start-valid-time>
      <start-valid-time period-name="Wednesday">2014-11-19T06:00:00-08:00</start-valid-time>
      <start-valid-time period-name="Thursday">2014-11-20T06:00:00-08:00</start-valid-time>
      <start-valid-time period-name="Friday">2014-11-21T06:00:00-08:00</start-valid-time>
      <start-valid-time period-name="Saturday">2014-11-22T06:00:00-08:00</start-valid-time>
    </time-layout>
    <time-layout time-coordinate="local" summarization="12hourly">
      <layout-key>k-p24h-n6-2</layout-key>
      <start-valid-time period-name="Tonight">2014-11-16T18:00:00-08:00</start-valid-time>
      <start-valid-time period-name="Monday Night">2014-11-17T18:00:00-08:00</start-valid-time>
      <start-valid-time period-name="Tuesday Night">2014-11-18T18:00:00-08:00</start-valid-time>
      <start-valid-time period-name="Wednesday Night">2014-11-19T18:00:00-08:00</start-valid-time>
      <start-valid-time period-name="Thursday Night">2014-11-20T18:00:00-08:00</start-valid-time>
      <start-valid-time period-name="Friday Night">2014-11-21T18:00:00-08:00</start-valid-time>
    </time-layout>
    <parameters applicable-location="point1">
      <temperature type="maximum" units="Fahrenheit" time-layout="k-p24h-n7-1">
        <name>Daily Maximum Temperature</name>
        <value>74</value>
        <value>77</value>
        <value>80</value>
        <value>71</value>
        <value>67</value>
        <value>68</value>
        <value>68</value>
      </temperature>
      <temperature type="minimum" units="Fahrenheit" time-layout="k-p24h-n6-2">
        <name>Daily Minimum Temperature</name>
        <value>53</value>
        <value>55</value>
        <value>55</value>
        <value>58</value>
        <value>57</value>
        <value>56</value>
      </temperature>
      <probability-of-precipitation type="12 hour" units="percent" time-layout="k-p12h-n13-1">
        <name>12 Hourly Probability of Precipitation</name>
        <value xsi:nil="true"/>
        <value xsi:nil="true"/>
        <value xsi:nil="true"/>
        <value xsi:nil="true"/>
        <value xsi:nil="true"/>
        <value xsi:nil="true"/>
        <value xsi:nil="true"/>
        <value xsi:nil="true"/>
        <value xsi:nil="true"/>
        <value xsi:nil="true"/>
        <value xsi:nil="true"/>
        <value xsi:nil="true"/>
        <value xsi:nil="true"/>
      </probability-of-precipitation>
      <weather time-layout="k-p12h-n13-1">
        <name>Weather Type, Coverage, Intensity</name>
        <weather-conditions weather-summary="Sunny"/>
        <weather-conditions weather-summary="Mostly Clear"/>
        <weather-conditions weather-summary="Sunny"/>
        <weather-conditions weather-summary="Partly Cloudy"/>
        <weather-conditions weather-summary="Mostly Sunny"/>
        <weather-conditions weather-summary="Partly Cloudy"/>
        <weather-conditions weather-summary="Mostly Sunny"/>
        <weather-conditions weather-summary="Partly Cloudy"/>
        <weather-conditions weather-summary="Mostly Sunny"/>
        <weather-conditions weather-summary="Mostly Cloudy"/>
        <weather-conditions weather-summary="Slight Chc Rain"/>
        <weather-conditions weather-summary="Mostly Cloudy"/>
        <weather-conditions weather-summary="Mostly Sunny"/>
      </weather>
      <conditions-icon type="forecast-NWS" time-layout="k-p12h-n13-1">
        <name>Conditions Icon</name>
        <icon-link>http://forecast.weather.gov/images/wtf/medium/few.png</icon-link>
        <icon-link>http://forecast.weather.gov/images/wtf/medium/nfew.png</icon-link>
        <icon-link>http://forecast.weather.gov/images/wtf/medium/few.png</icon-link>
        <icon-link>http://forecast.weather.gov/images/wtf/medium/nsct.png</icon-link>
        <icon-link>http://forecast.weather.gov/images/wtf/medium/sct.png</icon-link>
        <icon-link>http://forecast.weather.gov/images/wtf/medium/nsct.png</icon-link>
        <icon-link>http://forecast.weather.gov/images/wtf/medium/sct.png</icon-link>
        <icon-link>http://forecast.weather.gov/images/wtf/medium/nsct.png</icon-link>
        <icon-link>http://forecast.weather.gov/images/wtf/medium/sct.png</icon-link>
        <icon-link>http://forecast.weather.gov/images/wtf/medium/nbkn.png</icon-link>
        <icon-link>http://forecast.weather.gov/images/wtf/medium/ra.png</icon-link>
        <icon-link>http://forecast.weather.gov/images/wtf/medium/nbkn.png</icon-link>
        <icon-link>http://forecast.weather.gov/images/wtf/medium/sct.png</icon-link>
      </conditions-icon>
      <hazards time-layout="k-p6h-n1-1">
        <name>Watches, Warnings, and Advisories</name>
        <hazard-conditions>
          <hazard headline="Red Flag Warning">
            <hazardTextURL>http://forecast.weather.gov/showsigwx.php?warnzone=CAZ041&amp;warncounty=CAC037&amp;firewxzone=CAZ241&amp;local_place1=Los+Angeles+International+Airport+CA&amp;product1=Red+Flag+Warning</hazardTextURL>
          </hazard>
        </hazard-conditions>
      </hazards>
      <hazards time-layout="k-p6h-n1-2">
        <name>Watches, Warnings, and Advisories</name>
        <hazard-conditions>
          <hazard headline="Wind Advisory">
            <hazardTextURL>http://forecast.weather.gov/showsigwx.php?warnzone=CAZ041&amp;warncounty=CAC037&amp;firewxzone=CAZ241&amp;local_place1=Los+Angeles+International+Airport+CA&amp;product1=Wind+Advisory</hazardTextURL>
          </hazard>
        </hazard-conditions>
      </hazards>
      <hazards time-layout="">
        <name>Watches, Warnings, and Advisories</name>
        <hazard-conditions>
          <hazard headline="Hazardous Weather Outlook">
            <hazardTextURL>http://forecast.weather.gov/showsigwx.php?warnzone=CAZ041&amp;warncounty=CAC037&amp;firewxzone=CAZ241&amp;local_place1=Los+Angeles+International+Airport+CA&amp;product1=Hazardous+Weather+Outlook</hazardTextURL>
          </hazard>
        </hazard-conditions>
      </hazards>
      <wordedForecast time-layout="k-p12h-n13-1" dataSource="loxNetcdf" wordGenerator="markMitchell">
        <name>Text Forecast</name>
        <text>Sunny, with a high near 74. North northeast wind around 5 mph becoming west southwest in the afternoon. </text>
        <text>Mostly clear, with a low around 53. North northwest wind around 5 mph becoming calm  after midnight. </text>
        <text>Sunny, with a high near 77. North northeast wind 5 to 10 mph becoming west in the afternoon. </text>
        <text>Partly cloudy, with a low around 55. West wind 5 to 10 mph becoming north northeast in the evening. </text>
        <text>Mostly sunny, with a high near 80. North northeast wind around 5 mph becoming east in the morning. </text>
        <text>Partly cloudy, with a low around 55.</text>
        <text>Mostly sunny, with a high near 71.</text>
        <text>Partly cloudy, with a low around 58.</text>
        <text>Mostly sunny, with a high near 67.</text>
        <text>Mostly cloudy, with a low around 57.</text>
        <text>A slight chance of rain.  Mostly cloudy, with a high near 68.</text>
        <text>Mostly cloudy, with a low around 56.</text>
        <text>Mostly sunny, with a high near 68.</text>
      </wordedForecast>
    </parameters>
  </data>
  <data type="current observations">
    <location>
      <location-key>point1</location-key>
      <point latitude="33.93806" longitude="-118.38889"/>
      <area-description>Los Angeles, Los Angeles International Airport, CA</area-description>
      <height datum="mean sea level" height-units="feet">125</height>
    </location>
    <moreWeatherInformation applicable-location="point1">http://www.wrh.noaa.gov/total_forecast/other_obs.php?wfo=lox&amp;zone=CAZ041</moreWeatherInformation>
    <time-layout time-coordinate="local">
      <layout-key>k-p1h-n1-1</layout-key>
      <start-valid-time period-name="current">2014-11-16T06:53:00</start-valid-time>
    </time-layout>
    <parameters applicable-location="point1">
      <temperature type="apparent" units="Fahrenheit" time-layout="k-p1h-n1-1">
        <value>58</value>
      </temperature>
      <temperature type="dew point" units="Fahrenheit" time-layout="k-p1h-n1-1">
        <value>55</value>
      </temperature>
      <humidity type="relative" time-layout="k-p1h-n1-1">
        <value>90</value>
      </humidity>
      <weather time-layout="k-p1h-n1-1">
        <name>Weather Type, Coverage, Intensity</name>
        <weather-conditions weather-summary="Partly Cloudy"/>
        <weather-conditions>
          <value>
            <visibility units="statute miles">10.00</visibility>
          </value>
        </weather-conditions>
      </weather>
      <conditions-icon type="forecast-NWS" time-layout="k-p1h-n1-1">
        <name>Conditions Icon</name>
        <icon-link>http://forecast.weather.gov/images/wtf/medium/sct.png</icon-link>
      </conditions-icon>
      <direction type="wind" units="degrees true" time-layout="k-p1h-n1-1">
        <value>0</value>
      </direction>
      <wind-speed type="gust" units="knots" time-layout="k-p1h-n1-1">
        <value>NA</value>
      </wind-speed>
      <wind-speed type="sustained" units="knots" time-layout="k-p1h-n1-1">
        <value>0</value>
      </wind-speed>
      <pressure type="barometer" units="inches of mercury" time-layout="k-p1h-n1-1">
        <value>30.13</value>
      </pressure>
    </parameters>
  </data>
</dwml>

http://forecast.weather.gov/MapClick.php?lat=33.94&lon=-118.4&FcstType=dwml

lat lon layer periods title capsule test version
33.94 -118.4         true 2017.10.08.24

 

Periods Parameter

Using the parameter 'periods' will limit the numbers of periods returned, regardless of how many are sent in the NWS data.

If NWS sends fewer periods than requested using this parameter, the number of periods actually in the NWS data are all that will be returned.

 

Capsule Retrieval

Using the 'lat', 'lon' and the 'capsule' parameters together will retrieve a current weather forecast. The values for the 'lat' and 'lon' parameters can be found here: http://developer.mapquest.com/web/tools/lat-long-finder.

The purpose for this is to provide a text based report for use in a web application. The 'capsule' parameter is further divided into data chunks that describe what and how you want the data displayed.

Basic Data Chunks:

Four basic data chunks are available: Title Display, Current Observations, Forecast Title Display and Forecast. The method used to create the capsule is to send a comma delimited string with the codes for each chunk. Please see the chart below for a complete listing of the codes available. For example, if a report containing the title and current observations were desired, the value for the capsule parameter would be sent like this: 'capsule=y,o'. The Forecast chunk works with the 'periods' parameter to limit the numbers of periods returned. The Title Display chunk will either display a basic location string or will display the text provided by the 'title' parameter.

There is a single modifier for the Current Observations chunk: 'c'. This will return more verbose text. If you use this modifier, you also need to include the observing station call sign encoded to be the ASCII values of the four characters that make up the ICAO code. The value for the weather observation stations can be found here: http://www.nws.noaa.gov/tg/siteloc.php. An Example: If you wanted to use the ICAO Code of 'klax', you would need to send the data chunk as 'oc107106097120'. NOTE: In order to get the additional data to build the verbose text, this may delay the build of the capsule slightly.

BASIC
CHUNK
CODE SAMPLE MODIFIER MODIFIER
RESULT
Title
Display
y Huntington, VA Weather    
Current
Observations
o Current Observations at 11:52 PM: Partly Cloudy,
20 degrees, with a north wind 10 mph.
c Current Observations at 11:52 pm EST: Partly Cloudy, 20 degrees.
Wind Speed: Northwest at 10.4 MPH (9 KT), Wind Chill: 9 F (-13 C)
Relative Humidity: 50%
Forecast Title
Display
z Forecast for Saturday at 4:27 PM    
Forecast f Tuesday: Mostly sunny, with a high near 57.    

First Example Link:

http://parfait.snarkybox.com/forecast.php?lat=33.94&lon=-118.4&periods=4&capsule=o,f,y,z

What that link returns will look like this if viewed in a browser:

Los Angeles International Airport, CA Weather

Current Observations at 11:53 PM: Partly Cloudy, 58 degrees, with a west wind 8 mph. 

Forecast for Saturday at 2:31 PM

Overnight: Patchy fog. Otherwise, mostly cloudy, with a low around 56. Calm wind becoming south southeast around 5 mph.

Sunday: Patchy fog before 11am. Otherwise, partly sunny, with a high near 64. Light and variable wind becoming west southwest 5 to 10 mph in the afternoon. Winds could gust as high as 20 mph.

Sunday Night: Increasing clouds, with a low around 57. West wind 5 to 10 mph becoming light south southwest in the evening. Winds could gust as high as 20 mph.

Monday: Cloudy, then gradually becoming mostly sunny, with a high near 63. Light and variable wind becoming west southwest 10 to 15 mph in the afternoon. Winds could gust as high as 20 mph.
    

 

Complete Data Retrieval, Header

Using the parameters 'lat', 'lon' and 'layer' together will retrieve weather data that is '|' section delimited, '~' segment delimited and '*' element delimited. The values for the 'lat' and 'lon' parameters can be found here: http://developer.mapquest.com/web/tools/lat-long-finder.

'layer=head' will return a header information line.

Example Link:

http://parfait.snarkybox.com/forecast.php?lat=33.94&lon=-118.4&layer=head

What that link returns will look like this if viewed in a browser:

hd*ParfaitAPI*http://parfait.snarkybox.com/*forecast*33.94*-118.4****head*20141210*2111*68.100.18.139*2014.12.10.13~|

Element Names:

hd00 hd01 hd02 hd03 hd04 hd05 hd06 hd07 hd08 hd09
layer_code API identification API URL "forecast" lat parameter lon parameter periods parameter NULL NULL layer parameter
token string anyURI token token token token NULL NULL token

hd10 hd11 hd12 hd13
date of request (CCYYMMDD) time of request (HHMM) Remote IP Address parfait version
token token token token

 

Complete Data Retrieval, Meta Data Retrieval

Using the parameters 'lat', 'lon' and 'layer' together will retrieve weather data that is '|' section delimited, '~' segment delimited and '*' element delimited. The values for the 'lat' and 'lon' parameters can be found here: http://developer.mapquest.com/web/tools/lat-long-finder.

'layer=meta' will retrieve the meta data about the forecast.

Example Link:

http://parfait.snarkybox.com/forecast.php?lat=33.94&lon=-118.4&layer=meta

What that link returns will look like this if viewed in a browser:

mt**46*-113.05*7000**2013-09-25T21:36:21-06:00*14*PT1H*Missoula, MT*http://www.wrh.noaa.gov/mso*markMitchell~|

Field Names:

mt00 mt01 mt02 mt03 mt04 mt05 mt06 mt07 mt08 mt09
layer_code description latitude longitude elevation NULL creation-date period_count refresh-frequency production-center
token token decimal decimal nonNegativeInteger NULL dateTime nonNegativeInteger duration string

mt10 mt11
credit wordGenerator
anyURI token

NOTE: Element mt07 is not actually contained in the data from NWS. It is either the count of periods that NWS has sent in the data or the quantity specified in the 'periods' parameter.

 

Complete Data Retrieval, Low Verbosity Data Retrieval

Using the parameters 'lat', 'lon' and 'layer' together will retrieve weather data that is '|' section delimited, '~' segment delimited and '*' element delimited. The values for the 'lat' and 'lon' parameters can be found here: http://developer.mapquest.com/web/tools/lat-long-finder.

'layer=low' will retrieve the forecasted weather data segments for all of the periods contained in the forecast.

Example Link:

http://parfait.snarkybox.com/forecast.php?lat=33.94&lon=-118.4&layer=low

What that link returns will look like this if viewed in a browser:

lo*00*Tonight*http://forecast.weather.gov/newimages/medium/nfew.png*Mostly Clear*52*Minimum*Fahrenheit*0~lo*01*Wednesday*http://forecast.weather.gov/newimages/medium/few.png*Sunny*69*Maximum*Fahrenheit*0~lo*02*Wednesday Night*http://forecast.weather.gov/newimages/medium/nfew.png*Mostly Clear*56*Minimum*Fahrenheit*0~lo*03*Thursday*http://forecast.weather.gov/newimages/medium/sct.png*Mostly Sunny*68*Maximum*Fahrenheit*0~lo*04*Thursday Night*http://forecast.weather.gov/newimages/medium/nsct.png*Partly Cloudy*57*Minimum*Fahrenheit*0~lo*05*Friday*http://forecast.weather.gov/newimages/medium/ra30.png*Chance Rain*62*Maximum*Fahrenheit*30~lo*06*Friday Night*http://forecast.weather.gov/newimages/medium/nra40.png*Chance Rain*51*Minimum*Fahrenheit*40~lo*07*Saturday*http://forecast.weather.gov/DualImage.php?i=ra&j=sct&ip=0*Slight Chance Rain then Mostly Sunny*65*Maximum*Fahrenheit*0~lo*08*Saturday Night*http://forecast.weather.gov/newimages/medium/nsct.png*Partly Cloudy*54*Minimum*Fahrenheit*0~lo*09*Sunday*http://forecast.weather.gov/newimages/medium/ra.png*Slight Chance Rain*64*Maximum*Fahrenheit*0~lo*10*Sunday Night*http://forecast.weather.gov/newimages/medium/nra.png*Slight Chance Rain*57*Minimum*Fahrenheit*0~lo*11*Monday*http://forecast.weather.gov/newimages/medium/ra.png*Slight Chance Rain*66*Maximum*Fahrenheit*0~lo*12*Monday Night*http://forecast.weather.gov/newimages/medium/nra.png*Slight Chance Rain and Breezy*53*Minimum*Fahrenheit*0~lo*13*Tuesday*http://forecast.weather.gov/newimages/medium/ra.png*Slight Chance Rain and Breezy*66*Maximum*Fahrenheit*0~|

Field Names:

lo00 lo01 lo02 lo03 lo04 lo05 lo06 lo07 lo08
layer_code period period-name icon-URL weather temp tempName tempUnits probability-of-precipitation
token token string anyURI string integer string string nonNegativeInteger

 

Complete Data Retrieval, High Verbosity Data Retrieval

Using the parameters 'lat', 'lon' and 'layer' together will retrieve weather data that is '|' section delimited, '~' segment delimited and '*' element delimited. The values for the 'lat' and 'lon' parameters can be found here: http://developer.mapquest.com/web/tools/lat-long-finder.

'layer=high' will retrieve the forecasted weather data in a natural language format for all of the periods contained in the forecast.

Example Link:

http://parfait.snarkybox.com/forecast.php?lat=33.94&lon=-118.4&layer=high

What that link returns will look like this if viewed in a browser:

tx*00*2013-09-26T00:00:00-06:00*Snow. Low around 26. North wind 9 to 11 mph. Chance of precipitation is 100%. Total nighttime snow accumulation of 4 to 8 inches possible.~tx*01*2013-09-26T06:00:00-06:00*Snow. High near 34. North northeast wind 9 to 13 mph becoming south in the morning. Winds could gust as high as 20 mph. Chance of precipitation is 100%. New snow accumulation of 1 to 3 inches possible.~tx*02*2013-09-26T18:00:00-06:00*Snow showers likely, mainly before 7pm. Mostly cloudy, with a low around 22. Northeast wind 5 to 11 mph becoming north northwest after midnight. Chance of precipitation is 60%. New snow accumulation of less than one inch possible.~tx*03*2013-09-27T06:00:00-06:00*A 20 percent chance of snow showers before 1pm. Mostly sunny, with a high near 41. North northwest wind around 5 mph becoming light and variable.~tx*04*2013-09-27T18:00:00-06:00*Partly cloudy, with a low around 30. West wind 5 to 9 mph.~tx*05*2013-09-28T06:00:00-06:00*Mostly sunny, with a high near 51.~tx*06*2013-09-28T18:00:00-06:00*Partly cloudy, with a low around 33.~tx*07*2013-09-29T06:00:00-06:00*Mostly sunny, with a high near 54.~tx*08*2013-09-29T18:00:00-06:00*A slight chance of rain. Partly cloudy, with a low around 35.~tx*09*2013-09-30T06:00:00-06:00*A slight chance of rain. Mostly sunny, with a high near 54.~tx*10*2013-09-30T18:00:00-06:00*A slight chance of rain. Partly cloudy, with a low around 35.~tx*11*2013-10-01T06:00:00-06:00*A slight chance of rain. Mostly sunny, with a high near 53.~tx*12*2013-10-01T18:00:00-06:00*A slight chance of rain and snow. Snow level 7800 feet lowering to 7000 feet after midnight. Partly cloudy, with a low around 34.~tx*13*2013-10-02T06:00:00-06:00*A slight chance of snow. Mostly sunny, with a high near 50.~|

Field Names:

hi00 hi01 hi02 hi03
layer_code period periodRange text
token token dateTime string

 

Complete Data Retrieval, Hazard Data Retrieval

Using the parameters 'lat', 'lon' and 'layer' together will retrieve weather data that is '|' section delimited, '~' segment delimited and '*' element delimited. The values for the 'lat' and 'lon' parameters can be found here: http://developer.mapquest.com/web/tools/lat-long-finder.

'layer=hazard' will retrieve the forecasted weather hazard data.

Example Link:

http://parfait.snarkybox.com/forecast.php?lat=33.94&lon=-118.4&layer=hazard

What that link returns will look like this if viewed in a browser:

hz*00*Winter Storm Warning*http://forecast.weather.gov/showsigwx.php?warnzone=WYZ015&warncounty=WYC013&firewxzone=WYZ288&local_place1=20+Miles+WSW+Fort+Washakie+WY&product1=Winter+Storm+Warning~hz*01*Hazardous Weather Outlook*http://forecast.weather.gov/showsigwx.php?warnzone=WYZ015&warncounty=WYC013&firewxzone=WYZ288&local_place1=20+Miles+WSW+Fort+Washakie+WY&product1=Hazardous+Weather+Outlook~|

Field Names:

hz00 hz01 hz02 hz03
layer_code hazardSerial Headline URL
token token string anyURI

 

Complete Data Retrieval, Combinations

Multiple 'layer' parameters can be sent by simply putting a comma between them: 'layer=meta,high' or 'layer=low,high'. This results in all of the segments requested being returned in the same line, so you would first split them by a tilde. The first element of each segment is the layer_code, so inspecting the first four characters will tell you which segment you're working with. Splitting each of these segments by an asterisk will get each of the elements. The values for the 'lat' and 'lon' parameters can be found here: http://developer.mapquest.com/web/tools/lat-long-finder.

NOTE: the order in which the layer strings occur does not affect the output order. 'layer=meta,high' will have the same result as 'layer=high,meta'. The output order is always: Header, Meta, Low Verbosity, High Verbosity, Hazard

Example Link:

http://parfait.snarkybox.com/forecast.php?lat=33.94&lon=-118.4&layer=head,meta,low,high&periods=4

What that link returns will look like this if viewed in a browser:

hd*ParfaitAPI*http://parfait.snarkybox.com/*forecast*33.94*-118.4*4***head,meta,low,high*20160309*0141*2601:140:8202:cd8f:58f4:351e:5d28:5681*2016.03.09.18~|mt*Los Angeles International Airport, CA*33.94*-118.39*98**2016-03-08T21:04:07-08:00*4*PT1H*Los Angeles/Oxnard, CA*http://www.wrh.noaa.gov/lox*markMitchell~|lo*00*Tonight*http://forecast.weather.gov/newimages/medium/nfew.png*Mostly Clear*52*Minimum*Fahrenheit*0~lo*01*Wednesday*http://forecast.weather.gov/newimages/medium/few.png*Sunny*69*Maximum*Fahrenheit*0~lo*02*Wednesday Night*http://forecast.weather.gov/newimages/medium/nfew.png*Mostly Clear*56*Minimum*Fahrenheit*0~lo*03*Thursday*http://forecast.weather.gov/newimages/medium/sct.png*Mostly Sunny*68*Maximum*Fahrenheit*0~|hi*00*2016-03-08T22:00:00-08:00*Mostly clear, with a low around 52. North wind 5 to 10 mph, with gusts as high as 15 mph.~hi*01*2016-03-09T06:00:00-08:00*Sunny, with a high near 69. East northeast wind 5 to 10 mph becoming west in the morning. Winds could gust as high as 15 mph.~hi*02*2016-03-09T18:00:00-08:00*Mostly clear, with a low around 56. Calm wind becoming east around 5 mph.~hi*03*2016-03-10T06:00:00-08:00*Mostly sunny, with a high near 68. East wind 5 to 15 mph becoming west in the morning. Winds could gust as high as 20 mph.~|

 

Error Messages

Should you accidentally use the API incorrectly or if the API didn't return any data from it's source feed, you may see one of two errors.

Missing API Parameters

If the API is unhappy about not being passed the appropriate parameters, you will see this message:

er*Missing API Parameters*It appears you have tried to access the API without passing all required parameters.*http://parfait.snarkybox.com/reuters.php*http://parfait.snarkybox.com/help-reuters.php~

No Data Returned

If for some reason the source feed didn't return any data to PARFAIT, you will see this message:

er*No Data Returned*It appears that no data was returned from the feed using the parameters you entered into the API.*http://parfait.snarkybox.com/reuters.php?feed=topneews&layer=low&items=3*http://parfait.snarkybox.com/help-reuters.php~

Field Names:

er00 er01 er02 er03 er04
layer_code error description source link help file link
token string string anyURI anyURI