Klaviyo Integration

Show your latest Instagram posts in Klaviyo emails. Klaviyo's web feeds let a template pull in content from a URL each time an email is sent. You add Feedframer as a web feed once, then loop over your posts in any campaign or flow email.

The Klaviyo steps below follow Klaviyo's own help articles, linked in each section. If a label in Klaviyo doesn't match, their article is the reference.

Use the JSON API, not the RSS feed

Klaviyo web feeds accept JSON or XML, and Klaviyo recommends JSON. Feedframer's /api/v1/me endpoint is a better fit than the RSS feed:

  • Each post has separate fields for the caption, the permalink, the image and the post type, so you can lay them out however you like.
  • thumbnailUrl gives a still image for videos. In the RSS feed, a video's <media:content> is usually an MP4, which can't be shown as an image.
  • mediaType lets you treat videos differently. The RSS feed doesn't state the post type.

Your web feed URL is:

https://feedframer.com/api/v1/me?api_key=YOUR_API_KEY

Use the API key shown on the account's card on the Feedframer Dashboard. It returns the 6 most recent posts on the Free plan and up to 100 on Premium, newest first.

What Klaviyo can and can't do with a feed

Klaviyo's web feed documentation describes feeds as content you pull into emails. It doesn't describe any flow trigger for new feed items, so a new Instagram post can't start a flow or send an email by itself. You can:

  • add your latest posts to a campaign, and
  • add them to emails in flows that are triggered by something else, such as a welcome series.

If you want an email sent automatically whenever you post, see the Mailchimp guide, which uses Mailchimp's RSS automation.

Step 1: Add the web feed

Klaviyo's guide: How to add a custom web feed in an email.

  1. Click your company name in the bottom-left corner of Klaviyo, then Settings.
  2. Click Other, then Web feeds.
  3. Click Add Web Feed and fill in:
Field Value
Feed name Instagram (no spaces are allowed; you'll use this name in templates)
Feed URL https://feedframer.com/api/v1/me?api_key=YOUR_API_KEY
Request method GET
Content type JSON

Klaviyo's requirements for feeds, from the same guide:

  • The feed must be 3.3 MB or smaller. A full Premium response of 100 posts is far below this.
  • The URL must not redirect.
  • For private feeds, Klaviyo recommends an HTTPS URL with a secret query parameter. The Feedframer URL is HTTPS, and your API key is the secret: keep the URL private.

Klaviyo also decides how often it refreshes a feed, based on how quickly it loads. For campaigns, it fetches the feed once per send.

Step 2: Add posts to an email

Klaviyo notes that images from a web feed need an HTML block with an <img src> tag. In the email editor, add an HTML block and paste:

<table role="presentation" width="100%" cellpadding="0" cellspacing="0">
  {% for item in feeds.Instagram.posts|slice:":3" %}
  <tr>
    <td style="padding: 0 0 24px 0;">
      <a href="{{ item.permalink }}">
        <img src="{% if item.thumbnailUrl %}{{ item.thumbnailUrl }}{% else %}{{ item.mediaUrl }}{% endif %}"
             alt="{{ item.caption|default:'Instagram post'|truncatechars:100 }}"
             width="560" style="display: block; width: 100%; max-width: 560px; height: auto;">
      </a>
      {% if item.mediaType == "VIDEO" %}
      <p style="margin: 8px 0 0 0; font-size: 13px; color: #666666;">Video: tap to watch on Instagram</p>
      {% endif %}
      {% if item.caption %}
      <p style="margin: 8px 0 0 0;">{{ item.caption|truncatechars:200 }}</p>
      {% endif %}
      <p style="margin: 8px 0 0 0;"><a href="{{ item.permalink }}">View on Instagram</a></p>
    </td>
  </tr>
  {% endfor %}
</table>

How it works:

  • feeds.Instagram is the web feed you added in Step 1. If you named it differently, change Instagram to match.
  • |slice:":3" shows the 3 most recent posts. Change the number to show more, up to 6 on Free or 100 on Premium.
  • The image uses thumbnailUrl when there is one (video posts) and mediaUrl otherwise. Don't put mediaUrl straight into an <img>: for videos it's usually an MP4.
  • item.mediaType is IMAGE, VIDEO or CAROUSEL_ALBUM. Reels are VIDEO.

Send a test email to yourself to check the result.

Fields you can use

Account fields, e.g. {{ feeds.Instagram.username }}:

Field Notes
username Instagram username, without the @
name Display name. Can be null.
biography Instagram bio. Can be null.
website Can be null.
profilePictureUrl Can be null.
followersCount, followsCount, mediaCount Numbers

Post fields, inside the loop, e.g. {{ item.permalink }}:

Field Notes
id Instagram post id
caption Can be null. May contain line breaks, hashtags and emoji.
mediaType IMAGE, VIDEO or CAROUSEL_ALBUM
mediaUrl The image, or for videos usually an MP4. For carousels it's the first image.
thumbnailUrl Video posts only: a still image. null for other posts.
permalink The post on Instagram
timestamp When the post was published, as ISO 8601 text, e.g. 2026-01-15T18:30:00+00:00
likeCount, commentsCount Can be null
altText Almost always null; Instagram rarely provides it
sizes Premium only, and missing on Free: resized image URLs keyed "320", "768", "960" and "1200", e.g. `{{ item.sizes

The full response format is on the REST API page.

How fresh the posts are

Feedframer checks Instagram daily on Free and hourly on Premium. Responses are cached for up to an hour, and the cache is cleared when new posts are found (see Caching & Performance). Klaviyo then adds its own refresh schedule. To get a post into an email sooner, click Refresh Posts on the Feedframer Dashboard, then send your campaign.

Troubleshooting

Klaviyo can't read the feed

  1. Open the feed URL in a browser. You should see JSON starting with {"username":.
  2. If you see {"errors":[...]}, read the code:
    • MISSING_API_KEY: the URL has no api_key.
    • INVALID_API_KEY: the key was regenerated, or the account was disconnected. Reconnecting an account issues a new key. Copy the current key from the Dashboard and update the feed URL in Klaviyo.
  3. See Errors for the full list.

Klaviyo warns that if a feed keeps failing, emails that use it stop sending until the feed works again or is removed. If you regenerate your Feedframer API key, update the web feed straight away.

Images don't show

  1. Check the <img> uses thumbnailUrl for videos, as in the template above.
  2. Many email clients block remote images until the reader allows them.

Help