<iframe
src="https://your-fastapi-domain.com/embed/data"
width="100%"
height="400"
style="border:none;">
</iframe>
<h3>Latest Data from FastAPI</h3>
<div id="api-data">Loading...</div>
<script>
fetch("https://api.example.com/data")
.then(res => res.json())
.then(data => {
document.getElementById("api-data").innerHTML = `
<pre>${JSON.stringify(data, null, 2)}</pre>
`;
})
.catch(err => {
document.getElementById("api-data").textContent = "Error loading data";
console.error(err);
});
</script>