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.

Posts under WeatherKit tag

64 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

WeatherKit historical
is using /api/v1/weather/{language}/{latitude}/{longitude} the correct way to retrieve historical weather data for a location? e.g. getting hourly weather data for Seattle from 2016-03-04 to 2016-03-11? https://developer.apple.com/documentation/weatherkitrestapi/get-api-v1-weather-_language_-_latitude_-_longitude_ this is pointed out in the API docs as being the method to pull hourly weather data for a specific location. It doesn't indicate wether it is for current weather or historical
0
0
22
1h
Weather Authentication Failed
I'm pretty new on this platform and also developing IOS mobile apps. I've been struggling for using the data of the api weather kit apple. I have an acount of apple developer, downloaded the certificate... i follow all the necessaries steps in the portal and also in my project and i keep having this error message when i try to use it. I don't know what else should i do for having working it. I would absolutely appreciate that someone could help me with this. Thank you very much!!!!! Encountered an error when fetching weather data subset; location=<+41.38268070,+2.17702390> +/- 0.00m (speed -1.00 mps / course -1.00) @ 2/3/25, 22:54:03 Central European Standard Time, error=WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors 2 Error Domain=WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors Code=2 "(null)"
0
0
86
23h
WeatherKit AuthService Error
I have an app that I configured correctly. Checked the WeatherKit for the App ID, and added the WeatherKit to the Entitlements, and verified the Bundle ID was correct. I am getting the following error: Failed to generate jwt token for: com.apple.weatherkit.authservice with error: Error Domain=WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors Code=2 "(null)" Encountered an error when fetching weather data subset; location=<+38.97170000,-95.23530000> +/- 0.00m (speed -1.00 mps / course -1.00) @ 3/1/25, 8:34:24 AM Central Standard Time, error=WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors 2 Error Domain=WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors Code=2 "(null)" I then made a super simple app that has a hard coded CLLocation and makes the single API call to get the weather and that fails with the same error. This error is still happening after 12 - 48 hours after creating the AppID. I have dumped the contents of the Provisioning Profile for both apps and the Entitlement section looks correct for both. I am not sure what is configured incorrectly, or what steps I should take next.
1
0
121
2d
adding forecastNextHour to dataset significantly changes currentWeather
I have been struggling with getting accurate data from the weatherkit api. It tends to be just different enough from the weather app on the phone. While debugging this I randomly added forecastNextHour to my dataset string and it suddenly made everything match the app and the data looked good. For example there is at this moment a snow storm in Billings. This url: https://weatherkit.apple.com/api/v1/weather/en-US/45.79/-108.50?dataSets=currentWeather,forecastHourly,forecastNextHour&timezone=America/Denver&country=US says that there is heavy snow, and there is a 100% chance for the next few hours. This matches the iOS app. This url without forecastNextHour: https://weatherkit.apple.com/api/v1/weather/en-US/45.79/-108.50?dataSets=currentWeather,forecastHourly&timezone=America/Denver&country=US Says it is hazy and there is a small chance of snow of snow for the next few hours. Like 20-30 percent. This does not match any weather data I can find. I have even checked the forecastStart times and the current weather asOf time. They all match up and are accurate. Is there some unknown reason that without forecastNextHour the API becomes inaccurate? Thanks!
2
0
180
3w
Should weather from the following day at midnight be used for the current day?
I just noticed something really odd with WeatherKit. If the temperate at midnight of the FOLLOWING day is colder than all temps in the day you want weather for then WeatherKit will report that as the low temperature for the day even though it's a different day. Here it's reporting the lowest temp for Feb 6 is 22F. But that's a temp from Feb 7. I'm displaying lowTemperature and lowTemperatureTime from DayWeather as well as the HourWeather in these examples. I wasn't sure if this was working as designed or a bug. I can provide raw data from this example. ----daily formatted start weather for Feb 6 High 41° high at Feb 6 at 2 PM Low 22° low at Feb 7 at 12 AM ----daily formatted end Feb 6 at 12 AM 34° Feb 6 at 1 AM 35° Feb 6 at 2 AM 36° Feb 6 at 3 AM 36° Feb 6 at 4 AM 36° Feb 6 at 5 AM 34° Feb 6 at 6 AM 33° Feb 6 at 7 AM 33° Feb 6 at 8 AM 33° Feb 6 at 9 AM 33° Feb 6 at 10 AM 35° Feb 6 at 11 AM 36° Feb 6 at 12 PM 38° Feb 6 at 1 PM 40° Feb 6 at 2 PM 41° Feb 6 at 3 PM 40° Feb 6 at 4 PM 39° Feb 6 at 5 PM 37° Feb 6 at 6 PM 36° Feb 6 at 7 PM 33° Feb 6 at 8 PM 31° Feb 6 at 9 PM 29° Feb 6 at 10 PM 27° Feb 6 at 11 PM 24° Feb 7 at 12 AM 22°
2
0
204
4w
Weatherkit API times out at 7am EST
I've noticed that very consistently the Weatherkit API times out when I make a large(-ish) number of calls at 7am east coast time. If I make x calls between 7:00:00 and 7:01:00 about half of them time out (as do retries.) If I make 2x the calls between 7:15:00 and 7:16:00 there are close to zero time outs. I've looked at the logs, at the calls per second, etc., and there is no difference between 7 and 7:15. So, I'm not hitting a rate limit. It seems like Weatherkit itself just can't handle the traffic at peak times. Is there any other explanation? Does Apple intend to make sure the API can handle all the traffic they are getting paid to handle?
1
0
194
Jan ’25
WeatherKit forecast API throws 400 Bad Request intermittently
I have been using the hourly weather forecast API, for some reason sometimes the API fails with 400 Bad Request, but on retrying just a minute later the call successfully returns data. The start and end time are 2 days apart so I don't think it's an issue with the time frame. The failed calls also don't return any reason so not sure what is the exact failure. Has anyone encountered this issue or knows why this might be happening?? Thanks!!
0
0
201
Jan ’25
Overnightforecast data from weatherResponse.dailyForecast.forecast array object
Background: We are using Apple WeatherKit for an app to fetch future weather data specialty cloudCover and condition and pretipitationChance from the Overnightforecast data from weatherResponse.dailyForecast.forecast array object. Code Sample: On xcode on Swift and Swift UI using Apple WeatherKit task{ do{ let weatherResponse= try await self.weatherService.forecast(for: latLong) let cloudCover = weatherResponse.dailyForecast.forecast[0].overnightforecast.cloudCover Issue: While we are on debug mode, we can literally see overnightforecast.cloudCover data (as well as condition and pretipitationChance) is available under from index 0 to index 10 of weatherResponse.dailyForecast.forecast array object but when we are trying to assign this property, its throwing error as "overnightforecast object not present under weatherResponse.dailyForecast.forecast array object" Attachment:
3
0
249
4w
WeatherKit request fail
Hello, I have an app on the App Store built around WeatherKit and it was working fine, up until this morning when I started seeing errors when using the app. When debugging using Xcode I see the familiar error Failed to generate jwt token for: com.apple.weatherkit.authservice with error: Error Domain=WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors Code=2 "(null)" which, according to what I've read on the forums looks like an authentication error. Attaching a network debugger to the Simulator, I saw this error: This I have tried: Verify that WeatherKit is enabled on both Capabilities and App Services tabs on the Dev Portal. Toggle on/off this value and regenerate Provisioning Profiles Uninstall/reinstall Checking that I have API available calls. Nothing. If I create a new Bundle ID and sign with that, it works correctly. But this is not an option since that will force all my customers to download everything from scratch. I am getting emails from customers demanding money back and I can't figure out what has happened. The only thing I can think of, is that I started developing an Apple Watch app to complement the iOS app, but that was last week and everything was working fine.
6
1
353
Jan ’25
Multiple issues on Xcode Cloud, WeatherKit and TestFlight after changing bundle id
After changing the bundle identifier of my app, I’ve encountered several issues that I can’t seem to resolve, even though I’ve followed all the necessary steps. The app with the previous identifier was live on Testflight, and working perfectly fine, but now I’m facing the following problems: WeatherKit Authentication Issue WeatherKit has stopped working, and I’m getting authentication errors. I’ve updated the app in the Developer Portal to reflect the new bundle ID, but it still doesn’t authenticate properly. Xcode Cloud Configuration Issue: Xcode is asking me to set up Xcode Cloud again, which I understand is expected after a bundle ID change. However, during the setup process, it fails to recognize my remote repository, even though the repository is correctly added and visible under the Source Control tab. TestFlight Internal Testing Issue: I manually uploaded a build to TestFlight, but internal testers cannot use it because the invitation appears as invalid. This wasn’t an issue with the app’s previous identifier. It seems like the bundle ID change has caused some fundamental issues that I can’t resolve despite following all the usual instructions. Has anyone experienced this before or knows how to resolve these problems? I'm using the latest Xcode 16.2 on Mac OS Sequoia 15.2
0
0
348
Jan ’25
WeatherKit Swift API -metadata reportedTime
Hi there, I am using WeatherKit to display weather forecast information in an app. I would like to include some information about when the weather forecast was issued for my users to see. This information is included in the response Metadata as documented in the WeatherKit REST API docs: https://developer.apple.com/documentation/weatherkitrestapi/metadata Specifically there is a “reportedTime” property which I would like to use here. However I am consuming WeatherKit via the Swift API, I don’t see this property available via the Swift APIs. How can I access the reportedTime property via the WeatherKit Swift APIs? Or is it not exposed via the Swift APIs?
0
0
224
Jan ’25
Unrealistically high snowfall amounts being reported by WeatherKit
I filed FB16332997 about the VERY high snowfall estimates I'm seeing in WeatherKit and iOS Weather. I initially thought something was wrong with my weather app but I verified the numbers with the iOS Weather app and another third party weather app. For Atlanta last week it was saying 7.5" when it ended up being 2" (which I can live with). Two days ago it reported there could be 16" of snow in northern Florida. That's impossible! This morning it was reporting that Niceville could have 6-7" of snow, which would be significantly more than highest amount in recorded history for Florida (where snow is extremely rare). It almost makes me wonder if the liquid precipitation value is actually the snowfall amount in reality. And then that is incorrectly being converted to the snowfall amount.
2
0
335
Jan ’25
weatherkit: failed to generate jwt token
Hey, I'm trying to update my old app that used DarkSky to WeatherKit, and struggling. I always get: ailed to generate jwt token for: com.apple.weatherkit.authservice with error: Error Domain=WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors Code=2 "(null)" This is regardless if I do it on my iPad, or in the simulator. I have done the following: Selected WeatherKit on the Capabilities and App Services tabs of the Identifier section on developer. Put it under signing and capabilities in XCode I've tried making a new provisioning profile, cleaning build folder, etc. Not sure what to do here. I suspect part of this problem is that I developed this app in 2018 and now I'm trying to update it. I am able to run the app on TestFlight, but not as an internal tester. Apple won't let me, so I have to add myself as an external tester. Thanks for any help you can provide!
9
0
490
Jan ’25
WeatherKit - Forecast Issue Time
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
2
0
259
Jan ’25
Failed to generate JWT token error WeatherKit
Hi, I'm trying to implement WeatherKit for the first time and I am seeing this error when calling for the weather: Failed to generate jwt token for: com.apple.weatherkit.authservice with error: Error Domain=WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors Code=2 "(null)" and Encountered an error when fetching weather data subset; location=<+51.57750785,-2.08241362> +/- 6.55m (speed -1.00 mps / course -1.00) @ 11/01/2025, 11:50:45 Greenwich Mean Time, error=WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors 2 Error Domain=WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors Code=2 "(null)" I have: Enabled the WeatherKit capability in my iOS app in XCode Added Weatherkit to the AppID in the developer portal Any suggestions what else I can check? I'm running iOS 18.2.1 on 15 ProMax with XCode 16.2
6
0
461
Jan ’25
Confusion about units for new WeatherKit visibility items
I am really confused by some of the new data returned in WeatherKit for iOS 18. The visibility (of an object) was already being returned in HourWeather as a Measurement. iOS 18 added max/min visibility (of terrain) in DayWeather. BUT instead of a Measurement it's just a Double. HourWeather: /// The distance at which an object can be clearly seen. /// /// The amount of light and weather conditions like fog, mist, and smog affect visibility. public var visibility: Measurement<UnitLength> DayWeather's comment: /// The maximum distance at which terrain is visible for the day. /// /// The amount of light, and weather conditions like fog, mist, and smog affect visibility. @available(iOS 18.0, macOS 15.0, tvOS 18.0, watchOS 11.0, visionOS 2.0, *) public var maximumVisibility: Double This makes it sound like the new items are also a distance and not a percentage. Why wasn't Measurement used so the unit would be clear? Documentation doesn't explain this either. I'm hoping that this isn't being returned in the unit used by the current locale because my app lets you specify what unit to use for temperature, length, etc regardless of locale. Since all the temperature, length, etc data returned had used Measurement that was possible. The iOS weather app refers to the lowest/highest visibility in my preferred unit, which is miles.
1
0
290
Jan ’25
How to search location in global rather than in local?
I'm doing a weather app, users can search locations for getting weather, but the problem is, the results only shows locations in my country, not in global. For example, I'm in China, I can't search New York, it just shows nothing. Here's my code: @Observable class SearchPlaceManager: NSObject { var searchText: String = "" let searchCompleter = MKLocalSearchCompleter() var searchResults: [MKLocalSearchCompletion] = [] override init() { super.init() searchCompleter.resultTypes = .address searchCompleter.delegate = self } @MainActor func seachLocation() { if !searchText.isEmpty { searchCompleter.queryFragment = searchText } } } extension SearchPlaceManager: MKLocalSearchCompleterDelegate { func completerDidUpdateResults(_ completer: MKLocalSearchCompleter) { withAnimation { self.searchResults = completer.results } } } Also, I've tried to set searchCompleter.region = MKCoordinateRegion( center: CLLocationCoordinate2D(latitude: 0, longitude: 0), span: MKCoordinateSpan(latitudeDelta: 180, longitudeDelta: 360) ), but it doesn't work.
2
0
587
Dec ’24
WeatherKit in commandline app
I am trying to add WeatherKit support to a commandline app to fetch historical data. I've configured an app ID with the WeatherKit entitlement, but WeatherKit does not appear in the Capabilities list to add. When I try to access weather data, it fails with Code=4097 "connection to service named com.apple.weatherkit.authservice" suggesting it's not authorized. How do I add the WeatherKit entitlement to a commandline Swift app?
0
0
283
Dec ’24
WeatherKit now returning {"reason": "EXPIRED"}
I've been using the weather kit API for months now without issue, but all of a sudden API queries return the response {"reason": "EXPIRED"}. The code around this area hasn't changed since June and the credentials haven't changed. The JWT is refreshed frequently (well within expiration). Have looked at the generated JWT in jwt.io and Payload and Header details correct and jwt.io reports JWT as "signature verified". Is the JWT a red herring and its something else? Here's an example URL: https://weatherkit.apple.com/api/v1/weather/en_AU/-37.37834963844341/144.76238003519637?dailyStart=2024-12-12T13:00:00Z&dailyEnd=2024-12-13T13:00:00Z&timeZone=Australia/Melbourne&dataSets=forecastDaily Would appreciate any insights you may have.
3
1
372
Dec ’24