WeatherKit

RSS for tag

Bring weather information to your apps and services through a wide range of data that can help people stay up to date, safe, and prepared.

WeatherKit Documentation

Posts under WeatherKit tag

68 Posts
Sort by:
Post not yet marked as solved
0 Replies
345 Views
I am writing an integration with WeatherKit. I need to get several metrics of the Wind data like WindSpeed, windGust. In the CurrentWeatherData object I have all this data. However I also need to have the prediction of this metric slightly into the future. For example I need to get these levels in 5mins intervals from up to 30mins from now. NextHourForecastData seems like the obvious place for this considering it does show Forecasted data everyminute, however only for PrecipitationChance and PrecipitationIntensity. Is there a better dataSet that I can use? In fact I would already be happy to get the maximum during that period. It seems that the HourlyForecast would perhaps also be a solution but as far as I can tell this one is always linked to the start of the hour (i.e. XX:00) which makes it complicated to work with, and not very helpful if I'm making the request at XX:15, etc Alternatively I can get the currentWeather DataSet for multiple timestamps using the currentAsOf parameter. This is a crude approach but from what I can see to do that I would need to do multiple API calls which is rather wasteful and not exactly cheap for multiple systems/locations. Is there perhaps a way to make a call for multiple timestamps and/or locations? Many thanks in advance
Posted Last updated
.
Post marked as solved
1 Replies
874 Views
Hello! Hope you had an amazing Dub Dub week. I am currently integrating widgets into my weather app. The widgets use WeatherKit to get the hourly forecast. I have issues formatting or displaying dates for the locations. When I display the date for 2 or more locations with different timezones, the hours displayed are local for the phone, not the location I'm grabbing the weather for. This is how I display the date. hour is the Forecast item from WeatherKit. Text(hour.date.formatted(date: .omitted, time: .shortened)) Example: Neither of the locations' time is 9:00. They are in different time zones with 10 hours difference, one should be different from the other.
Posted
by ivan_iv.
Last updated
.
Post not yet marked as solved
1 Replies
603 Views
Hello. I noticed pretty early on that WeatherService.shared.weather seems to cache results. I realized this when I called it, killed network connectivity to my device, and then called it again I still got results back. My concern is about my widgets, which are also able to call WeatherService.shared.weather. I put my call inside of getTimeline(). After adding logging I realized that getTimeline() is called multiple times at the same time. For example, if I have two different widgets each with three different sizes (small, large, rectangular, etc) then six calls to getTimeline() are made for an update. I found a blog by Shopify iOS developers that describes how they found the same thing, but the forums aren't letting me link to their website's blog. My questions is which of these scenarios is happening: Even though WeatherService.shared.weather is called six times in the same second it's actually only the first call that goes out via the network and the remaining five calls just returned cached results. More than one of the six calls in the same second could be making a network call. If that's the case I'm going to need to add some form of throttling/caching because the number of free API calls per month is limited. Thank you!
Posted Last updated
.
Post not yet marked as solved
2 Replies
1.1k Views
Hi, I'm in the process of developing a weather app using WeatherKit. Everything seems to be working fine in the Simulator, but when I put it on the device (iPhone 13 Pro Max) the temperature displays wrong. Example: On Simulator: 34 F On Device: 34.98 F Anyone else have this problem? Dan Uff
Posted Last updated
.
Post not yet marked as solved
0 Replies
710 Views
The web app that I work on has been using DarkSky for a few years and we have had historical weather data for many years prior to the date we integrated it. We rely on historical data for accurate reports and data analysis. The issue we are having now is it looks like WeatherKit only supports historical data back to 7/31/2021 which is almost 2 years but much less than DarkSky provided. Is that going to be the official start moving forward or will earlier data be supported eventually?
Posted Last updated
.
Post not yet marked as solved
0 Replies
432 Views
Is there a study or report for the WeatherKit accuracy that can be downloaded? Something similar to what's found on OpenWeather's site ( https://openweathermap.org/accuracy-and-quality ).
Posted
by ejrice.
Last updated
.
Post not yet marked as solved
19 Replies
4k Views
I have a script which fetches observations from weatherkit rest API which was working fine till morning. Suddenly I am getting {'reason': 'NOT_ENABLED'} error. I haven't changed anything. My key still has access to weatherkit. Any idea what happened here?
Posted Last updated
.
Post not yet marked as solved
0 Replies
399 Views
I am trying to download historical data for the past 1 year. The API would work for a few seconds and then randomly throw 404s. Is anyone else facing this issue? I don't see any downtime mentioned on the website.
Posted Last updated
.