Api key в openweathermap

const apiUrl2 = "https://api.openweathermap.org/data/2.5/forecast?lat={lat}&lon={lon}&appid={API key}";

let lat = data.coord.lat; 
let lon = data.coord.lon; 
 
 
 
const response = await fetch(apiUrl2 + `&lat=${lat}` + `&lon=${lon}` + `&appid=${apiKey}`); 
let data2 = await response.json(); 
console.log(data2);

Мне надо, чтобы вывело информацию о погоде на 5 дней вперёд, но выводит ошибку:

Failed to load resource: the server responded with a status of 401 (Unauthorized)

Api key у меня правильный и есть в полном коде, но он бесплатный, хотя вот на сайте пишут, что и с бесплатным работает на 5 дней вперёд.

Помогите, пожалуйста, исправить!


Ответы (0 шт):