---
id: 18855
lang: en
title: "A Blogger Hooked Claude Code Up to the Instagram API in One Evening and Analyzed 658 Reels from 45 Creators"
published_at: "2026-12-01 18:28:41"
source_name: "Habr AI"
source_url: "https://habr.com/ru/articles/1114722/?utm_campaign=1114722&utm_source=habrahabr&utm_medium=rss"
canonical_url: "https://news.hamidun.com/en/news/18855"
categories: ["llm", "autonomous"]
publisher: "AI News by Jemal Hamidun (news.hamidun.com)"
---

# A Blogger Hooked Claude Code Up to the Instagram API in One Evening and Analyzed 658 Reels from 45 Creators

> **Краткая суть (BLUF):** A blogger connected Claude Code to Instagram's official API and, within one evening, got statistics for each Reel, including the share of viewers who scrolled past in the first seconds. The agent then collected 658 posts from 45 similar accounts over 30 days and flagged videos that gained 10+ times the creator's usual views. Claude wrote the code itself, and no Meta* review was needed. For small creators, this is a free alternative to paid analytics.  • Working path: a system user token, no Facebook* Page required • Record: 685 thousand views for an account with 3.6 thousand followers • 8 out of 10 viral Russian-language Reels were lists of 2–8 items

To understand why some Reels get watched to the end while others get scrolled past on the third second, you usually have to pay for analytics services. Instagram* itself shows statistics for each Reel separately, and other people's Reels show only views and likes. The author of a channel about AI agents skipped the subscription. He connected Claude Code (Anthropic's coding AI agent) to Meta's official API and, in a single evening, got statistics for his own Reels and also collected 658 posts from 45 similar accounts over 30 days. He didn't write the code himself: Claude did everything based on his requests. Below is what worked, where the author got stuck, and what conclusions are worth taking away.

## What You Can Pull for Free

If an app works only with your own account, the API returns your statistics and public figures for other accounts at no cost. For your own Reels, you get views, reach, likes, comments, shares, saves, average watch time, and the share of people who scrolled past the Reel in the first seconds (the reels_skip_rate metric). For an account over a period, you can get reach by day, broken down into followers and non-followers. For posts, you also get follows and profile visits.

With other accounts via Business Discovery, the data is more limited: only public follower counts, likes, comments, Reel views, captions, and links. There is no reach, retention, or shares. Only professional accounts of the Creator or Business type are readable, and if the creator has hidden likes, the like_count field won't come back. The API provides the follower/non-follower breakdown only for an account, and a request for an individual Reel returns an Incompatible breakdowns error, so the collector records that data by day.

## Three Ways to Connect, and the Dead Ends

Most guides describe logging in through Facebook* and a Page: you need a Facebook* Page linked to Instagram*. In Meta's 2026 interface, the author could not set up that link. The Instagram* login path, according to the documentation, should issue a 60-day access token, but the button produced a different result.

The third path worked: a system user token from a Business Portfolio, on the "Instagram* API (single login)" page. It starts with the characters EAG, works through graph.facebook.com, does not expire, and returns everything at once, including reels_skip_rate and Business Discovery. You don't need a Facebook* Page, and you don't need Meta's app review (App Review), because the app stays in development mode.

The steps are as follows: create an app of the "Business" type, add yourself as an Instagram* tester and accept the invitation on the site, generate the token, and take the 17-digit account ID from the same table. You cannot find the ID through /me/accounts. Meta's official MCP (a way to give Claude access to the developer dashboard) was useful only for verification: creating the app through it timed out three times during confirmation, so the app had to be created by hand.

The token must not be shown in the chat with Claude, in screenshots, or in git. Claude wrote a script that reads the token from the clipboard, verifies it with a request, and saves it to a .meta-key file, which is added to .gitignore. The script is run in the user's own terminal. The app only reads data; no publishing permissions were requested. The DuckDB-based collector remembers the metrics the API does not return (errors 10 and 100) and stops requesting them, and it pauses for one second between other accounts. The limits in development mode are small, but 45 accounts once a week do not hit them.

## What the Numbers Showed

The author counted as an outlier a Reel that gathered an abnormally high number of views relative to the creator's own median, not relative to the number of followers. The Reels were taken from the last 30 days but no younger than three days, because views on fresh posts are still growing. The "3 times above the median" threshold turned out to be too loose: it captured 120 of 658 Reels, or 18%. For the analysis, the author used the "10 times above the median" threshold, yielding 10 Russian-language and 38 English-language Reels. The record: 685 thousand views for an account with 3.6 thousand followers, 288 times that creator's median.

Popular caption advice did not hold up. The call to "write the keyword in the comments" does not raise reach: it appears in 38% of Russian-language outliers versus 46% of ordinary Reels. The captions show that they are used to collect leads in DMs. Mentioning Claude doesn't help either; in this niche it is background noise. However, Russian-language outliers more often have a number in the first line of the caption (17% versus 7%) and less often have a long caption: over 400 characters in 24% of cases versus 54%.

The author downloaded the 10 Russian-language Reels that exceeded the 10x threshold using yt-dlp, split them into frames, transcribed the speech locally with faster-whisper, and analyzed them. Eight of the ten are structured as a list of 2–8 items, seven contain a "free versus paid" contrast, and in nine the result appears on screen by the 3rd–4th second. Lengths ranged from 33 to 79 seconds, and five were longer than 50 seconds, so a short format is not mandatory. Six of the ten creators have up to 5 thousand followers.

The limitations are stated openly: the sample is small, and the author himself calls the conclusions hypotheses to test on his own Reels. The API does not return a direct file link (media_url) for all other creators' Reels; roughly a third have none, so downloading via the public link is more reliable. The collector does not gather Stories, since they live for only 24 hours.

The practical takeaway: the combination of the official API plus a coding agent covers basic analytics without subscriptions. The key is not to store the token next to the chat or the repository, and not to treat conclusions drawn from a couple dozen Reels as established rules.

*Instagram and Facebook are owned by Meta, a company recognized as an extremist organization and banned in Russia.

---
- **Первоисточник:** [Habr AI](https://habr.com/ru/articles/1114722/?utm_campaign=1114722&utm_source=habrahabr&utm_medium=rss)
- **Каноническая ссылка:** https://news.hamidun.com/en/news/18855
- **Экосистема автора:** [Бесплатный интенсив по вайбкодингу — предзапись в Нике](https://t.me/vibecodeguidebot?start=agent_intensive_news_md) · [Nomad AI](https://nomadnet.ai) · [Telegram @jemal_hamidun](https://t.me/jemal_hamidun)
