Hourly history with WeatherKit REST API

Has anyone figured out the correct incantation of request parameters to get historic hourly weather conditions from WeatherKit? I've tried every combo of hourlyStart, dailyStart, currentAsOf, etc with past dates and it seems like the oldest it will go back to is midnight for today. I would like to get the last 24 hours of conditions.

Post not yet marked as solved Up vote post of John_s25 Down vote post of John_s25
1.6k views

Replies

Ditto! It respects dailyEnd, but not dailyStart. This query will yield an empty array. Removing dailyEnd will return 10 days of June.

https://weatherkit.apple.com/api/v1/weather/en/41.029/-74.642
?dataSets=forecastDaily
&currentAsOf=2022-01-01T00:00:00Z
&dailyStart=2022-01-01T00:00:00Z
&dailyEnd=2022-01-07T00:00:00Z
&timezone=Americas/Los_Angeles
&countryCode=US

It's probably forthcoming later this summer, but filed FB10383199.

  • Did you ever got an answer to this? I am running into the same issue now so I assume this is not fixed yet. Basically any combinations of dailyStart and dailyEnd are always returning 10 days forecast from the current date. Do you have any idea of when this historical data will be available?

    Thanks!

  • Historical data is currently available back to Aug 1, 2021. Requests can cover any time period of up to 10 days from that date until 10 days from current.

  • @ Frameworks Engineer: Please also bring back earlier dates. Many great app ideas won't work otherwise.

Add a Comment

Yeah - we are having the same problems. Can get current weather only but are much more interested in historical.

Lucky you! :) I cannot even get currentWeather. Constantly receiving 401 response.

Same problem here, no way to get the historical data, even though this is advertised. I'm using darksky.net now, which Apple has acquired. Need to port my code to the WeatherKit, and I thought it would be easier with all being on the Apple platform. However, it has has given a lot of headaches so far to try and get everything to work.. :(

Thank you all for the reports. This is a known issue that will be addressed soon.

  • great! love it when you respond directly to threads like this :)

Add a Comment

With the Darksky API, it was possible to get hourly historical weather data of 50 years back. I am struggling with getting the same from the Weatherkit API. Is there an example call that provide e.g. the historical hourly weather data on a specific location, and a date of e.g. 20 years back?

  • Historical weather has been problematic, particularly with daily historical requests for earlier this year, say January 1, 2022. Daily historical weather for days between September and December 2021 have been somewhat reliable. Also, using Time Machine with Carrot Weather and Apple as the weather source led to flakey results. For example, sometimes the hourly results display but not the daily. Just now I checked Carrot Weather again going to the year 2000. Both hourly and daily were retrieved!

  • Historical data is available back to Aug 1, 2021. Requests for earlier dates will not return data.

Add a Comment

With the Swift API (not REST) I'm still finding it to be hit or miss. Here's a look ...

// Historical daily request let forecast: Forecast<WeatherKit.DayWeather> = try await weatherService.weather(for: location, including: .daily(startDate: november24-2021, endDate: november25-2021))

Yes it is still not working even though iOS 16 has been released in the meantime. Not good :(

request like this can get historic hourly weather conditions, but it's not accurate in my area:

GET /api/v1/weather/zh-CN/28.212151/112.955606?countryCode=CN&timeZone=Asia%2FShanghai&dataSets=forecastHourly&hourlyStart=2022-12-15T23%3A46%3A03Z&hourlyEnd=2022-12-17T23%3A46%3A03Z