А какие тут вообще проблемы?
<!DOCTYPE html>
<html>
<head>
<script>
async function test() {
const response = await fetch('https://api.spacexdata.com/v4/starlink/');
const data = await response.json();
for(const starlink of data) {
document.write(`<p>${starlink.id}</p>`);
}
}
</script>
</head>
<body>
<button id='btn' onclick="test()">Ok</button>
</body>
</html>