Is anybody familiar with creating a weather api in node-red please share a example

i use Open-meteo. They have a nice api, and you don't need an api key.

example flow:

[{"id":"3c88a7f7fc89ed7f","type":"inject","z":"4c08fa20cc28f527","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":500,"y":220,"wires":[["843553041cfe62f8"]]},{"id":"61540b63d4f8affe","type":"debug","z":"4c08fa20cc28f527","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"true","targetType":"full","statusVal":"statusCode","statusType":"msg","x":1130,"y":220,"wires":[]},{"id":"ad8b72bfc7b55e58","type":"http request","z":"4c08fa20cc28f527","name":"Open-Meteo.com","method":"GET","ret":"obj","paytoqs":"query","url":"https://api.open-meteo.com/v1/forecast","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":950,"y":220,"wires":[["61540b63d4f8affe"]]},{"id":"843553041cfe62f8","type":"change","z":"4c08fa20cc28f527","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.latitude","pt":"msg","to":"52.5244","tot":"num"},{"t":"set","p":"payload.longitude","pt":"msg","to":"13.4105","tot":"num"},{"t":"set","p":"payload.current","pt":"msg","to":"temperature_2m,relative_humidity_2m,rain,weather_code,cloud_cover","tot":"str"},{"t":"set","p":"payload.hourly","pt":"msg","to":"temperature_2m","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":710,"y":220,"wires":[["ad8b72bfc7b55e58"]]}]
1 Like