



<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<script type="text/javascript">
fetch ('https://power.larc.nasa.gov/api/temporal/daily/point?parameters=T2M&community=RE&longitude=-79.9041&latitude=-2.1821&start=20210101&end=20210331&format=JSON')
.then(response => response.json())
.then(data => {
console.log(data)
})
.catch(err=>console.log(err))
</script>
</body>
</html>
Lectura de api mediante javascript
<?php
$json = file_get_contents("https://power.larc.nasa.gov/api/temporal/daily/point?parameters=T2M&community=RE&longitude=-79.9041&latitude=-2.1821&start=20210101&end=20210102&format=JSON");
$arreglo = json_decode($json,"false");
print_r($arreglo);
echo "<table><thead><tr><td>Fecha Inicio</td><td>Fecha Fin</td><td>Title</td></tr></thead><tbody>";
foreach($arreglo as $post){
echo "<tr><td>".$post['start']."</td><td>".$post['end']."</td><td>".$post['type']['coordinates']."</td></tr>";
}
echo "</tbody></table>";