Google Weather API returns HTTP 403 Error

后端 未结 2 1209
借酒劲吻你
借酒劲吻你 2021-01-28 08:30

I use the Google weather API in my web site, and today I get an error that the API link doesn\'t return any data.

When I check the link directly I get an (Error 403).

相关标签:
2条回答
  • 2021-01-28 08:44

    There is currently an intermittent 403 Forbidden response to the Google Weather API that you are using. See Google Weather API 403 Error

    The reason for the intermittent 403 response is not known but has been a problem since the 7th of August 2012.

    0 讨论(0)
  • 2021-01-28 08:54

    Every now and then the API stops working for short periods of time, the last days more often a 403 is trown. For my site, last night it happened 13 times. But the site tries immediately again and the second or third time, the data loads without problems. As the API is unofficial, not sure what’s causing the 403.

    Make sure you cache the data as the API will block your IP temporary when you make too much requests. In my case, I cache for 20 minutes and if no data can retrieved, the site will not try more than 10 times to reload the API. Once I forgot to turn caching on after debugging and as my site did many hundred requests (with every visitor), the IP was blocked within an hour. If a remember correct, the error was not a 403. Fortunately, the block lasts for less than a half day.

    0 讨论(0)
提交回复
热议问题