-
I had a script that was working fine for several weeks, polling data from my local weather station once every 10 minutes. I am now getting 403 errors, similar to the open discussion @ #238 Since the weather.gov api docs suggested that my https://stackoverflow.com/questions/15067462/urlfetch-with-custom-user-agent-string It seems there is no way to set a custom value for Any suitable workarounds or other ideas for causes? Alternatively, do people have substitute weather API recommendations, paid or free? [edit] Confirmed using "myuseragent.net" that my custom // test UrlFetchApp's User-Agent override
Logger.log(UrlFetchApp.fetch('http://www.myuseragent.net/', params).getContentText());
const response = await UrlFetchApp.fetch(url, params);
Logger.log(response.getContentText()); results in:
and the api.weather.gov response: <HTML><HEAD>
<TITLE>Access Denied</TITLE>
</HEAD><BODY>
<H1>Access Denied</H1>
You don't have permission to access "http://api.weather.gov/stations/K***/observations/latest" on this server.
<P>Reference #18.4fec3817.1626985111.4b1ca6b1</P>
</BODY>
</HTML> |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Thanks for providing the reference id. It took me a moment, but I tracked that down to, "Detected request from anonymous proxy ." The development team does not manage the web application firewall policies, but I'm guessing this request goes through a Google service proxy? It doesn't matter what the user agent string is, as long as one is provided. A custom string is only helpful to provide a contact in the event we have to take action due to abuse, which is very rare. |
Beta Was this translation helpful? Give feedback.
Thanks for providing the reference id. It took me a moment, but I tracked that down to, "Detected request from anonymous proxy ." The development team does not manage the web application firewall policies, but I'm guessing this request goes through a Google service proxy? It doesn't matter what the user agent string is, as long as one is provided. A custom string is only helpful to provide a contact in the event we have to take action due to abuse, which is very rare.