Guides · Free · Creators

CLAUDE ON
INSTAGRAM

Post and measure Trial Reels through the official API

Claude posts Trial Reels to my photo page. It cuts variants from my photo library and my own music catalog, publishes them as Trials so only non-followers see them, reads the results a day and three days later, and writes the brief for the next batch. I still post my own reels alongside. This guide is how it's wired, using Meta's official API, not a bot that logs in as you. Read the caveats in step 10 before you build anything: the API can't do several things the app can.

Download the AI playbook ↓ Start reading →
00OverviewRead first

What this does

The loop:

your library (photos, clips, your own music)
  → Claude picks a format and builds N variants that change ONE thing
  → script uploads each variant and publishes it as a Trial Reel
  → script pulls insights at ~24h and ~72h
  → results go in a sheet (views, skip rate, avg watch, shares, saves)
  → Claude ranks what worked and writes the next batch

Trial Reels are shown to non-followers first, so you can test hooks, fonts, lengths and openings without flooding your followers. You decide in the app which ones to share with everyone.

What you need: an Instagram professional account, a Facebook Page and Meta business portfolio, a Meta developer app, somewhere to host video files for a few minutes, and an AI assistant that can run scripts (Claude Code works well). n8n is optional if you want it scheduled without a computer session.

01Setup15 min

Account setup

  • Switch your Instagram to a professional account (creator or business) in the app's settings. Trial Reels and the API both need it. Small accounts qualify; my photo page had Trials at a few hundred followers.
  • Connect it to a Facebook Page.
  • Put the Page and the Instagram account in a Meta business portfolio (business.facebook.com). This is what lets you create a token that doesn't expire.
What broke for me

If you run more than one brand, give each its own business portfolio and its own app. Connecting one portfolio's app to another can move ownership of the app. Keep them separate from the start.

02Setup30 min

Meta app and permissions

At developers.facebook.com, create an app with the use case for managing content on Instagram. There are two ways in:

  • Instagram Login: talks to graph.instagram.com. Permissions: instagram_business_basic, instagram_business_content_publish, plus insights.
  • Facebook Login for Business: talks to graph.facebook.com. Permissions: instagram_basic, instagram_content_publish, instagram_manage_insights, pages_read_engagement. This is the path I use.

A token that doesn't expire

In your business portfolio, create a system user, assign it the Instagram account, the Page and the app, then generate a token with the permissions above. System user tokens can be set to never expire, which is what you want for something that runs on a schedule. User tokens expire and your posts will silently stop.

What broke for me

Twice. First, "No permissions available" when generating the token meant the app hadn't been assigned to the system user as an asset yet. Second, my first token was missing the content publish permission, so the first post attempt failed. Check the permission list on the token before you write any code.

03Security5 min

Keep the token secret

  • Save the token and your Instagram user ID in a secrets file outside any folder that gets pushed to GitHub, or in environment variables.
  • Have your scripts read it from there. Tell Claude the file path, never paste the token into a chat.
  • Anyone with this token can post as you. If it leaks, revoke it in the business portfolio and make a new one.
04Files15 min

Hosting the video

The API doesn't take a file from your computer for this flow. It takes a public URL and fetches the video itself.

  • Make a public storage bucket just for staging (I use a Supabase bucket limited to mp4 files).
  • Script flow: upload the mp4 → create the post with that URL → publish → delete the staged file.
  • Export vertical 9:16, H.264 video with AAC audio, at a sensible bitrate. Check Meta's current reel specs for length and size limits.
05API1 hour

Posting a reel

Publishing is two calls: create a container, wait for Instagram to process the video, then publish it.

# 1. create the container
POST https://graph.facebook.com/{version}/{IG_USER_ID}/media
  media_type=REELS
  video_url=https://your-bucket/.../variant-a.mp4
  caption=paris · fujifilm x-t5
  share_to_feed=false
  access_token=$IG_TOKEN
→ returns { "id": CONTAINER_ID }

# 2. poll until it's ready
GET  /{CONTAINER_ID}?fields=status_code
→ wait for FINISHED (IN_PROGRESS while it processes)

# 3. publish
POST /{IG_USER_ID}/media_publish
  creation_id=CONTAINER_ID
→ returns { "id": MEDIA_ID }

Have Claude write this as a small script with three commands (post, publish, unstage) and log every media ID to a file. You'll need the IDs for insights.

06API15 min

Trial Reels

Add one parameter to the container call:

trial_params={"graduation_strategy":"MANUAL"}
  • MANUAL: you decide in the app whether to share it with followers.
  • SS_PERFORMANCE: Instagram shares it with followers automatically if it performs well.

I use MANUAL so nothing reaches my followers without me deciding.

What broke for me

For large files the API offers a resumable upload instead of a URL. I used it for my first Trial, and it ignored the trial parameter: the reel went out to every follower and I had to delete it. Meta documents trial_params on the video URL container. Use the URL flow for Trials.

