Fetch API fetch(url) .then(data => data.json()) .then(data => { console.log(data); }) .catch(error => alert(error));