My pipeline broke today as new fields were added for the current weather dataset:
cloudCoverLowAltPct
cloudCoverMidAltPct
cloudCoverHighAltPct
I presumed new fields would only be released in a new version of the API? Is there any way to use a specific version of the API that will not be subject to change?
The current weather REST API docs are here, which don't include these fields: https://developer.apple.com/documentation/weatherkitrestapi/currentweather/currentweatherdata
Post
Replies
Boosts
Views
Activity
The REST API documentation for obtaining weather data is now out of date.
The current documentation states the following for dailyStart
The time to start the daily forecast. If this parameter is absent, daily forecasts start on the current day.
However, I now receive 404 errors if the dailyStart field is not present. An example 404 error below:
404 Client Error: Not Found for url: https://weatherkit.apple.com/api/v1/weather/en/51.4902665589415/-0.173959748540426?dataSets=forecastHourly&timezone=UTC&country=GB&dailyEnd=2023-02-26T17%3A18%3A08Z
However, the following URL succeeds when dailyStart is present:
'https://weatherkit.apple.com/api/v1/weather/en/51.4902665589415/-0.173959748540426?dataSets=forecastHourly&timezone=UTC&country=GB&dailyEnd=2023-02-26T17%3A18%3A08Z&dailyStart=2023-02-19T17%3A24%3A28Z'
Is it possible to retrieve historical weather alerts via the REST API?
For example, the following URLs return the same results despite different values for hourlyStart and currentAsOf:
https://weatherkit.apple.com/api/v1/weather/en/43.58723/13.52492?dataSets=weatherAlerts&timezone=UTC&country=IT
https://weatherkit.apple.com/api/v1/weather/en/43.58723/13.52492?dataSets=weatherAlerts&timezone=UTC&country=IT¤tAsOf=2022-01-20T00%3A00%3A00Z&hourlyStart=2022-01-20T00%3A00%3A00Z
https://weatherkit.apple.com/api/v1/weather/en/43.58723/13.52492?dataSets=weatherAlerts&timezone=UTC&country=IT¤tAsOf=2022-01-20T00%3A00%3A00Z
https://weatherkit.apple.com/api/v1/weather/en/43.58723/13.52492?dataSets=weatherAlerts&timezone=UTC&country=IT&hourlyStart=2022-01-20T00%3A00%3A00Z
Results:
{'weatherAlerts': {'name': 'WeatherAlertCollection',
'metadata': {'attributionURL': 'https://weatherkit.apple.com/legal-attribution.html',
'expireTime': '2023-01-26T23:54:24Z',
'language': 'en-US',
'latitude': 43.587,
'longitude': 13.525,
'providerName': 'Italian Air Force National Meteorological Service',
'readTime': '2023-01-26T23:49:24Z',
'reportedTime': '2023-01-26T23:49:24Z',
'version': 1},
'detailsUrl': 'https://weatherkit.apple.com/alertDetails/index.html?ids=9d853cc3-0db2-5561-99ba-e6fbd2ac4b28&lang=en-US&timezone=UTC',
'alerts': [{'name': 'WeatherAlertSummary',
'id': '9d853cc3-0db2-5561-99ba-e6fbd2ac4b28',
'areaId': 'IT011',
'areaName': 'Marche',
'attributionURL': 'https://meteoalarm.org',
'countryCode': 'IT',
'description': 'Moderate Snow or Ice Warning',
'effectiveTime': '2023-01-26T23:00:00Z',
'expireTime': '2023-01-27T22:59:00Z',
'issuedTime': '2023-01-25T09:54:34Z',
'eventOnsetTime': '2023-01-26T23:00:00Z',
'detailsUrl': 'https://weatherkit.apple.com/alertDetails/index.html?ids=9d853cc3-0db2-5561-99ba-e6fbd2ac4b28&lang=en-US&timezone=UTC',
'phenomenon': 'Ice',
'precedence': 0,
'severity': 'moderate',
'source': 'Italian Air Force National Meteorological Service',
'eventSource': 'EUMETNET',
'urgency': 'future',
'certainty': 'likely',
'importance': 'normal',
'responses': ['monitor']}]}}