<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Phil Smith</title>
    <description>The latest articles on DEV Community by Phil Smith (@philyboysmith).</description>
    <link>https://dev.to/philyboysmith</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3586830%2Faa275e0b-3eed-470a-bd46-b81bf104789e.jpeg</url>
      <title>DEV Community: Phil Smith</title>
      <link>https://dev.to/philyboysmith</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/philyboysmith"/>
    <language>en</language>
    <item>
      <title>Your Instagram embed will die in 60 days (and how to stop it)</title>
      <dc:creator>Phil Smith</dc:creator>
      <pubDate>Mon, 26 Oct 2026 13:28:34 +0000</pubDate>
      <link>https://dev.to/philyboysmith/your-instagram-embed-will-die-in-60-days-and-how-to-stop-it-cck</link>
      <guid>https://dev.to/philyboysmith/your-instagram-embed-will-die-in-60-days-and-how-to-stop-it-cck</guid>
      <description>&lt;p&gt;You ship an Instagram grid on a marketing site. It looks great in staging. Three months later the homepage shows an empty box — or worse, last month’s posts forever — and nobody filed a ticket because nothing “crashed.”&lt;/p&gt;

&lt;p&gt;This is not bad luck — it is how Meta’s Instagram access tokens work.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Instagram tokens die
&lt;/h2&gt;

&lt;p&gt;Business and Creator accounts only (personal accounts lost API access when Basic Display shut down on 4 December 2024). The flow:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;User completes OAuth → you get a &lt;strong&gt;short-lived&lt;/strong&gt; token (hours).&lt;/li&gt;
&lt;li&gt;You exchange it for a &lt;strong&gt;long-lived&lt;/strong&gt; token (~&lt;strong&gt;60 days&lt;/strong&gt;).&lt;/li&gt;
&lt;li&gt;Before that window closes, you must call the refresh endpoint and &lt;strong&gt;persist the new token&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;If you miss the window, refresh fails. The user has to log in again.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Refresh is roughly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;GET https://graph.instagram.com/refresh_access_token
  ?grant_type=ig_refresh_token
  &amp;amp;access_token={long-lived-token}
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Gotchas:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Refresh only works while the token is still valid (usually only after it is older than 24 hours).&lt;/li&gt;
&lt;li&gt;Password changes and security checkpoints invalidate the session — refresh will not save you; re-auth is required.&lt;/li&gt;
&lt;li&gt;Even with a healthy token, &lt;strong&gt;Instagram CDN &lt;code&gt;media_url&lt;/code&gt; values expire&lt;/strong&gt;. Cached pages that stored those URLs show broken images later.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Fetching once and saving JSON is not enough. You need a scheduler, durable token storage, error alerts, and your own media copies.&lt;/p&gt;

&lt;h2&gt;
  
  
  DIY Graph refresh (sketch)
&lt;/h2&gt;

&lt;p&gt;If you want to own it, the minimal viable loop is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;every day (real cron, not "when someone visits"):
  1. Load stored long-lived token
  2. If token age &amp;gt; ~50 days (or always weekly): call refresh_access_token
  3. Save the new access_token + expires_in
  4. Fetch /{ig-user-id}/media with fields you need
  5. Download media to your bucket/CDN; store stable URLs in your DB
  6. On Graph errors (especially code 190): alert a human, do not silently render an empty grid
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In Next.js / Node use a real cron (Vercel cron, GitHub Action, worker). In PHP do &lt;strong&gt;not&lt;/strong&gt; rely solely on WP-Cron on a quiet site.&lt;/p&gt;

&lt;p&gt;Also budget Meta app review (when needed), API version upgrades, and field-name churn.&lt;/p&gt;

&lt;p&gt;DIY is free in dollars. It is not free in on-call.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why WordPress Instagram plugins go blank
&lt;/h2&gt;

&lt;p&gt;Plugins like Smash Balloon do the right idea: store a token, refresh on a schedule, render a grid. The failure mode is environmental:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;WP-Cron is fake cron&lt;/strong&gt; — it runs on page views. Quiet sites may never fire refresh near day 60.&lt;/li&gt;
&lt;li&gt;Failures are often &lt;strong&gt;quiet&lt;/strong&gt;: empty or stale markup; marketing is not watching &lt;code&gt;wp-admin&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Password/session changes surface as API error 190 — reconnect fixes it, but only if someone notices.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;On WordPress: real system cron → &lt;code&gt;wp-cron.php&lt;/code&gt;, alert on API errors, document re-auth for clients. Off WordPress (or tired of owning Meta’s token lifecycle): a hosted feed API moves that loop off your servers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hosted options, compared (developer lens)
&lt;/h2&gt;

