### Accept Header Example for Formats
Source: https://www.weather.gov/documentation/services-web-api
Shows an example of the Accept header used for content negotiation, specifying the desired response format. The API supports formats like GeoJSON, JSON-LD, DWML, and others.
```HTTP
Accept: application/cap+xml
```
--------------------------------
### Feature-Flags Header Example
Source: https://www.weather.gov/documentation/services-web-api
Illustrates the use of the Feature-Flags header to enable or test new API features. Developers can use this to opt-in to experimental functionalities.
```HTTP
Feature-Flags: forecast_temperature_qv
```
--------------------------------
### User-Agent Header Example
Source: https://www.weather.gov/documentation/services-web-api
Demonstrates the required User-Agent header for identifying your application when making requests to the weather.gov API. Including contact information is recommended.
```HTTP
User-Agent: (myweatherapp.com, contact@myweatherapp.com)
```
--------------------------------
### Full Example CAP Alert (English)
Source: https://www.weather.gov/documentation/tb-alerts-CAP-Supporting-360-Character-and-Spanish-WEA
A complete example of a National Weather Service CAP alert message in XML format, detailing a Tornado Warning for a specific area. It includes standard CAP elements and specific NWS parameters.
```xml
NWS-IDP-DEV-3889295-3321272
w-nws.webmaster@noaa.gov
2020-01-23T08:23:00-06:00
Actual
Alert
Public
IPAWSv1.0
en-US
Met
Tornado Warning
Shelter
Immediate
Extreme
Observed
SAME
TOR
NationalWeatherService
TOW
2020-01-23T08:23:00-06:00
2020-01-23T08:23:00-06:00
2020-01-23T08:28:00-06:00
NWS Shreveport LA
Tornado Warning issued January 23 at 2:23PM CST until January 23 at 8:28AM CST by NWS Shreveport LA
The National Weather Service in Shreveport has issued a
* Tornado Warning for...
Southern Caldwell Parish in north central Louisiana...
Northeastern La Salle Parish in north central Louisiana...
* Until 228 PM
* At 223 PM CDT, a large and extremely dangerous tornado was located
near Midway, or 22 miles northeast of Pineville, moving northeast
at 40 mph.
This is a PARTICULARLY DANGEROUS SITUATION. TAKE COVER NOW!
HAZARD...Damaging tornado.
SOURCE...Radar indicated rotation.
```
--------------------------------
### Tornado Warning Alert XML (Example 2)
Source: https://www.weather.gov/documentation/tb-alerts-CAP-Supporting-360-Character-and-Spanish-WEA
This XML snippet represents another tornado warning alert, similar to the first example. It adheres to the Common Alerting Protocol (CAP) and includes essential information for public safety, such as event type, urgency, severity, and sender details.
```xml
NWS-IDP-DEV-3889297-3321274
w-nws.webmaster@noaa.gov
2020-01-23T08:24:00-06:00
Actual
Update
Public
IPAWSv1.0
w-nws.webmaster@noaa.gov,NWS-IDP-DEV-3889295-3321272,2020-01-23T08:23:00-06:00
en-US
Met
Tornado Warning
Shelter
Immediate
Extreme
Observed
SAME
TOR
NationalWeatherService
TOR
```
--------------------------------
### Tornado Warning Alert XML (Example 1)
Source: https://www.weather.gov/documentation/tb-alerts-CAP-Supporting-360-Character-and-Spanish-WEA
This XML snippet represents a specific tornado warning alert issued by the National Weather Service. It includes details such as hazard type, source, impact, affected areas, and specific parameters like hail size and tornado detection.
```xml
NWS-IDP-DEV-3889296-3321273
w-nws.webmaster@noaa.gov
2020-01-23T08:23:00-06:00
Actual
Update
Public
IPAWSv1.0
w-nws.webmaster@noaa.gov,NWS-IDP-DEV-3889295-3321272,2020-01-23T08:23:00-06:00
en-US
Met
Tornado Warning
Shelter
Immediate
Extreme
Observed
SAME
TOR
NationalWeatherService
TOR
HAZARD...Damaging tornado.
SOURCE...Radar indicated rotation.
IMPACT...You are in a life-threatening situation. Flying debris
may be deadly to those caught without shelter. Mobile
homes will be destroyed. Considerable damage to homes,
businesses, and vehicles is likely and complete
destruction is possible.
* The tornado will be near...
Jena around 410 PM CDT.
Midway around 415 PM CDT.
Other locations impacted by this tornadic thunderstorm include Nebo.
To repeat, a large, extremely dangerous and potentially deadly
tornado is developing. To protect your life, TAKE COVER NOW! Move to
a basement or an interior room on the lowest floor of a sturdy
building. Avoid windows. If you are outdoors, in a mobile home, or in
a vehicle, move to the closest substantial shelter and protect
yourself from flying debris.
http://www.weather.gov
eventMotionDescription
2020-01-23T15:01:00.000-06:00...storm...209DEG...35KT...31.6,-92.19
hailSize
1.75
tornadoDetection
RADAR INDICATED
tornadoDamageThreat
CONSIDERABLE
VTEC
/O.NEW.KSHV.TO.W.0048.200123T1423Z-200123T1428Z/
EAS-ORG
WXR
PIL
SHVTORSHV
BLOCKCHANNEL
EAS
BLOCKCHANNEL
NWEM
eventEndingTime
2020-01-23T08:28:00-06:00
CMAMlongtext
Servicio Nacional de Meteorologia: AVISO DE TORNADO en efecto hasta las 8:28 AM CST. Busque refugio ahora en un sotano o en el interior de un cuarto en el nivel mas bajo de un edificio seguro. Si esta al aire libre, en una casa movil, o en un vehiculo, debe ir al edificio seguro mas cercano y protegerse de proyectiles. Consulte los medios informativos.
CMAMtext
SNM: AVISO DE TORNADO hasta las 8:28 AM CST. Refugiese ahora. Consulte medios informativos.
WEAHandling
Imminent Threat
La Salle, LA; Caldwell, LA
31.72,-92.01 31.66,-92.04 31.55,-92.15 31.6,-92.28 31.93,-92.12 31.92,-92.01 31.72,-92.01
UGC
LAC059
UGC
LAC021
SAME
022059
SAME
022021
```
--------------------------------
### Get Active Alerts
Source: https://www.weather.gov/documentation/services-web-api
Retrieves active weather alerts filtered by area. The API supports various filters for alerts, including state, county, and zone.
```APIDOC
GET https://api.weather.gov/alerts/active?area={state}
Parameters:
- area: The area to filter alerts by (e.g., a state abbreviation like KS).
Example:
https://api.weather.gov/alerts/active?area=KS
Notes:
- The /alerts/active endpoint internally redirects to the root /alerts endpoint with 'active=true'.
- For detailed filter options, refer to the API's 'Specification' tab.
- Alerts are issued over the past seven days. For official archives, contact NCEI.
```
--------------------------------
### Get Gridpoint Forecast
Source: https://www.weather.gov/documentation/services-web-api
Retrieves the 12-hour forecast periods for a specific grid location. Forecasts are created by NWS Weather Forecast Offices (WFO) on their own grid definitions.
```APIDOC
GET https://api.weather.gov/gridpoints/{office}/{gridX},{gridY}/forecast
Parameters:
- office: The NWS Weather Forecast Office identifier (e.g., TOP).
- gridX: The X coordinate on the WFO's grid.
- gridY: The Y coordinate on the WFO's grid.
Example:
https://api.weather.gov/gridpoints/TOP/31,80/forecast
Notes:
- Forecasts are available for 12h periods over the next seven days.
- The 'forecastHourly' property provides hourly forecasts for the same period.
- The 'forecastGridData' property provides raw forecast data.
```
--------------------------------
### Get Grid Forecast by Coordinates
Source: https://www.weather.gov/documentation/services-web-api
Retrieves the current grid forecast endpoints for a given latitude and longitude. This is useful for finding the correct gridpoint URL for a specific location.
```APIDOC
GET https://api.weather.gov/points/{latitude},{longitude}
Parameters:
- latitude: The latitude of the point.
- longitude: The longitude of the point.
Example:
https://api.weather.gov/points/39.7456,-97.0892
Returns:
An object containing properties like 'forecast', 'forecastHourly', and 'forecastGridData' which are URLs to the respective forecast data.
Notes:
- GridX, gridY, and office values for a given coordinate may occasionally change, so periodic checks to this endpoint are recommended.
```
--------------------------------
### NWS API Web Service Overview
Source: https://www.weather.gov/documentation/services-web-api
Provides an overview of the National Weather Service (NWS) API, its purpose, design principles (cache-friendly, JSON-LD), base URL, and contact information for support and questions.
```APIDOC
National Weather Service (NWS) API Web Service
Purpose:
Allows developers access to critical forecasts, alerts, and observations, along with other weather data.
Base URL:
https://api.weather.gov
Design Principles:
- Cache-friendly approach: Content expires based upon the information life cycle.
- Based upon JSON-LD: Promotes machine data discovery.
Support:
- Operational issues: Report to nco.ops@noaa.gov
- General use questions: Ask on the API github site (https://weather-gov.github.io/api/)
Related Services:
- Alerts Web Service (/documentation/services-web-alerts)
- Technical Bulletins (/documentation/tb)
```
--------------------------------
### NWS Alerts API Usage Guidelines
Source: https://www.weather.gov/documentation/services-web-alerts
Guidelines for accessing NWS alerts via the alerts web service API. The API provides watches, warnings, advisories, and other products. It supports JSON-LD, CAP v1.2, and ATOM formats. Rate limiting is enforced to prevent abuse.
```APIDOC
NWS Alerts API:
Description: Provides access to NWS watches, warnings, advisories, and similar products.
Default Format: JSON-LD (for indexes and products).
Alternative Formats: CAP v1.2 (for products), ATOM (for indexes).
Endpoints: Refer to /documentation/services-web-api/ for detailed endpoint specifications.
Rate Limiting:
- Recommended request frequency: No more than once every 30 seconds.
- Consequences of exceeding limits: Temporary access restriction, potential permanent ban for continued abuse.
- Resolution for blocked access: Cease requests until the rate limit window expires.
Contact for assistance: sdb.support@noaa.gov
```
--------------------------------
### API Specification Link
Source: https://www.weather.gov/documentation/services-web-api
Provides the direct URL to the OpenAPI specification for the weather.gov API, which details available endpoints, parameters, and response structures.
```APIDOC
https://api.weather.gov/openapi.json
```
--------------------------------
### Forecast Formatting Options (DWML)
Source: https://www.weather.gov/documentation/services-web-api
Allows requesting forecast data in DWML format by setting the 'Accept' header. This is applicable to /forecast and /forecast/hourly endpoints.
```APIDOC
GET https://api.weather.gov/gridpoints/{office}/{gridX},{gridY}/forecast
Accept: application/vnd.noaa.dwml+xml
Example:
https://api.weather.gov/gridpoints/TOP/31,80/forecast
Notes:
- DWML format is not available for point lookups; use the /points endpoint first to get grid coordinates.
- The 'Accept' header must be set to 'application/vnd.noaa.dwml+xml' to receive DWML output.
```
--------------------------------
### NWS Alerts Web Service API Overview
Source: https://www.weather.gov/documentation/services-web-alerts
The National Weather Service (NWS) Alerts Web Service provides access to critical weather information such as watches, warnings, and advisories. It utilizes the Common Alerting Protocol (CAP) version 1.2 for data formatting. Developers can leverage the API alert endpoints to integrate this data into various applications and decision support tools.
```APIDOC
Alerts Web Service API:
Purpose: Provides NWS watches, warnings, advisories, and similar products.
Protocol: Common Alerting Protocol (CAP) v1.2.
Access: Via API alert endpoints.
Use Cases: Integration into third-party applications, decision support tools, and data redistribution.
Related Services:
- API Web Service
- Technical Bulletins
- Overview
- FAQ
- Issues/Changes
- Transition Guide
```
--------------------------------
### API Endpoint Resolutions and Fixes
Source: https://www.weather.gov/documentation/services-web-api
Details on resolved issues and improvements across various Weather.gov API endpoints, including observations, alerts, forecasts, and station data.
```APIDOC
Endpoint: /stations/{station id}/observations/latest
Description: XML data requests no longer fail when observation site reports variable (VRB) winds.
Endpoint: /alerts/types
Description: Updated to correct 'Evacuation Immediate' and add/remove types to align with the Hazards Map.
Endpoint: /gridpoints/{office}/{gridX},{gridY}/forecast
Description: PoP values less than 20% no longer display as null values.
Endpoint: /zones/{type}/{zoneId}/forecast
Description: Periods with extra ellipses (...) in the WFO's forecast zone text product (ZFP) are now properly displayed.
Endpoint: Gridpoints Endpoints (General)
Description: No longer return 503 errors when forecasts cross into a different year. Also, no longer expected to return frequent 500 errors.
Endpoint: /stations/{stationId}/tafs
Description: TAFs are available again.
Resource: Icon URLs
Description: Icon URLs have been corrected to return the full URL.
Endpoints: /gridpoints/forecast and /gridpoints/forecast/hourly
Description: Now work for WFO AFC (site id AER and ALU). Forecast endpoints no longer return a bad icons link when PoP = 0%.
Endpoint: /points
Description: Returns the correct grid values for locations within the WFO Anchorage public zones added in September 2023 (AKZ102, AKZ103, AKZ112, AKZ126, AKZ132, AKZ142).
```
--------------------------------
### Fetch All Active Alerts
Source: https://www.weather.gov/documentation/services-web-alerts
Retrieves all currently active weather alerts. This is the base endpoint for fetching alerts across all regions.
```APIDOC
GET https://api.weather.gov/alerts
Description:
Retrieves a list of all active weather alerts issued by the National Weather Service.
Parameters:
None
Returns:
A JSON object containing an array of active alert events.
```
--------------------------------
### Fetch Active Alerts by State
Source: https://www.weather.gov/documentation/services-web-alerts
Retrieves active weather alerts for a specific U.S. state. The state is identified by its two-letter postal abbreviation.
```APIDOC
GET https://api.weather.gov/alerts/active?area={state_code}
Description:
Retrieves active weather alerts filtered by a specific U.S. state.
Parameters:
area (string, required): The two-letter postal abbreviation for the state (e.g., MO for Missouri).
Returns:
A JSON object containing an array of active alert events for the specified state.
```
--------------------------------
### Fetch Active Alerts by Zone
Source: https://www.weather.gov/documentation/services-web-alerts
Retrieves active weather alerts for a specific zone, which can represent a county, metropolitan area, or other defined geographical zone.
```APIDOC
GET https://api.weather.gov/alerts/active?zone={zone_code}
Description:
Retrieves active weather alerts filtered by a specific zone.
Parameters:
zone (string, required): The code representing the zone (e.g., ALZ034 for Bibb County, Alabama or ALC007 for Bibb County, Alabama).
Returns:
A JSON object containing an array of active alert events for the specified zone.
```
--------------------------------
### Fetch Active Alerts by Marine Area
Source: https://www.weather.gov/documentation/services-web-alerts
Retrieves active weather alerts for a specific marine area. Marine areas are identified by specific codes.
```APIDOC
GET https://api.weather.gov/alerts/active?area={marine_area_code}
Description:
Retrieves active weather alerts filtered by a specific marine area.
Parameters:
area (string, required): The code representing the marine area (e.g., LM for Lake Michigan).
Returns:
A JSON object containing an array of active alert events for the specified marine area.
```
--------------------------------
### Fetch Active Alerts by Point (Latitude, Longitude)
Source: https://www.weather.gov/documentation/services-web-alerts
Retrieves active weather alerts for a specific geographical point defined by latitude and longitude.
```APIDOC
GET https://api.weather.gov/alerts/active?point={latitude},{longitude}
Description:
Retrieves active weather alerts for a specific geographical point.
Parameters:
point (string, required): A comma-separated string of latitude and longitude (e.g., 39,-90).
Returns:
A JSON object containing an array of active alert events for the specified point.
```
--------------------------------
### Fetch Active Alerts by Region
Source: https://www.weather.gov/documentation/services-web-alerts
Retrieves active weather alerts for a specified geographical region. Regions are identified by specific codes.
```APIDOC
GET https://api.weather.gov/alerts/active?region={region_code}
Description:
Retrieves active weather alerts filtered by a specific geographical region.
Parameters:
region (string, required): The code representing the region (e.g., AT for Atlantic).
Returns:
A JSON object containing an array of active alert events for the specified region.
```
--------------------------------
### Feature Flags for Gridpoint Forecasts
Source: https://www.weather.gov/documentation/services-web-api
Endpoint specific feature flags that modify the output format for gridpoint forecasts.
```APIDOC
Endpoint:
/gridpoints/{wfo}/{x},{y}/forecast
/gridpoints/{wfo}/{x},{y}/forecast/hourly
Feature Flags:
- forecast_temperature_qv: Represent temperature as QuantitativeValue.
- forecast_wind_speed_qv: Represent wind speed as QuantitativeValue.
```
--------------------------------
### Feature Flags for Station Data
Source: https://www.weather.gov/documentation/services-web-api
Endpoint specific feature flags that modify the output format for station data.
```APIDOC
Endpoints:
/stations
/stations/{stationId}
/gridpoints/{wfo}/{x},{y}/stations
Feature Flags:
- obs_station_provider: Show provider and subProvider MADIS details.
```
--------------------------------
### Tornado Warning Parameters
Source: https://www.weather.gov/documentation/tb-alerts-CAP-Supporting-360-Character-and-Spanish-WEA
This section details the key parameters found within a National Weather Service tornado warning alert. These parameters provide specific information about the threat, affected regions, and recommended actions.
```APIDOC
TornadoWarning:
description: Detailed description of the tornado warning.
instruction: Safety instructions for the public during the warning.
web: URL for more information.
parameter:
eventMotionDescription: String - Timestamp, storm details, direction, speed, and coordinates (e.g., "2020-01-23T15:01:00.000-06:00...storm...209DEG...35KT...31.6,-92.19").
hailSize: Float - Size of hail reported in inches (e.g., "1.75").
tornadoDetection: String - Method of tornado detection (e.g., "RADAR INDICATED", "CONFIRMED").
tornadoDamageThreat: String - Assessed threat level for damage (e.g., "CONSIDERABLE", "DESTRUCTIVE").
VTEC: String - Value of the National Weather Service's VTEC code, indicating event type and duration (e.g., "/O.NEW.KSHV.TO.W.0048.200123T1423Z-200123T1428Z/").
EAS-ORG: String - Emergency Alert System originating station identifier (e.g., "WXR").
PIL: String - Primary Information Line identifier (e.g., "SHVTORSHV").
BLOCKCHANNEL: String - Channels for alert distribution (e.g., "EAS", "NWEM").
eventEndingTime: String - The scheduled end time of the event in ISO 8601 format (e.g., "2020-01-23T08:28:00-06:00").
WEAHandling: String - Handling instruction for Wireless Emergency Alerts (e.g., "Imminent Threat").
CMAMlongtext: String - Long-form alert message for public dissemination.
CMAMtext: String - Short-form alert message for public dissemination.
area:
areaDesc: String - Description of the affected geographical areas (e.g., "La Salle, LA; Caldwell, LA").
polygon: String - Geographical boundaries defined by a series of coordinates.
geocode:
valueName: String - Type of geocode (e.g., "UGC", "SAME").
value: String - The actual geocode value (e.g., "LAC059", "022059").
info:
language: String - Language of the alert message (e.g., "en-US", "es-US").
category: String - Category of the alert (e.g., "Met").
event: String - Type of event (e.g., "Tornado Warning").
responseType: String - Recommended public action (e.g., "Shelter").
urgency: String - Urgency of the event (e.g., "Immediate").
severity: String - Severity of the event (e.g., "Extreme").
certainty: String - Certainty of the event occurrence (e.g., "Observed").
eventCode:
valueName: String - Type of event code (e.g., "SAME", "NationalWeatherService").
value: String - The event code itself (e.g., "TOR", "TOW").
effective: String - Time the alert becomes effective.
onset: String - Time the event is expected to begin.
expires: String - Time the alert is scheduled to expire.
senderName: String - Name of the issuing authority (e.g., "NWS Shreveport LA").
headline: String - A concise summary of the alert.
description: String - Full descriptive text of the alert, including specific locations and times.
```
--------------------------------
### CAP Message Structure for Extended WEA
Source: https://www.weather.gov/documentation/tb-alerts-CAP-Supporting-360-Character-and-Spanish-WEA
Illustrates the structure of NWS CAP messages incorporating parameters for extended Wireless Emergency Alerts (WEA), including long text and handling instructions. This format supports the FCC's expansion of WEA capabilities.
```xml
en-US
...
WEAHandling
Imminent Threat
CMAMlongtext
**National Weather Service: TORNADO WARNING in this area until 12:00 AM EDT. Take shelter now in a basement or an interior room on the lowest floor of a sturdy building. If you are outdoors, in a mobile home, or in a vehicle, move to the closest substantial shelter and protect yourself from flying debris. Check media.<**/value>
CMAMtext
**NWS: TORNADO WARNING in this area til 12:00 AM EDT. Take shelter now. Check media.**
...
```
--------------------------------
### CAP Message Structure for Spanish WEA
Source: https://www.weather.gov/documentation/tb-alerts-CAP-Supporting-360-Character-and-Spanish-WEA
Demonstrates how to include Spanish language Wireless Emergency Alerts (WEA) within NWS CAP messages. This involves adding a second block with Spanish language codes and translated alert text.
```xml
es-US
...
WEAHandling
Imminent Threat
CMAMlongtext
**Servicio Nacional de Meteorologia: AVISO DE TORNADO en efecto hasta las 12:00 AM EDT. Busque refugio ahora en un sotano o en el interior de un cuarto en el nivel mas bajo de un edificio seguro. Si esta al aire libre, en una casa movil, o en un vehiculo, debe ir al edificio seguro mas cercano y protegerse de proyectiles. Consulte los medios informativos.**
CMAMtext
**SNM: AVISO DE TORNADO hasta las 10:33 AM CDT. Refugiese ahora. Consulte medios informativos.**
...
```
=== COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.