And verify

The API has no field that tells you a post is a Trial. Open the post in the app (or have someone screenshot it) before you, or Claude, call it a Trial. I made that a rule after the mistake above.

07Music—

Audio: use your own

The API can't attach Instagram's music library or trending sounds. Whatever audio is in the file is what posts. You have two options:

  • Bake in audio you have the rights to. I use tracks from my own label's catalog, with the artists' OK. Claude measures the BPM and the drop, and cuts the photos on the beat. Fully automatic.
  • Render silent variants to a folder, open them on your phone, add trending audio in the app and post by hand. More reach potential, but you're back to posting manually.

Don't bake in commercial songs you don't own. Instagram can mute or remove the reel, and it can count against the account.

What broke for me

Claude's first batches used flashy edits: Ken Burns zooms, flashes, fast cuts. They looked nothing like my account, and the fastest-cut ones had the worst skip rates. My best reels are slow: a few seconds of real footage of me first, then calm cuts on the beat, one clean line of text. Have Claude measure your own top reels first and match that look, then test one variable at a time inside it.

08Automation1 to 2 hours

The bridge: a script or n8n

  • A script Claude runs (Python or Node) is the simplest. Claude Code can build the variants, post them and pull results in one session.
  • n8n (self-hosted or cloud) if you want posts and insight pulls on a schedule without opening a session. Same API calls, as HTTP request nodes.
  • Either way, keep a log: variant name, what changed, media ID, time posted.

Space similar posts out. When I posted four near-identical Trials within two minutes, they competed with each other and split the reach. A few hours apart gives each a fair test.

09Measure30 min

Reading results

Pull insights per media ID at about 24 hours and 72 hours:

GET /{MEDIA_ID}/insights?metric=views,reach,likes,comments,shares,saved,...
    &access_token=$IG_TOKEN
  • Useful for testing: views, reach, shares, saves, plus skip rate and average watch time where your API version returns them. Metric names change between versions, so check the current list.
  • Put results in a sheet or Airtable with the variant notes, so Claude can see what changed and what it did.
  • Before building anything new, pull insights for all your past reels. That baseline tells you more than eyeballing your grid.
What I learned

Most of a Trial's views come in the first day. If it's flat at 24 hours it rarely recovers. Shares and saves tell you more than likes about whether to share it with followers.

10Read thisImportant

Caveats

  • No music library or trending sounds through the API. Bake in audio you own (step 07).
  • No drafts. There's no endpoint to save a reel as a draft in your app. It publishes or it doesn't.
  • Graduation is app-only for MANUAL Trials. You tap "share to followers" yourself.
  • No collaborators on Trials, and API stories can't carry link stickers.
  • No way to confirm a Trial through the API. Verify in the app.
  • Rate limit: Meta's docs list 100 API-published posts per rolling 24 hours (a carousel counts as one). Check your remaining quota with the content_publishing_limit endpoint. You should be nowhere near it.
  • Some analytics are app-only, like the second-by-second retention graph.
  • Tokens and permissions: user tokens expire; Pages that need Page Publishing Authorization can't publish until it's done; Meta can change permission names and API versions.
  • Originality: a flood of near-duplicates may hurt how Instagram treats the account. Keep variants meaningfully different.
11Rules—

Keep a human in the loop

  • Start small: two to four Trials a day, not the limit.
  • Approve the batch (or at least the captions) before anything posts. Claude posts; you decide what's allowed.
  • Don't let it reply to comments or DMs on its own. Drafting replies for you to send is fine.
  • Make "verify in the app" a rule for anything reported as done.
  • Keep posting your own reels too. The tests are for learning, not replacing you.
Free download · Works with Claude or ChatGPT

The AI playbook

A text file that turns an AI assistant into your setup partner for this. Paste it into Claude, ChatGPT or another assistant, or drop it into a Claude Code project. It checks your account type, walks you through the Meta app and token one screen at a time, writes the posting and insights scripts, and runs a first test post as a Trial. It's written to keep your token out of the chat and to verify a post really is a Trial before calling it one.

Download playbook (.txt) ↓

Stuck on a Meta permission screen, or want this set up for your account? Send me a message.

→ToolsOptions

Gear: what I use and the alternatives

You don't need any of this for the API side. It's what I use to shoot the hooks and selfie clips that the variants are built from. Each slot has a budget, a pick and an upgrade, with what each is best for. "I use this" marks gear I own. Links open on Amazon.

Disclosure: As an Amazon Associate I earn from qualifying purchases. Product links on this page are affiliate links. Items marked "I use this" are gear I own; the rest are options I researched. The price you pay is the same. Meta, Instagram, Claude and n8n are named because I use them, not because they pay me. Meta changes its API often; check the official docs before you build.