var xhr = new XMLHttpRequest(); xhr.open("GET", "https://api.netatmo.com/api/getpublicdata?access_token=YOUR_ACCESS_TOKEN&lat_ne=48.8588443&lon_ne=2.2943506&lat_sw=48.8588443&lon_sw=2.2943506", true); xhr.onreadystatechange = function() { if (xhr.readyState === 4 && xhr.status === 200) { var json = JSON.parse(xhr.responseText); var temperature = json.body.temperature; document.getElementById("weather").innerHTML = temperature + "°C"; } }; xhr.send();