Post

Replies

Boosts

Views

Activity

Reply to WeatherKit REST API down?
@stoic_matsumoto at present I calculate hourlyEnd to be 10 days after hourlyStart... Firstly, it's really not very elegant to have to do calculate either of these two dates in an absolute sense, and it should instead be possible to specify these relatively i.e. "10 days of data starting from now". Anyhow, I reduced the calculation from 10 days to 9 days (just to be sure), and indeed there now appear to be no 400 error responses. Hopefully a dev at Apple is reading these forums and can understand that this situation isn't ideal in any respect. I think these error responses must have only started around 5 or so days ago... so something must have changed in the backend around then. Would be nice to have the full 10 days of data back.
Jun ’24
Reply to WeatherKit REST API down?
Thanks for the observations @stoic_matsumoto. I'll go down that route and see if I find the same. If true, and we need to second guess how many hours of data might be available in any given time zone to avoid a 400 error (and possibly taking into account other factors beyond our control) then this is indeed truly horrible :-0 Ideally we should just be able to ask for a certain number of hours from a given start time (defaulting to "now") and we should receive whatever is available up to the requested number of hours.
Jun ’24
Reply to WeatherKit REST API new columns for CurrentWeather
I've just noticed these (cloudCoverLowAltPct, cloudCoverMidAltPct, cloudCoverHighAltPct) appearing in return data for the forecastHourly dataset too. It didn't break anything (because I start on the assumption that return data for any data field may be null or missing completely), but I came here with similar questions/concerns. (a) they're not in the docs:: (b) are these always provided, for all locations? (c) are these now a permanent fixture in the REST API? (d) naming seems very misleading as mentioned by @Scott... Pct suggests percent but they're definitely all in the range 0-1 Thanks.
Feb ’23
Reply to dateSet forecastDaily always returning 404 for past 12 hours has been working for months
@FrameworksEngineer thanks for the reply. Yes I get the error when passing only hourlyEnd and not hourlyStart, which is apparently OK according to the docs: hourlyStart (date-time): The time to start the hourly forecast. If this parameter is absent, hourly forecasts start on the current hour. hourlyEnd (date-time): The time to end the hourly forecast. If this parameter is absent, hourly forecasts run 24 hours or the length of the daily forecast, whichever is longer. I'd just seen this post, which also suggests also passing hourlyStart (even though it's apparently optional), and indeed it does work. Probably a better workaround than asking for forecastDaily (and then just ignoring the return data). Will this behaviour be fixed (i.e. not being able to pass only hourlyEnd), or at least will the docs be updated? It would also be useful to have more information about the date-time format... at the moment I'm using ISO format, i.e. in javascript (new Date()).toISOString(), but I can't see from the docs for sure that this is correct (or whether it might break in future if I'm not using exactly the right format).
Feb ’23
Reply to WeatherKit REST API WeatherAlert data question
@VoyagerSpace... hmm, that's not ideal! The docs do say that countryCode "is necessary for weather alerts" but it doesn't say anything about timezone. Even if the docs were clear, these shouldn't ideally be required anyway from a usability point of view (it requires a couple of extra lookups if timezone and countryCode are not available, e.g. if all you have is a coordinate). In any case, I still can't get any alerts to show up at all, even when specifying timezone and countryCode. I've tried locations with active alerts on https://www.weather.gov/ and https://www.meteoalarm.org/. Any other tricks I'm missing? Perhaps the alerts are more limited that what is available elsewhere, and I just haven't found one yet that shows up? Here's an example of what I'm using now: URL: https://weatherkit.apple.com/api/v1/weather/en/35.244/-111.269 Query parameters: { dataSets: 'forecastHourly,forecastNextHour,forecastDaily,weatherAlerts', timezone: 'MST', countryCode: 'US' }
Feb ’23
Reply to dateSet forecastDaily always returning 404 for past 12 hours has been working for months
At the moment I'm using a ridiculous workaround, which is to request the forecastDaily dataSet even though I don't need it (along with forecastHourly which is what I really need). This is because I can then leave out hourlyEnd completely and still get the full 10 days of data, in view of the docs: hourlyEnd (date-time): The time to end the hourly forecast. If this parameter is absent, hourly forecasts run 24 hours or the length of the daily forecast, whichever is longer. dailyEnd (date-time): The time to end the daily forecast. If this parameter is absent, daily forecasts run for 10 days.
Feb ’23