weatherAlerts in REST API?

Has anyone been able to receive "weatherAlerts" back when calling the REST API?

I can successfully pull currentWeather, forecastDaily, forecastHourly, and forecastNextHour, but I can't get it to return anything for a weatherAlert. This is true even when I'm using a location that I know has a current weather alert from the National Weather Service.

For what it's worth, it is listed as a possible dataset when I check using "availability."

Thanks!

I had the same issue and just discovered that the documentation for the query parameters specified here is incorrect: https://developer.apple.com/documentation/weatherkitrestapi/get_api_v1_weather_language_latitude_longitude

Instead of passing a "countryCode: parameter you need to use "country".

I have the same issue with Weather Alert. How to use it? How the correct url should looks like?

This answer from @nialloriordan solved it for me.

Here is a working URL for REST API showing weatherAlert summary (you have to follow the detailsUrl to get the description.

https://weatherkit.apple.com/api/v1/weather/en/33.4586734/-112.157199?dataSets=forecastDaily,weatherAlerts&timezone=MST&country=US

HTH!

weatherAlerts in REST API?
 
 
Q