WeatherKit Historical Data Request Limited to 10 Days

Until recently, I was unable to use WeatherKit to obtain historical Daily data. Now, it appears that I can retrieve Daily and Hourly historical data, but the returned data is limited to a ten day period. No matter what start and end dates are included, I get data from start date to 10 days later (assuming the end date was more than 10 days after the start).

Is this a permanent restriction?

Example: let historicalData = try await weatherService.weather(for: location, including: .daily(startDate: startDate, endDate: endDate))

Answered by DTS Engineer in 739642022

Yes, the restriction is intentional, to limit the performance impact of requests with wide date ranges. The correct approach is to make multiple requests for each of the shorter date ranges you want.

Accepted Answer

Yes, the restriction is intentional, to limit the performance impact of requests with wide date ranges. The correct approach is to make multiple requests for each of the shorter date ranges you want.

Is this currently working? When I try this code with a date range shorter than 10 days I get back the historical high and low temperatures for the first and last date only; not for all the dates in the date range. Sample code is the same as the one given by @JohnOfSF above. Here's a sample output:

Aborting silent interpolation: additional missing products that need to be fetched from the server anyway; location=CLLocationCoordinate2D(latitude: 37.77, longitude: -122.41), missing products=[WeatherDaemon.WeatherProduct.forecastDaily]

days count=4, date range=2023-10-18 07:00:00 +0000 to 2023-10-21 07:00:00 +0000, first condition=Mostly Clear, first high=28.52 °C, first low=14.12 °C, last condition=Partly Cloudy, last high=19.17 °C, last low=13.05 °C

Note the missing data for the days in between 10/18/2023 and 10/21/2023. Is this how this is supposed to work? If so, what is the point of providing a data range? Is there a different call/function I should be using to get all the data for the entire date range?

WeatherKit Historical Data Request Limited to 10 Days
 
 
Q