Error while requesting fetch?
-
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)) });
Error - Unexpected token T in JSON at position 0
GET https: //cors-anywhere.herokuapp.com/api.openweathe ... 429 (Too Many Requests)JavaScript Kira Olsen, Mar 27, 2020
0 Answers
Your Answer
To place the code, please use CodePen or similar tool. Thanks you!