Hi There, My app displays both daily and hourly forecast information, as consumed from the Weatherkit API.
I would also like to let my users know when the forecast was generated/issued. The reason being, if a forecast was issued 1-2 hours in the past for example, then the user(s) will know to refresh the weather forecast for the latest information soon.
Looking through the docs, I don't see any way of accessing this information. I would expect it to be available on the hourlyForecast.metadata property.
Does anyone know if it's possible to obtain the 'issued time' of the forecast? (both hourly and daily).
Thanks
The response metadata contains a few fields that would help make this decision.
readTime
- The time at which the response data was read from WeatherKit.reportedTime
- The time at which the source data was made available from the data provider. For the daily and hourly forecasts this is the time that the global weather model was run and all the data from which we built the response was made available. This is likely the value you are asking about.expireTime
- This tells you (and your users) when the forecast information should be refreshed.
Our recommendation would be to just use expireTime to determine when the data is due to be refreshed rather than estimating it yourself.