I am also having persistent problems with historical data from WeatherKit. There are certain locations, on certain dates, where the service throws an unhandled error. I used a Technical Support Incident to try to get help and was told there is no workaround. I've had FB open with them since November 2023 for these issues and seen no movement on the topic. I have also posted about it on these forums here..
It's particularly frustrating because
- If you request a date range that is fully missing, the API throws an error of an internal / private type (can't specifically catch it).
- If you request a date range that has partial missing data, the API silently fails to return the missing data (no errors thrown, just some dates don't get returned).
At this point I think WeatherKit is not suitable for use as a source of historical data. It doesn't seem to be a well tested aspect of the service, presumably because the historical data doesn't get a lot of use by developers. We are working on an alternate data vendor for our app for historical data. We may continue to use WeatherKit for current / recent weather, as that always works for us so far, but historical weather is unreliable.
I've got a GitHub gist with stand alone code to replicate the problem if anyone wants to play with what the errors look like.
Maybe if more people express an interest in historical data and file Feedbacks the issue might get more visibility.