Return to API Services or NWS Text Products Interface.

Documentation for /cgi-bin/afos/retrieve.py

This service returns NWS Text Products from the IEM's database. The database updates in near real-time, so it should be considered a near real-time source with minimal latency.

Changelog

  • 2024-08-25: Add order parameter to allow for order of the returned products.
  • 2024-03-29: Initial documentation release and migrate to a pydantic schema verification.

Examples

Return all TORnado warnings issued between 20 and 21 UTC on 27 Apr 2011 as a zip file.

https://mesonet.agron.iastate.edu/cgi-bin/afos/retrieve.py?sdate=2011-04-27T20:00Z&edate=2011-04-27T21:00Z&pil=TOR&fmt=zip&limit=9999

Return the last Area Forecast Discussion from NWS Des Moines as text

https://mesonet.agron.iastate.edu/cgi-bin/afos/retrieve.py?pil=AFDDMX

Retrieve recent METAR observations for KDSM, note that this only works for recent data, no archive support with this API.

https://mesonet.agron.iastate.edu/cgi-bin/afos/retrieve.py?pil=MTRDSM

Use the WAR pil shortcut to retrieve a number of Des Moines products

https://mesonet.agron.iastate.edu/cgi-bin/afos/retrieve.py?pil=WARDSM

Return the last AFDDMX product in text format

https://mesonet.agron.iastate.edu/cgi-bin/afos/retrieve.py?pil=AFDDMX&fmt=text

Return a zip file of AFDDMX products during 2024

https://mesonet.agron.iastate.edu/cgi-bin/afos/retrieve.py?pil=AFDDMX&fmt=zip&sdate=2024-01-01T00:00Z&edate=2024-12-31T23:59Z

CGI Arguments

The following table lists the CGI arguments that are accepted by this service. A HTTP GET request is required. Fields of type Multi-Params or CSV value can accept either a comma separated list or multiple parameter and value combinations. For example, ?foo=1&foo=2 is equivalent to ?foo=1,2.

Field Type Description
center string The 4 character source iddentifier to limit the search to. This is typically only used when a PIL is ambiguous
dl boolean If set to 1, the returned data will be downloaded as a file
edate string or null The ending timestamp in UTC to limit the database search. This value is exclusive.
fmt string The format of the returned data, either text, html, or zip. The meaning of text is to return something that resembles what would have been sent over the NWS NOAAPort system. The html format is a bit more human readable. The zip format will return a zip file containing the text products, one file per product.
limit integer The number of products to return, default is 1. This number is limited to 9999.
pil Multi-Params or CSV value (required) The 3 to 6 character AFOS ID / Product ID to query for. This is typically the third line of a NWS Text Product. A special case of WAR will return FLS, FFS, AWW, TOR, SVR, FFW, SVS, LSR, SPS, WSW, FFA, WCN, NPW products.
sdate string or null The starting timestamp in UTC to limit the database search. This value is inclusive.
order string The order of the returned products, either 'asc' or 'desc'
ttaaii string The 6 character WMO Header to limit the search to. This is typically only used when a PIL is ambiguous