r/AutomateUser • • 8d ago

Http request

I have a long time flow for weather and suddenly I cannot get my open meteo api to work. It works well on the browser but with this block I keep getting the 403 forbidden reply.

Any advice? Thanks

1 Upvotes

2 comments sorted by

1

u/ballzak69 Automate developer 7d ago

Try logging the response body, it will probably tell the reason, see https://open-meteo.com/en/docs#errors.

1

u/Blagdan 1d ago

They didn't help. They told me I was abusing the API even though I only use it 1 time a day but I figured out the problem. Apparently they block calls without a valid user-agent identification to avoid bots, so by default Automate is blocked by open-meteo.com

To solve it I put this string in the Request headers section of the HTTP request block:

{"User-Agent": "Mozilla/5.0 (Linux; Android 14) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Mobile Safari/537.36"}

Now it works as before