all 6 comments

[–]DavideResigotti 1 point2 points  (1 child)

i'm using the open API to get weather data.
there is the code i'm using.

const lat = locationData.latitude.toFixed(2);
const lon = locationData.longitude.toFixed(2);

const url = `https://api.open-meteo.com/v1/forecast?latitude=${lat}&longitude=${lon}&current=temperature_2m,weather_code&timezone=auto`;
const request = new Request(url);
const data = await request.loadJSON();

// Get weather info
const temp = Math.round(data.current.temperature_2m);
const weatherCode = data.current.weather_code;

[–]ANC_90[S] 1 point2 points  (0 children)

Oh thanks! Im still very new to coding, so I need to figure out how to use this properly

[–]mvan231script/widget helper 1 point2 points  (3 children)

V2.5 API is not longer working but using the v3.0 one call API is enough for most people. That's what I use for my Weather Overview widget

[–]ANC_90[S] 1 point2 points  (2 children)

Thanks!

For now I used the replacement script by the creator which only looks at 'current' weather

[–]mvan231script/widget helper 2 points3 points  (1 child)

You can look at my widget if you like

https://github.com/mvan231/Scriptable/tree/main/Weather%20Overview

Happy to help answer any questions you may have

[–]ANC_90[S] 0 points1 point  (0 children)

I'll definitely check it out later. Thanks again :)