From 6a3233d14f5e7e49596b078efbc8d173fb7f410c Mon Sep 17 00:00:00 2001 From: Joseph N Denton Date: Fri, 20 Sep 2024 12:29:12 -0700 Subject: [PATCH] Update to API v3 openweathermap deprecated API version 2.5; 3.0 should be a drop-in replacement: https://openweathermap.org/one-call-transfer --- src/pages/api/widgets/openweathermap.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/api/widgets/openweathermap.js b/src/pages/api/widgets/openweathermap.js index 089ee804e..e9cdfea24 100644 --- a/src/pages/api/widgets/openweathermap.js +++ b/src/pages/api/widgets/openweathermap.js @@ -24,7 +24,7 @@ export default async function handler(req, res) { return res.status(400).json({ error: "Missing API key" }); } - const apiUrl = `https://api.openweathermap.org/data/2.5/weather?lat=${latitude}&lon=${longitude}&appid=${apiKey}&units=${units}&lang=${lang}`; + const apiUrl = `https://api.openweathermap.org/data/3.0/weather?lat=${latitude}&lon=${longitude}&appid=${apiKey}&units=${units}&lang=${lang}`; return res.send(await cachedFetch(apiUrl, cache)); }