window.addEventListener('load', () => {
const proxy = 'https://cors-anywhere.herokuapp.com/';
const API_KEY = 'd613fd7211c189a9e1b374cdbfa3e3a7';
const URL = `${proxy}api.openweathermap.org/data/2.5/find?lat=55.5&lon=37.5&cnt=10&appid=${API_KEY}`;
fetch(URL)
.then(response => response.json())
.then(data => console.log(data))
.catch(err => console.log(err.message))
});
Ошибка -
Unexpected token T in JSON at position 0
GET https://cors-anywhere.herokuapp.com/api.openweathe... 429 (Too Many Requests)