How to request NWS weather alerts
This section provides an example of a HERE Destination Weather API request for NWS weather warnings and watches for a specific location.
Note
This example uses a HERE token to authenticate your request. For the available authentication options, see the Identity and Access Management Developer Guide.
User story
The user wants to obtain all active weather alerts for Lufkin, Texas.
Request summary
| Resource | report |
|---|---|
Parameters products: Indicates what kind of report the query requests; in this example, the query uses the parameter value nws_alerts to request any active weather alerts. q: Indicates the location name for which the query requests severe weather alerts. |
Request
The following code block demonstrates the complete request, specifying that the response data is to be delivered in JSON.
curl https://weather.hereapi.com/v3/report
?products=nwsAlerts
&q=Miami
-H "Authorization: Bearer {YOUR_TOKEN}"Response
The response to the request contains:
- Active weather warnings.
The example response in JSON format is as follows:
{
"places": [
{
"nwsAlerts": {
"warnings": [],
"watches": [
{
"counties": [],
"zones": [
{
"value": "FLZ063",
"country": "US",
"countryName": "United States",
"state": "FL",
"stateName": "Florida",
"name": "Glades",
"location": {
"lat": 26.9605,
"lng": -81.2397
}
}
],
"provinces": [],
"type": 6,
"description": "Flood Watch",
"severity": 5,
"message": "* WHAT. Flooding caused by excessive rainfall continues to be possible. * WHERE. Portions of southeast, southern, and southwest Florida, including the following areas, in southeast Florida, Coastal Broward County, Coastal Miami Dade County, Coastal Palm Beach County, Far South Miami-Dade County, Inland Broward County, Inland Miami-Dade County, Inland Palm Beach County, Metro Broward County, Metro Palm Beach County and Metropolitan Miami Dade. In southern Florida, Glades and Hendry. In southwest Florida, Coastal Collier County, Inland Collier County and Mainland Monroe. * WHEN. Through Wednesday evening. * IMPACTS. Excessive runoff may result in flooding of rivers, creeks, streams, and other low-lying and flood-prone locations. Flooding may occur in poor drainage and urban areas. * ADDITIONAL DETAILS. - Enhanced tropical moisture is expected to pool across South Florida beginning on Tuesday. This will result in periods of heavy rain. High rainfall rates and slow moving storms will result in flooding concerns, especially in urban and poor drainage locations. Rainfall totals from Tuesday morning through Wednesday evening are forecast to be 6-9 inches across Southwest Florida and the Lake Okeechobee region, and 2-5 inches over the east coast metro, with locally higher amounts possible. Additional heavy rain is possible later in the week. - http://www.weather.gov/safety/flood",
"name": "Jessie Willies",
"validFromTimeLocal": "2024-06-11T02:47:00-04:00",
"validUntilTimeLocal": "2024-06-11T15:15:00-04:00"
}
]
}
}
]
}For more details about responses to this type of request, see Report response For more information, see Weather report.
Updated 11 days ago