Weatherkit Rest API getting unauthorized error

I have an app that submits a rest-api request to weatherkit for both currentWeather and weahtherForecast data. The app will error from time to time because of unauthorized request but what I don't understand is that it does not happen 100% of the time.

Anyone encountered something similar?

Answered by cxcxcxcx in 745206022

API seems to be stable again. Not getting any intermittent bad gateway error anymore. At least for the last 2 day.

For more context, this happens randomly on 1/27 and I fixed it by giving it a new key file. It breaks again on 1/30 without any changes on the code.

I bulk-submit 18 requests at every 5 mins mark, it works like once every hour right now.. No clue what is going on honestly, if the issue is with my code, I expect the code to fail 100% of the time. So I think this is something with WeatherKit.

I get the same intermittent failure.

The rest-api is much slower than DarkSky and in the last few days at least has been intermittently returning 401 Unauthorized for any properly authorized call ~10% of the time if you are making repeated requests. My workaround so far is to retry any 401 failed calls after a 3 sec delay in a loop, ugly but what else can one do.

I have the same experience, 401 Unauthorized. Retries usually work, even without a backoff.

I'll add that it's pretty unusual that the console doesn't break down total requests by return code. The REST API doesn't seem ready for production use.

I have been experiencing the same issue with my product, intermittent 401's with a NOT_ENABLED message

Same issue here. I had a spike on Jan 26, then a few days of calm, and now a lower but consistent amount of auth errors since Jan 30.

same here, feb 3, 2023. I randomly got 401 error using the weather kit service. Maybe that's the reason it's called beta version? Hope apple fix this soon, since many app developers will be using this api soon.

error I got: Error ----: Request failed: unauthorized (401)

I created FB11977323 for this issue on 2/1, but so far Apple has not said anything about this..People are saying that WEATHERKIT is actually in production they just have not changed the doc to remove the BETA tag. If that is the case then this turn around time is not acceptable IMO..

Same here using the REST API. I tried generating new keys or adjusting the validity window the access tokens, but none seems to work to avoid the error messages. It's something that clearly would need to be fixed if the service would come out of beta, especially that effectively we get charged for using this API.

Accepted Answer

API seems to be stable again. Not getting any intermittent bad gateway error anymore. At least for the last 2 day.

Mar 15. I´ve been using for a couple days, but now it is returning 401 error NOT_ENABLE. I created new keys and service Id, but it does not work... Any solutions?

Weatherkit Rest API getting unauthorized error
 
 
Q