Page 1 of 1

Wetter API Kachelmann

Posted: Mon Apr 22, 2024 8:04 am
by Khz
Hello,
fight with Kachelmann weather and try to create the string for the API access. Does anyone have a solution?

Many greetings
Karl-Heinz

Re: Wetter API Kachelmann

Posted: Mon Apr 22, 2024 9:05 am
by PeterN
Hi Karl-Heinz,

I have no experience with this particular API. But I have used the already built-in openweather API in this project: [Local Link Removed for Guests]
Could this be a workaround for your problem?
Viel Glück und Erfolg!
Peter

Re: Wetter API Kachelmann

Posted: Mon Apr 22, 2024 11:01 am
by Khz
Thank you Peter,
with OpenWaether has already achieved success. I could already read the tile with Python (but no python fan) here how to get to the tile man here:
###################################################
Import http.client
import json
conn = http.client.HTTPSConnection("api.kachelmannwetter.com")
headers = {
'Accept': "application/json",
'X-API-Key': "**************** KEY ********************************"
}
conn.request("GET", "/v02/forecast/50.514/11.369/3day?units=metric", headers=headers)
res = conn.getresponse()
data = res.read()
y = json.loads(data)
####################################################
One probably has to put the fat terms in a string. Many greetings

Re: Wetter API Kachelmann

Posted: Mon Apr 22, 2024 11:13 am
by PeterN
Hello Karl-Heinz,
my experience is that it's best to try the whole thing out manually in the browser and then recreate it with wgetsasync

That's what my one-liner does in the end after having filled the variables accordingly

Code: [Local Link Removed for Guests]

wgetasync("api.openweathermap.org/data/2.5/weather?q=" + town$ + "&lang=" + language$ + "&units=" + Units$ + "&appid=" + Openweather_ID$, 80)

Re: Wetter API Kachelmann

Posted: Mon Apr 22, 2024 7:24 pm
by Khz
OpenWeather is OK. But the kachelmann. Have already said whether Wireshark helps, because it goes from the Raspi by means of python. Thank you for their efforts!
Karl-heinz