&lt;p&gt;Not every “Instagram widget” product is the same. For code that needs &lt;strong&gt;data&lt;/strong&gt;, check JSON access, image hosting, refresh behaviour, and what happens when free quota runs out.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Approach&lt;/th&gt;
&lt;th&gt;Best for&lt;/th&gt;
&lt;th&gt;Watch-out&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;DIY Graph API&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Full control, unusual fields&lt;/td&gt;
&lt;td&gt;Token refresh, Meta app, expiring media URLs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Smash Balloon&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;WordPress grid UI&lt;/td&gt;
&lt;td&gt;WP-only; renewal pricing; still depends on cron/reconnect&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Behold&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Polished widget + public JSON&lt;/td&gt;
&lt;td&gt;Free tier ~&lt;strong&gt;1,200 views/mo&lt;/strong&gt;, then &lt;strong&gt;account paused&lt;/strong&gt;; paid plans still meter views on most tiers&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Feedframer&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;REST / GraphQL / RSS, flat pricing&lt;/td&gt;
&lt;td&gt;Free capped at &lt;strong&gt;6 posts&lt;/strong&gt; (not views); Premium &lt;strong&gt;$6/mo or $60/yr&lt;/strong&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A useful third-party roundup (Sep 2026) that scores JSON, Reels, carousels, and image hosting side by side: &lt;a href="https://electricblaze.com/developer/instagram-feed/comparison.html" rel="noopener noreferrer"&gt;Instagram Feed APIs for Developers, Compared&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Behold and view caps
&lt;/h3&gt;

&lt;p&gt;Behold is strong if you want a drop-in widget. The free-tier trap is the &lt;strong&gt;view meter&lt;/strong&gt;: hit the cap and feeds pause until next month — honest metering, surprising outage on a shared client launch.&lt;/p&gt;

&lt;h3&gt;
  
  
  Smash Balloon and WordPress
&lt;/h3&gt;

&lt;p&gt;On WordPress with layouts and a customizer, Smash Balloon is the incumbent. It is not an API for Astro or a Klaviyo RSS block, and token issues still appear when cron or re-auth is neglected.&lt;/p&gt;

&lt;h3&gt;
  
  
  Feedframer (what I built)
&lt;/h3&gt;

&lt;p&gt;I got tired of re-implementing OAuth + refresh + CDN for “just show my posts.” &lt;a href="https://feedframer.com" rel="noopener noreferrer"&gt;Feedframer&lt;/a&gt; is a small Instagram Feed API: connect a Business/Creator account once; we refresh tokens, fetch on a schedule (daily Free / hourly Premium), copy media to our CDN, and expose &lt;strong&gt;REST, GraphQL, or RSS&lt;/strong&gt; on one key.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Free:&lt;/strong&gt; 6 posts/account, &lt;strong&gt;unlimited API calls&lt;/strong&gt;, all three formats, no card.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Premium:&lt;/strong&gt; $6/month or $60/year — more accounts/posts, hourly refresh, responsive sizes.&lt;/p&gt;

&lt;p&gt;In the 30 days to 25 October 2026 we served ~&lt;strong&gt;1.1M requests&lt;/strong&gt;, &lt;strong&gt;840K media files&lt;/strong&gt;, &lt;strong&gt;1.8 TB&lt;/strong&gt;, and &lt;strong&gt;130K API calls&lt;/strong&gt; — mostly without marketing. The token problem is real enough that people find a fix when they need one.&lt;/p&gt;

&lt;h2&gt;
  
  
  When DIY vs hosted
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Stay DIY when:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You already have a Meta app in production and an on-call rotation that understands Graph errors.&lt;/li&gt;
&lt;li&gt;You need fields or workflows a host does not expose.&lt;/li&gt;
&lt;li&gt;Compliance requires tokens and media to never leave your VPC.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Prefer hosted when:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You are embedding &lt;em&gt;your&lt;/em&gt; (or a client’s) feed on a site and do not want a Meta project per client.&lt;/li&gt;
&lt;li&gt;You need RSS for Mailchimp/Klaviyo without building a bridge.&lt;/li&gt;
&lt;li&gt;You have been burned by a blank homepage and do not want a 60-day calendar reminder.&lt;/li&gt;
&lt;li&gt;You want unlimited request volume on a cheap plan without a view counter pausing the widget.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Prefer a WordPress plugin when:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The CMS is WordPress and stakeholders want a visual grid builder more than a JSON response.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  A practical checklist either way
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Confirm the Instagram account is &lt;strong&gt;Business or Creator&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Never rely on Instagram CDN URLs in a long-lived cache — copy media.&lt;/li&gt;
&lt;li&gt;Refresh tokens on a &lt;strong&gt;real&lt;/strong&gt; scheduler; alert on auth errors.&lt;/li&gt;
&lt;li&gt;Decide what “at the free limit” means for your vendor (pause? watermark? soft upgrade nag?) before you put it on a client domain.&lt;/li&gt;
&lt;li&gt;Document re-auth steps for whoever owns the Instagram password.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Soft CTA
&lt;/h2&gt;

&lt;p&gt;Hosted path: connect once at &lt;a href="https://feedframer.com" rel="noopener noreferrer"&gt;feedframer.com&lt;/a&gt;, copy the key, &lt;code&gt;GET /api/v1/me&lt;/code&gt;. Free is enough for a portfolio; upgrade for more than six posts or hourly updates.&lt;/p&gt;

&lt;p&gt;DIY path: automate refresh this week — not on day 59. Future you will not thank you, but they also will not page you about an empty grid.&lt;/p&gt;

</description>
      <category>instagram</category>
      <category>api</category>
      <category>webdev</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
