HTML guide
Embed an Instagram feed with HTML
Add a live Instagram feed to any website with one line of HTML — no framework, build step, or backend. Paste a script tag where the feed should appear and it renders a responsive grid or carousel that updates as you post. If you would rather write the markup yourself, the same feed is available as an iframe and as JSON.
1Get your Simpleembed feed ID
Create a free Simpleembed account and connect your Instagram account — it needs to be a Business or Creator account (switching a personal account is free and takes a minute in the Instagram app). Create a feed, then open Embed code in the dashboard to copy the snippet with your feed ID filled in.
2Paste the script tag into your HTML
Put the tag in the <body>, exactly where you want the feed. It renders in place, fills the width of its parent element, and adjusts its own height:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>My site</title>
</head>
<body>
<h1>Follow us on Instagram</h1>
<!-- The feed renders right here, where the script tag sits -->
<script
src="https://simpleembed.com/embed.js"
data-feed-id="YOUR_FEED_ID"
async
></script>
</body>
</html>The async attribute means the loader never blocks the rest of your page. Want two feeds on one page? Add a second tag with a different data-feed-id.
3Upload and check the live page
Deploy the file the way you normally do — FTP, GitHub Pages, Netlify, anything that serves HTML. Layout, columns, spacing, and captions are set in the Simpleembed dashboard, and every embed picks up changes automatically, so you never have to edit the HTML again to restyle the feed.
Iframe version
Some CMS fields and email-style editors strip <script> tags. In that case, embed the feed URL in an iframe instead:
<iframe
src="https://simpleembed.com/embed/YOUR_FEED_ID"
title="Instagram feed"
loading="lazy"
style="width: 100%; height: 600px; border: 0;"
></iframe>Without the loader script nothing resizes the iframe for you, so set a height that fits your layout.
Build your own widget from JSON
Every feed is also a public, CORS-enabled JSON endpoint, so plain JavaScript in the browser can fetch the posts and render whatever markup you like — no access token in your page, nothing to refresh:
<div id="ig-grid"></div>
<style>
#ig-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 8px;
}
#ig-grid img {
width: 100%;
aspect-ratio: 1;
object-fit: cover;
display: block;
}
</style>
<script>
fetch("https://simpleembed.com/api/feeds/YOUR_FEED_ID")
.then((res) => res.json())
.then(({ posts }) => {
const grid = document.getElementById("ig-grid");
for (const post of posts) {
const link = document.createElement("a");
link.href = post.permalink;
link.target = "_blank";
link.rel = "noreferrer";
const img = document.createElement("img");
img.src = post.imageUrl;
img.alt = post.caption ?? "Instagram post";
img.loading = "lazy";
link.appendChild(img);
grid.appendChild(link);
}
});
</script>Field reference and caching details are in the Embedding & API docs. Coming from an older JavaScript library? See Simpleembed as an Instafeed.js alternative.
Frequently asked questions
- Can I embed an Instagram feed with plain HTML and no backend?
- Not against Instagram directly. Instagram's API requires an access token that must be kept secret and refreshed on a schedule, which needs a server. Simpleembed is that server: it holds the token, syncs your posts, and gives you a snippet that is safe to paste into a static HTML file.
- Does Instagram have an official feed embed code?
- No. Instagram's built-in Embed option (and its oEmbed endpoint) only covers a single post or profile card — it does not produce a live feed of your latest posts, and it cannot be restyled. For a feed you need either your own integration with the Instagram API or a service like Simpleembed.
- Script tag, iframe, or JSON — which should I use?
- Use the script tag unless you have a reason not to: it sizes itself automatically and picks up every design change from the dashboard. Use the iframe when your host strips script tags. Use the JSON API when you want to write the markup and CSS yourself.
- Will images break when Instagram links expire?
- No. Instagram's own CDN links expire after a few days, which is why hand-rolled embeds end up with broken images. Simpleembed proxies and caches every image behind a stable URL, so the feed keeps rendering indefinitely.
- Is it free?
- Yes — one Instagram source and one feed are free forever, with unlimited views and a small Simpleembed watermark on the widget. The $7/month plan removes the watermark and unlocks unlimited feeds and sources.
Get your feed ID in about two minutes
Create a free Simpleembed account, connect your Instagram Business or Creator account, and copy your embed snippet. One source and one feed are free forever; $7/month unlocks unlimited feeds, sources, and views.
Start free