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
- 2025-01-22: Added aviation_afd flag for the specific case of retrieving the "Aviation" section of an Area Forecast Discussion.
- 2025-01-08: Added some caching due to incessant requests for the same data.
- 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 of the Daily Summary Messages for Des Moines from 1 Jan 2025 to 9 Jan 2025 in text format.
Return all TORnado warnings issued between 20 and 21 UTC on 27 Apr 2011 as a zip file.
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
Return the aviation section of the latest AFD from NWS Des Moines
https://mesonet.agron.iastate.edu/cgi-bin/afos/retrieve.py?pil=AFDDMX&aviation_afd=1
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 |
---|---|---|
aviation_afd | boolean | If set to 1, the returned data will be the 'Aviation' section of an Area Forecast Discussion. This requires the PIL to be an AFD product and a limit of 1 set. |
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 |