I want to somehow use a web API to get the recent precipitations, to automate garden watering in the summer. OpenWeatherMap does not have that unless you purchase an expensive package, WeatherStack is limited to 100 queries per month (basically useless), but I found Meteomatics which provide that on a free plan.
The catch is they don't have an API key type of authentication, but rather a username/password. They give a coding example in Python on their site:
which looks like:
url = "https://api.meteomatics.com/{date}/{parameters}/{location}"
username = âyour_usernameâ
password = âyour_passwordâ
response = requests.get(url, auth=(username, password))
data = response.json() # Converts JSON response to a Python dictionary
Any pointer on how to translate the requests.get(url, auth=(username, password)) in Groovy ?