creatorloop 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. creatorloop-0.1.0/.gitignore +21 -0
  2. creatorloop-0.1.0/CHANGELOG.md +26 -0
  3. creatorloop-0.1.0/LICENSE +21 -0
  4. creatorloop-0.1.0/PKG-INFO +254 -0
  5. creatorloop-0.1.0/README.md +225 -0
  6. creatorloop-0.1.0/README.ru.md +34 -0
  7. creatorloop-0.1.0/README.uz.md +34 -0
  8. creatorloop-0.1.0/pyproject.toml +70 -0
  9. creatorloop-0.1.0/server.json +35 -0
  10. creatorloop-0.1.0/src/creatorloop/__init__.py +13 -0
  11. creatorloop-0.1.0/src/creatorloop/__main__.py +3 -0
  12. creatorloop-0.1.0/src/creatorloop/analytics.py +577 -0
  13. creatorloop-0.1.0/src/creatorloop/auth_cli.py +133 -0
  14. creatorloop-0.1.0/src/creatorloop/comments.py +111 -0
  15. creatorloop-0.1.0/src/creatorloop/config.py +110 -0
  16. creatorloop-0.1.0/src/creatorloop/env.example +33 -0
  17. creatorloop-0.1.0/src/creatorloop/graph_client.py +224 -0
  18. creatorloop-0.1.0/src/creatorloop/instagram.py +461 -0
  19. creatorloop-0.1.0/src/creatorloop/paths.py +67 -0
  20. creatorloop-0.1.0/src/creatorloop/post_queue.py +196 -0
  21. creatorloop-0.1.0/src/creatorloop/publish.py +417 -0
  22. creatorloop-0.1.0/src/creatorloop/refs.py +188 -0
  23. creatorloop-0.1.0/src/creatorloop/reviews.py +116 -0
  24. creatorloop-0.1.0/src/creatorloop/server.py +816 -0
  25. creatorloop-0.1.0/src/creatorloop/setup_cli.py +175 -0
  26. creatorloop-0.1.0/src/creatorloop/storage.py +464 -0
  27. creatorloop-0.1.0/src/creatorloop/tunnel.py +169 -0
  28. creatorloop-0.1.0/tests/__init__.py +0 -0
  29. creatorloop-0.1.0/tests/conftest.py +45 -0
  30. creatorloop-0.1.0/tests/fixtures/business_discovery_v26.json +15 -0
  31. creatorloop-0.1.0/tests/fixtures/media_insights_reels_v26.json +11 -0
  32. creatorloop-0.1.0/tests/fixtures/tiny-reel-faststart.mp4 +0 -0
  33. creatorloop-0.1.0/tests/test_analytics.py +136 -0
  34. creatorloop-0.1.0/tests/test_api.py +163 -0
  35. creatorloop-0.1.0/tests/test_comments.py +73 -0
  36. creatorloop-0.1.0/tests/test_fixtures.py +34 -0
  37. creatorloop-0.1.0/tests/test_paths.py +135 -0
  38. creatorloop-0.1.0/tests/test_publish.py +279 -0
  39. creatorloop-0.1.0/tests/test_queue.py +104 -0
  40. creatorloop-0.1.0/tests/test_refs.py +115 -0
  41. creatorloop-0.1.0/tests/test_release.py +29 -0
  42. creatorloop-0.1.0/tests/test_reviews.py +62 -0
  43. creatorloop-0.1.0/tests/test_server.py +204 -0
  44. creatorloop-0.1.0/tests/test_setup_cli.py +207 -0
  45. creatorloop-0.1.0/tests/test_tunnel.py +57 -0
@@ -0,0 +1,21 @@
1
+ .env
2
+ data/
3
+ __pycache__/
4
+ *.pyc
5
+ .venv/
6
+ .pytest_cache/
7
+ *.egg-info/
8
+ dist/
9
+ .ruff_cache/
10
+ .idea/
11
+ node_modules/
12
+ *.mp4
13
+ !tests/fixtures/*.mp4
14
+ *.mov
15
+ *.webm
16
+ *.wav
17
+ *.mp3
18
+ examples/**/*.png
19
+ examples/**/*.jpg
20
+ examples/**/out/
21
+ examples/**/slides/
@@ -0,0 +1,26 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented here. The format follows
4
+ [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the project uses [Semantic Versioning](https://semver.org/).
5
+
6
+ ## [Unreleased]
7
+
8
+ ## [0.1.0] - 2026-10-13
9
+
10
+ First public release.
11
+
12
+ ### Added
13
+ - MCP server with 33 tools for one Instagram professional account via the official Instagram Graph API v26.0:
14
+ own analytics and content reports, caption insights, audience demographics, competitor analysis and tracking
15
+ (Business Discovery), viral-post detection, post analysis by URL, hashtag research with a 30-per-week quota guard.
16
+ - Two-step publishing of carousels and Reels (resumable upload for Reels), a publishing queue with fingerprints,
17
+ 24 h / 72 h post reviews, new-comment inbox and replies.
18
+ - `creatorloop-setup`: connects Claude Desktop on Windows (incl. Microsoft Store), macOS and Linux; quits and reopens
19
+ Claude Desktop on macOS so it does not overwrite the config.
20
+ - `creatorloop-auth`: token exchange, account ID lookup, token check.
21
+ - Per-user home folder (`CREATORLOOP_HOME`) for settings, database and content; system timezone by default.
22
+ - Three MCP prompts: weekly report, competitor brief, data-driven content ideas.
23
+ - `examples/`: a sample carousel, a sample Reel storyboard and a Remotion Reel template with automatic checks.
24
+
25
+ [Unreleased]: https://github.com/pandich93/creatorloop/compare/v0.1.0...HEAD
26
+ [0.1.0]: https://github.com/pandich93/creatorloop/releases/tag/v0.1.0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 pandich
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,254 @@
1
+ Metadata-Version: 2.5
2
+ Name: creatorloop
3
+ Version: 0.1.0
4
+ Summary: Open-source AI content studio for Instagram creators: Claude analyses what works, helps make Reels and carousels, schedules and reviews them via the official Instagram API
5
+ Project-URL: Homepage, https://github.com/pandich93/creatorloop
6
+ Project-URL: Repository, https://github.com/pandich93/creatorloop
7
+ Project-URL: Issues, https://github.com/pandich93/creatorloop/issues
8
+ Project-URL: Changelog, https://github.com/pandich93/creatorloop/blob/main/CHANGELOG.md
9
+ Author: pandich
10
+ License-Expression: MIT
11
+ License-File: LICENSE
12
+ Keywords: analytics,claude,content-creator,instagram,mcp,model-context-protocol,reels,social-media
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Environment :: Console
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Intended Audience :: End Users/Desktop
17
+ Classifier: Operating System :: OS Independent
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.14
20
+ Classifier: Topic :: Internet
21
+ Classifier: Topic :: Multimedia :: Video
22
+ Requires-Python: >=3.14
23
+ Requires-Dist: httpx>=0.28
24
+ Requires-Dist: mcp<3,>=2.3
25
+ Requires-Dist: pillow>=11.3
26
+ Requires-Dist: python-dotenv>=1.0
27
+ Requires-Dist: tzdata>=2025.2
28
+ Description-Content-Type: text/markdown
29
+
30
+ <!-- mcp-name: io.github.pandich93/creatorloop -->
31
+ <div align="center">
32
+
33
+ # creatorloop
34
+
35
+ **Open-source AI content studio for Instagram creators, built on Claude and the official Instagram API.**
36
+
37
+ Analyse what works → make Reels and carousels → publish or queue them → review how they did. All from a chat with Claude.
38
+
39
+ [![CI](https://github.com/pandich93/creatorloop/actions/workflows/ci.yml/badge.svg)](https://github.com/pandich93/creatorloop/actions/workflows/ci.yml)
40
+ [![PyPI](https://img.shields.io/pypi/v/creatorloop.svg)](https://pypi.org/project/creatorloop/)
41
+ [![Python](https://img.shields.io/badge/python-3.14-blue.svg)](https://www.python.org/)
42
+ [![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
43
+
44
+ [Русский](https://github.com/pandich93/creatorloop/blob/main/README.ru.md) · [Oʻzbekcha](https://github.com/pandich93/creatorloop/blob/main/README.uz.md)
45
+
46
+ ![creatorloop demo](https://raw.githubusercontent.com/pandich93/creatorloop/main/docs/media/demo.gif)
47
+
48
+ </div>
49
+
50
+ ## Why
51
+
52
+ There are plenty of "Instagram API for Claude" servers. creatorloop is built for the **creator's loop** instead:
53
+
54
+ - **Learn from data, not vibes.** Best and worst posts with their hooks, format comparison, follows per 1,000 reach,
55
+ Reels watch time, best day and hour — and which captions (language, question hook, CTA, length) actually work.
56
+ - **Spy on competitors legally.** Track professional accounts, keep their follower history, and get alerted to the
57
+ posts that did N× better than their median. Analyse any public post by URL, slides included.
58
+ - **Make the content.** A Remotion Reel template with automatic checks (first-second rule, safe zones, "not a copy of
59
+ the carousel"), original music and licensed 3D objects.
60
+ - **Publish safely.** Two-step publishing with a preview, a queue with fingerprints (a changed file blocks the post),
61
+ 24 h / 72 h post reviews and comment replies — every public action needs your explicit OK.
62
+ - **Official API only.** No scraping, no browser automation, no risk to your account.
63
+
64
+ ## Quick start
65
+
66
+ You need [uv](https://docs.astral.sh/uv/getting-started/installation/), [Claude Desktop](https://claude.ai/download),
67
+ an Instagram **Business or Creator** account linked to a **Facebook Page**, and your own Meta app
68
+ ([5-minute guide](https://github.com/pandich93/creatorloop/blob/main/docs/meta-setup.md)).
69
+
70
+ ```bash
71
+ uvx --from creatorloop creatorloop-setup # 1. connect to Claude Desktop, create the settings file
72
+ ```
73
+
74
+ 2. Put your app's `META_APP_ID` and `META_APP_SECRET` into the settings file the command printed.
75
+ 3. Save a 60-day token and find your account ID (the short-lived token comes from Graph API Explorer, see the guide):
76
+
77
+ ```bash
78
+ uvx --from creatorloop creatorloop-auth exchange --short-token <TOKEN> --write
79
+ uvx --from creatorloop creatorloop-auth whoami --write
80
+ uvx --from creatorloop creatorloop-auth check # → OK: @your_account followers=...
81
+ ```
82
+
83
+ Restart Claude Desktop and ask: *"How did my last 10 posts do, and what should I post next?"*
84
+
85
+ <details>
86
+ <summary>Installing uv</summary>
87
+
88
+ | System | Command |
89
+ |---|---|
90
+ | Windows | `powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 \| iex"` |
91
+ | macOS | `brew install uv` or `curl -LsSf https://astral.sh/uv/install.sh \| sh` |
92
+ | Linux | `curl -LsSf https://astral.sh/uv/install.sh \| sh` |
93
+
94
+ uv downloads Python 3.14 by itself if you don't have it.
95
+ </details>
96
+
97
+ `creatorloop-setup` finds the Claude Desktop config on Windows (including the Microsoft Store build), macOS and Linux,
98
+ keeps your other servers, makes a backup and creates your settings file. Claude Desktop rewrites its config while it
99
+ runs, so on macOS the command quits and reopens it for you; on Windows and Linux it asks you to quit it first.
100
+
101
+ ## What you can ask
102
+
103
+ - "Make a report on my content for the last 60 days. Reels or carousels — what works better, and when should I post?"
104
+ - "Compare me with @competitor1 and @competitor2. Who has the higher engagement and why?"
105
+ - "Analyse this post https://www.instagram.com/p/… and write my own version of it."
106
+ - "Track @competitor and tell me every week which of their posts took off."
107
+ - "Check the hashtags #ai, #productivity and #startup. Check the quota first."
108
+ - "Queue the post from folder `my-first-reel` for the next free slot." → preview → "yes" → it goes out on time.
109
+ - "Which new comments haven't I answered? Draft replies." → you approve each reply.
110
+
111
+ Ready-made prompts in Claude Desktop's **+** menu: *Weekly Instagram report*, *Competitor brief*, *Data-driven content ideas*.
112
+
113
+ ## Tools
114
+
115
+ | Area | Tools |
116
+ |---|---|
117
+ | Your account | `get_my_profile`, `get_my_media`, `get_media_insights`, `get_account_insights`, `get_audience_demographics` |
118
+ | Content analysis | `get_my_content_report`, `get_caption_insights`, `get_post_history`, `post_reviews` |
119
+ | Competitors | `get_competitor`, `compare_accounts`, `get_follower_history`, `track_competitor`, `untrack_competitor`, `list_tracked_competitors`, `update_tracked_competitors`, `find_viral_posts`, `get_competitor_post` |
120
+ | Hashtags | `search_hashtag`, `compare_hashtags`, `plan_hashtag_research` |
121
+ | Publishing | `prepare_post`, `get_post_job`, `publish_media`, `list_publications` |
122
+ | Queue | `queue_post`, `list_queue`, `cancel_queued` |
123
+ | Comments | `get_new_comments`, `reply_comment` |
124
+ | Service | `get_api_status`, `clear_cache`, `restart_server` |
125
+
126
+ 33 tools in total. Tools that change something on Instagram are annotated as such for Claude, and their descriptions
127
+ tell it to act only after you approve: `publish_media` and `reply_comment` after you OK the preview or the exact
128
+ text, `queue_post` only with `confirm=true` after you saw the preview.
129
+
130
+ ## Publishing
131
+
132
+ Put the files into a folder inside your **content folder** (`<creatorloop home>/content/<name>/`):
133
+
134
+ ```
135
+ my-carousel/ my-reel/
136
+ slide_01.png … slide_10.png reel.mp4 # H.264/HEVC, 23–60 fps, ≤1920 px wide, 3 s–15 min, ≤300 MB
137
+ caption.txt caption.txt
138
+ reel.json # optional: {"cover_ms": 1667, "share_to_feed": true, "trial": "SS_PERFORMANCE"}
139
+ ```
140
+
141
+ - Slides: 1–10 PNG/JPG (API limit), aspect ratio 4:5 to 1.91:1, ordered by file name. Everything below a `---` line in
142
+ `caption.txt` is notes and is not published.
143
+ - Then: "prepare the post from folder `my-carousel`" → preview → "publish". Or queue it for a slot.
144
+ - Carousels: Instagram downloads images from a public URL, so creatorloop opens a temporary
145
+ [Cloudflare Quick Tunnel](https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/do-more-with-tunnels/trycloudflare/)
146
+ for that minute. Install `cloudflared` once: `winget install --id Cloudflare.cloudflared -e` (Windows),
147
+ `brew install cloudflared` (macOS) or a package from [pkg.cloudflare.com](https://pkg.cloudflare.com/index.html) (Linux).
148
+ - Reels upload directly to Meta (no tunnel). The MP4 header is checked before upload (duration, size, width,
149
+ `moov` first) with the exact `ffmpeg` fix if something is off.
150
+ - Queue slots default to Tue/Thu/Sun 19:00 in your timezone — an example, change `QUEUE_SLOTS` in the settings file.
151
+ A queued post is blocked if its files or caption change after you approved it, and is marked missed if your
152
+ computer was asleep for more than 3 hours past the slot.
153
+ - Meta's limit is 100 posts per rolling 24 hours; `list_publications` shows what is left. Publishing is never retried
154
+ automatically, so there are no duplicates.
155
+
156
+ Making the content itself: see [`examples/`](https://github.com/pandich93/creatorloop/blob/main/examples) and the [content pipeline](https://github.com/pandich93/creatorloop/blob/main/docs/content-pipeline.md) —
157
+ a sample carousel, a sample Reel storyboard and the Remotion Reel template.
158
+
159
+ ## What the Instagram API allows (and doesn't)
160
+
161
+ | | Possible | Not possible |
162
+ |---|---|---|
163
+ | **Your account** | Reach, views, likes, comments, saves, shares, profile visits, follows per post, Reels average watch time, audience demographics, account totals | Data older than 2 years; insights per carousel slide; Stories after 24 h |
164
+ | **Competitors** (Business Discovery) | Public data of Business/Creator accounts: followers, posts, bio, likes, comments, Reels views per post | Personal or private accounts; their reach, saves, shares, demographics; Stories |
165
+ | **Hashtags** | Top posts and posts from the last 24 h | More than **30 unique hashtags per rolling 7 days**; post authors; keyword, audio or trend search |
166
+ | **Follower growth** | creatorloop saves a daily snapshot for you and every competitor you look at | History before the first snapshot |
167
+
168
+ Engagement rate for your posts = Σ(likes + comments + saves + shares) / Σreach × 100 (weighted, so tiny posts don't
169
+ skew it). Posts younger than 72 h are reported separately as "still growing". Competitors' ER is per follower — the
170
+ API does not expose their reach.
171
+
172
+ ## Settings
173
+
174
+ `creatorloop-setup` creates `.env` in your creatorloop home folder:
175
+
176
+ | System | Home folder |
177
+ |---|---|
178
+ | Windows | `%APPDATA%\creatorloop` |
179
+ | macOS | `~/Library/Application Support/creatorloop` |
180
+ | Linux | `~/.local/share/creatorloop` (or `$XDG_DATA_HOME/creatorloop`) |
181
+
182
+ Set `CREATORLOOP_HOME` to use another folder. The home folder holds `.env`, the `creatorloop.db` database and the
183
+ `content/` folder.
184
+
185
+ | Variable | Required | Meaning |
186
+ |---|---|---|
187
+ | `IG_ACCESS_TOKEN` | yes | Long-lived (60 days) or System User (never expires) token — see [Meta setup](https://github.com/pandich93/creatorloop/blob/main/docs/meta-setup.md) |
188
+ | `IG_USER_ID` | yes | Your Instagram professional account ID (`1784…`), not the username |
189
+ | `GRAPH_API_VERSION` | no | Default `v26.0` |
190
+ | `META_APP_ID`, `META_APP_SECRET` | no | Only for `creatorloop-auth exchange` |
191
+ | `IG_TIMEZONE` | no | IANA name, e.g. `Europe/Berlin`. Default: your computer's timezone |
192
+ | `QUEUE_SLOTS` | no | e.g. `Mon,Wed,Fri 20:00` |
193
+ | `IG_DB_PATH`, `CACHE_TTL_*_MIN` | no | Database location, cache lifetime in minutes |
194
+
195
+ The token expiry shows up in `get_api_status`, and every tool answer carries a `token_warning` 14 days before expiry.
196
+
197
+ ## FAQ
198
+
199
+ <details><summary>Does it work with a personal Instagram account?</summary>
200
+ No. Meta's API only serves Business and Creator accounts linked to a Facebook Page. Switching is free:
201
+ Instagram → Settings → Account type and tools.
202
+ </details>
203
+
204
+ <details><summary>Do I need Meta App Review?</summary>
205
+ Not for your own account: keep the app in Development mode, you are its admin. Hashtag search may require the
206
+ "Instagram Public Content Access" feature for some accounts — creatorloop tells you if Meta refuses it.
207
+ </details>
208
+
209
+ <details><summary>Can it get my account banned?</summary>
210
+ creatorloop uses only the official Graph API with your own app and token, within Meta's rate limits. It does no
211
+ scraping and no browser automation.
212
+ </details>
213
+
214
+ <details><summary>Which AI clients does it work with?</summary>
215
+ It is a standard MCP server (stdio). It is developed and tested with Claude Desktop; other MCP clients that support
216
+ stdio servers should work too.
217
+ </details>
218
+
219
+ <details><summary>A metric is missing in the answer.</summary>
220
+ Meta regularly removes metrics (e.g. `impressions` and `plays` in April 2025, replaced by `views`). creatorloop
221
+ moves a refused metric to `unavailable` instead of failing and stops asking for it for 7 days. Insights can lag up to 48 h.
222
+ </details>
223
+
224
+ ## Data & privacy
225
+
226
+ - Your token, settings, database and content stay on your computer in the creatorloop home folder.
227
+ - creatorloop talks to Meta only: the Instagram Graph API (`graph.facebook.com`, `rupload.facebook.com` for video
228
+ uploads) and Instagram's media servers when it downloads the slides of a post you asked it to analyse.
229
+ - To publish carousels (and Reels, if the direct upload is refused) it opens a temporary Cloudflare Quick Tunnel to
230
+ your local files for the minute Meta needs to fetch them, then closes it and deletes the temporary copies.
231
+ - No analytics, telemetry or third-party services.
232
+
233
+ ## Development
234
+
235
+ ```bash
236
+ git clone https://github.com/pandich93/creatorloop && cd creatorloop
237
+ uv sync
238
+ uv run pytest # offline: mocked Graph API and captured response shapes
239
+ uv run creatorloop-setup # points Claude Desktop at this checkout instead of the PyPI package
240
+ ```
241
+
242
+ See [CONTRIBUTING.md](https://github.com/pandich93/creatorloop/blob/main/CONTRIBUTING.md). Security issues: [SECURITY.md](https://github.com/pandich93/creatorloop/blob/main/SECURITY.md).
243
+
244
+ ## Disclaimer
245
+
246
+ creatorloop is an independent open-source project. **Not affiliated with, endorsed or sponsored by Meta or
247
+ Instagram.** "Instagram" is a trademark of Meta Platforms, Inc. You are responsible for complying with the
248
+ [Meta Platform Terms](https://developers.facebook.com/terms/) and Instagram's policies when you use it.
249
+
250
+ ## License
251
+
252
+ [MIT](https://github.com/pandich93/creatorloop/blob/main/LICENSE). The Reel template in `examples/reel-template` uses [Remotion](https://www.remotion.dev), which has
253
+ its own licence; bundled assets and fonts are listed in
254
+ [`examples/reel-template/public/assets/LICENSES.md`](https://github.com/pandich93/creatorloop/blob/main/examples/reel-template/public/assets/LICENSES.md).
@@ -0,0 +1,225 @@
1
+ <!-- mcp-name: io.github.pandich93/creatorloop -->
2
+ <div align="center">
3
+
4
+ # creatorloop
5
+
6
+ **Open-source AI content studio for Instagram creators, built on Claude and the official Instagram API.**
7
+
8
+ Analyse what works → make Reels and carousels → publish or queue them → review how they did. All from a chat with Claude.
9
+
10
+ [![CI](https://github.com/pandich93/creatorloop/actions/workflows/ci.yml/badge.svg)](https://github.com/pandich93/creatorloop/actions/workflows/ci.yml)
11
+ [![PyPI](https://img.shields.io/pypi/v/creatorloop.svg)](https://pypi.org/project/creatorloop/)
12
+ [![Python](https://img.shields.io/badge/python-3.14-blue.svg)](https://www.python.org/)
13
+ [![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
14
+
15
+ [Русский](https://github.com/pandich93/creatorloop/blob/main/README.ru.md) · [Oʻzbekcha](https://github.com/pandich93/creatorloop/blob/main/README.uz.md)
16
+
17
+ ![creatorloop demo](https://raw.githubusercontent.com/pandich93/creatorloop/main/docs/media/demo.gif)
18
+
19
+ </div>
20
+
21
+ ## Why
22
+
23
+ There are plenty of "Instagram API for Claude" servers. creatorloop is built for the **creator's loop** instead:
24
+
25
+ - **Learn from data, not vibes.** Best and worst posts with their hooks, format comparison, follows per 1,000 reach,
26
+ Reels watch time, best day and hour — and which captions (language, question hook, CTA, length) actually work.
27
+ - **Spy on competitors legally.** Track professional accounts, keep their follower history, and get alerted to the
28
+ posts that did N× better than their median. Analyse any public post by URL, slides included.
29
+ - **Make the content.** A Remotion Reel template with automatic checks (first-second rule, safe zones, "not a copy of
30
+ the carousel"), original music and licensed 3D objects.
31
+ - **Publish safely.** Two-step publishing with a preview, a queue with fingerprints (a changed file blocks the post),
32
+ 24 h / 72 h post reviews and comment replies — every public action needs your explicit OK.
33
+ - **Official API only.** No scraping, no browser automation, no risk to your account.
34
+
35
+ ## Quick start
36
+
37
+ You need [uv](https://docs.astral.sh/uv/getting-started/installation/), [Claude Desktop](https://claude.ai/download),
38
+ an Instagram **Business or Creator** account linked to a **Facebook Page**, and your own Meta app
39
+ ([5-minute guide](https://github.com/pandich93/creatorloop/blob/main/docs/meta-setup.md)).
40
+
41
+ ```bash
42
+ uvx --from creatorloop creatorloop-setup # 1. connect to Claude Desktop, create the settings file
43
+ ```
44
+
45
+ 2. Put your app's `META_APP_ID` and `META_APP_SECRET` into the settings file the command printed.
46
+ 3. Save a 60-day token and find your account ID (the short-lived token comes from Graph API Explorer, see the guide):
47
+
48
+ ```bash
49
+ uvx --from creatorloop creatorloop-auth exchange --short-token <TOKEN> --write
50
+ uvx --from creatorloop creatorloop-auth whoami --write
51
+ uvx --from creatorloop creatorloop-auth check # → OK: @your_account followers=...
52
+ ```
53
+
54
+ Restart Claude Desktop and ask: *"How did my last 10 posts do, and what should I post next?"*
55
+
56
+ <details>
57
+ <summary>Installing uv</summary>
58
+
59
+ | System | Command |
60
+ |---|---|
61
+ | Windows | `powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 \| iex"` |
62
+ | macOS | `brew install uv` or `curl -LsSf https://astral.sh/uv/install.sh \| sh` |
63
+ | Linux | `curl -LsSf https://astral.sh/uv/install.sh \| sh` |
64
+
65
+ uv downloads Python 3.14 by itself if you don't have it.
66
+ </details>
67
+
68
+ `creatorloop-setup` finds the Claude Desktop config on Windows (including the Microsoft Store build), macOS and Linux,
69
+ keeps your other servers, makes a backup and creates your settings file. Claude Desktop rewrites its config while it
70
+ runs, so on macOS the command quits and reopens it for you; on Windows and Linux it asks you to quit it first.
71
+
72
+ ## What you can ask
73
+
74
+ - "Make a report on my content for the last 60 days. Reels or carousels — what works better, and when should I post?"
75
+ - "Compare me with @competitor1 and @competitor2. Who has the higher engagement and why?"
76
+ - "Analyse this post https://www.instagram.com/p/… and write my own version of it."
77
+ - "Track @competitor and tell me every week which of their posts took off."
78
+ - "Check the hashtags #ai, #productivity and #startup. Check the quota first."
79
+ - "Queue the post from folder `my-first-reel` for the next free slot." → preview → "yes" → it goes out on time.
80
+ - "Which new comments haven't I answered? Draft replies." → you approve each reply.
81
+
82
+ Ready-made prompts in Claude Desktop's **+** menu: *Weekly Instagram report*, *Competitor brief*, *Data-driven content ideas*.
83
+
84
+ ## Tools
85
+
86
+ | Area | Tools |
87
+ |---|---|
88
+ | Your account | `get_my_profile`, `get_my_media`, `get_media_insights`, `get_account_insights`, `get_audience_demographics` |
89
+ | Content analysis | `get_my_content_report`, `get_caption_insights`, `get_post_history`, `post_reviews` |
90
+ | Competitors | `get_competitor`, `compare_accounts`, `get_follower_history`, `track_competitor`, `untrack_competitor`, `list_tracked_competitors`, `update_tracked_competitors`, `find_viral_posts`, `get_competitor_post` |
91
+ | Hashtags | `search_hashtag`, `compare_hashtags`, `plan_hashtag_research` |
92
+ | Publishing | `prepare_post`, `get_post_job`, `publish_media`, `list_publications` |
93
+ | Queue | `queue_post`, `list_queue`, `cancel_queued` |
94
+ | Comments | `get_new_comments`, `reply_comment` |
95
+ | Service | `get_api_status`, `clear_cache`, `restart_server` |
96
+
97
+ 33 tools in total. Tools that change something on Instagram are annotated as such for Claude, and their descriptions
98
+ tell it to act only after you approve: `publish_media` and `reply_comment` after you OK the preview or the exact
99
+ text, `queue_post` only with `confirm=true` after you saw the preview.
100
+
101
+ ## Publishing
102
+
103
+ Put the files into a folder inside your **content folder** (`<creatorloop home>/content/<name>/`):
104
+
105
+ ```
106
+ my-carousel/ my-reel/
107
+ slide_01.png … slide_10.png reel.mp4 # H.264/HEVC, 23–60 fps, ≤1920 px wide, 3 s–15 min, ≤300 MB
108
+ caption.txt caption.txt
109
+ reel.json # optional: {"cover_ms": 1667, "share_to_feed": true, "trial": "SS_PERFORMANCE"}
110
+ ```
111
+
112
+ - Slides: 1–10 PNG/JPG (API limit), aspect ratio 4:5 to 1.91:1, ordered by file name. Everything below a `---` line in
113
+ `caption.txt` is notes and is not published.
114
+ - Then: "prepare the post from folder `my-carousel`" → preview → "publish". Or queue it for a slot.
115
+ - Carousels: Instagram downloads images from a public URL, so creatorloop opens a temporary
116
+ [Cloudflare Quick Tunnel](https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/do-more-with-tunnels/trycloudflare/)
117
+ for that minute. Install `cloudflared` once: `winget install --id Cloudflare.cloudflared -e` (Windows),
118
+ `brew install cloudflared` (macOS) or a package from [pkg.cloudflare.com](https://pkg.cloudflare.com/index.html) (Linux).
119
+ - Reels upload directly to Meta (no tunnel). The MP4 header is checked before upload (duration, size, width,
120
+ `moov` first) with the exact `ffmpeg` fix if something is off.
121
+ - Queue slots default to Tue/Thu/Sun 19:00 in your timezone — an example, change `QUEUE_SLOTS` in the settings file.
122
+ A queued post is blocked if its files or caption change after you approved it, and is marked missed if your
123
+ computer was asleep for more than 3 hours past the slot.
124
+ - Meta's limit is 100 posts per rolling 24 hours; `list_publications` shows what is left. Publishing is never retried
125
+ automatically, so there are no duplicates.
126
+
127
+ Making the content itself: see [`examples/`](https://github.com/pandich93/creatorloop/blob/main/examples) and the [content pipeline](https://github.com/pandich93/creatorloop/blob/main/docs/content-pipeline.md) —
128
+ a sample carousel, a sample Reel storyboard and the Remotion Reel template.
129
+
130
+ ## What the Instagram API allows (and doesn't)
131
+
132
+ | | Possible | Not possible |
133
+ |---|---|---|
134
+ | **Your account** | Reach, views, likes, comments, saves, shares, profile visits, follows per post, Reels average watch time, audience demographics, account totals | Data older than 2 years; insights per carousel slide; Stories after 24 h |
135
+ | **Competitors** (Business Discovery) | Public data of Business/Creator accounts: followers, posts, bio, likes, comments, Reels views per post | Personal or private accounts; their reach, saves, shares, demographics; Stories |
136
+ | **Hashtags** | Top posts and posts from the last 24 h | More than **30 unique hashtags per rolling 7 days**; post authors; keyword, audio or trend search |
137
+ | **Follower growth** | creatorloop saves a daily snapshot for you and every competitor you look at | History before the first snapshot |
138
+
139
+ Engagement rate for your posts = Σ(likes + comments + saves + shares) / Σreach × 100 (weighted, so tiny posts don't
140
+ skew it). Posts younger than 72 h are reported separately as "still growing". Competitors' ER is per follower — the
141
+ API does not expose their reach.
142
+
143
+ ## Settings
144
+
145
+ `creatorloop-setup` creates `.env` in your creatorloop home folder:
146
+
147
+ | System | Home folder |
148
+ |---|---|
149
+ | Windows | `%APPDATA%\creatorloop` |
150
+ | macOS | `~/Library/Application Support/creatorloop` |
151
+ | Linux | `~/.local/share/creatorloop` (or `$XDG_DATA_HOME/creatorloop`) |
152
+
153
+ Set `CREATORLOOP_HOME` to use another folder. The home folder holds `.env`, the `creatorloop.db` database and the
154
+ `content/` folder.
155
+
156
+ | Variable | Required | Meaning |
157
+ |---|---|---|
158
+ | `IG_ACCESS_TOKEN` | yes | Long-lived (60 days) or System User (never expires) token — see [Meta setup](https://github.com/pandich93/creatorloop/blob/main/docs/meta-setup.md) |
159
+ | `IG_USER_ID` | yes | Your Instagram professional account ID (`1784…`), not the username |
160
+ | `GRAPH_API_VERSION` | no | Default `v26.0` |
161
+ | `META_APP_ID`, `META_APP_SECRET` | no | Only for `creatorloop-auth exchange` |
162
+ | `IG_TIMEZONE` | no | IANA name, e.g. `Europe/Berlin`. Default: your computer's timezone |
163
+ | `QUEUE_SLOTS` | no | e.g. `Mon,Wed,Fri 20:00` |
164
+ | `IG_DB_PATH`, `CACHE_TTL_*_MIN` | no | Database location, cache lifetime in minutes |
165
+
166
+ The token expiry shows up in `get_api_status`, and every tool answer carries a `token_warning` 14 days before expiry.
167
+
168
+ ## FAQ
169
+
170
+ <details><summary>Does it work with a personal Instagram account?</summary>
171
+ No. Meta's API only serves Business and Creator accounts linked to a Facebook Page. Switching is free:
172
+ Instagram → Settings → Account type and tools.
173
+ </details>
174
+
175
+ <details><summary>Do I need Meta App Review?</summary>
176
+ Not for your own account: keep the app in Development mode, you are its admin. Hashtag search may require the
177
+ "Instagram Public Content Access" feature for some accounts — creatorloop tells you if Meta refuses it.
178
+ </details>
179
+
180
+ <details><summary>Can it get my account banned?</summary>
181
+ creatorloop uses only the official Graph API with your own app and token, within Meta's rate limits. It does no
182
+ scraping and no browser automation.
183
+ </details>
184
+
185
+ <details><summary>Which AI clients does it work with?</summary>
186
+ It is a standard MCP server (stdio). It is developed and tested with Claude Desktop; other MCP clients that support
187
+ stdio servers should work too.
188
+ </details>
189
+
190
+ <details><summary>A metric is missing in the answer.</summary>
191
+ Meta regularly removes metrics (e.g. `impressions` and `plays` in April 2025, replaced by `views`). creatorloop
192
+ moves a refused metric to `unavailable` instead of failing and stops asking for it for 7 days. Insights can lag up to 48 h.
193
+ </details>
194
+
195
+ ## Data & privacy
196
+
197
+ - Your token, settings, database and content stay on your computer in the creatorloop home folder.
198
+ - creatorloop talks to Meta only: the Instagram Graph API (`graph.facebook.com`, `rupload.facebook.com` for video
199
+ uploads) and Instagram's media servers when it downloads the slides of a post you asked it to analyse.
200
+ - To publish carousels (and Reels, if the direct upload is refused) it opens a temporary Cloudflare Quick Tunnel to
201
+ your local files for the minute Meta needs to fetch them, then closes it and deletes the temporary copies.
202
+ - No analytics, telemetry or third-party services.
203
+
204
+ ## Development
205
+
206
+ ```bash
207
+ git clone https://github.com/pandich93/creatorloop && cd creatorloop
208
+ uv sync
209
+ uv run pytest # offline: mocked Graph API and captured response shapes
210
+ uv run creatorloop-setup # points Claude Desktop at this checkout instead of the PyPI package
211
+ ```
212
+
213
+ See [CONTRIBUTING.md](https://github.com/pandich93/creatorloop/blob/main/CONTRIBUTING.md). Security issues: [SECURITY.md](https://github.com/pandich93/creatorloop/blob/main/SECURITY.md).
214
+
215
+ ## Disclaimer
216
+
217
+ creatorloop is an independent open-source project. **Not affiliated with, endorsed or sponsored by Meta or
218
+ Instagram.** "Instagram" is a trademark of Meta Platforms, Inc. You are responsible for complying with the
219
+ [Meta Platform Terms](https://developers.facebook.com/terms/) and Instagram's policies when you use it.
220
+
221
+ ## License
222
+
223
+ [MIT](https://github.com/pandich93/creatorloop/blob/main/LICENSE). The Reel template in `examples/reel-template` uses [Remotion](https://www.remotion.dev), which has
224
+ its own licence; bundled assets and fonts are listed in
225
+ [`examples/reel-template/public/assets/LICENSES.md`](https://github.com/pandich93/creatorloop/blob/main/examples/reel-template/public/assets/LICENSES.md).
@@ -0,0 +1,34 @@
1
+ # creatorloop
2
+
3
+ **Открытая AI-студия контента для авторов в Instagram на базе Claude и официального Instagram API.**
4
+
5
+ Анализ того, что работает → создание Reels и каруселей → публикация или очередь → разбор результатов через 24 и 72 часа.
6
+ Всё — в чате с Claude.
7
+
8
+ - **Данные вместо догадок:** лучшие и худшие посты с хуками, сравнение форматов, подписки на 1000 охвата,
9
+ время просмотра Reels, лучшие день и час, какие подписи работают.
10
+ - **Конкуренты легально:** отслеживание, история подписчиков, посты, которые набрали в N раз больше медианы,
11
+ разбор любого публичного поста по ссылке.
12
+ - **Создание контента:** шаблон Reels на Remotion с автопроверками, своя музыка, 3D-объекты с лицензиями.
13
+ - **Безопасная публикация:** превью перед каждой публикацией, очередь с защитой от изменённых файлов,
14
+ отчёты через 24/72 часа, ответы на комментарии только после вашего «да».
15
+ - **Только официальный API:** без скрейпинга и риска для аккаунта.
16
+
17
+ ## Быстрый старт
18
+
19
+ Нужны [uv](https://docs.astral.sh/uv/getting-started/installation/), Claude Desktop, аккаунт Instagram типа
20
+ **Business** или **Creator**, привязанная **Facebook-страница** и своё приложение Meta
21
+ ([гайд, на английском](docs/meta-setup.md)).
22
+
23
+ ```bash
24
+ uvx --from creatorloop creatorloop-setup
25
+ uvx --from creatorloop creatorloop-auth exchange --short-token <ТОКЕН> --write
26
+ uvx --from creatorloop creatorloop-auth whoami --write
27
+ ```
28
+
29
+ Перед второй командой впишите `META_APP_ID` и `META_APP_SECRET` в файл настроек, путь к которому покажет первая.
30
+ Перезапустите Claude Desktop и спросите: *«Как зашли мои последние 10 постов и что мне публиковать дальше?»*
31
+
32
+ Полная документация — в [README на английском](README.md).
33
+
34
+ Независимый open source проект, не связан с Meta и Instagram. Лицензия [MIT](LICENSE).
@@ -0,0 +1,34 @@
1
+ # creatorloop
2
+
3
+ **Instagram mualliflari uchun ochiq kodli AI kontent studiyasi: Claude va rasmiy Instagram API asosida.**
4
+
5
+ Nima ishlayotganini tahlil qilish → Reels va karusellar yaratish → joylash yoki navbatga qoʻyish →
6
+ 24 va 72 soatdan keyin natijani koʻrib chiqish. Hammasi Claude bilan suhbatda.
7
+
8
+ - **Taxmin emas, raqamlar:** eng yaxshi va eng yomon postlar birinchi qatori (hook) bilan, formatlar taqqoslash, har 1000 qamrovga
9
+ obunachilar, Reels koʻrish vaqti, eng yaxshi kun va soat, qaysi izohlar (caption) ishlaydi.
10
+ - **Raqobatchilar — qonuniy:** kuzatish, obunachilar tarixi, akkaunt medianasidan N barobar koʻp yigʻgan postlar,
11
+ istalgan ochiq postni havola orqali tahlil qilish.
12
+ - **Kontent yaratish:** Remotion asosidagi Reels shabloni, avtomatik tekshiruvlar, oʻz musiqasi, litsenziyali 3D obyektlar.
13
+ - **Xavfsiz joylash:** har bir postdan oldin koʻrib chiqish (preview), oʻzgargan fayllardan himoyalangan navbat,
14
+ 24/72 soatlik hisobotlar, izohlarga javob — faqat sizning roziligingizdan keyin.
15
+ - **Faqat rasmiy API:** skreyping yoʻq, akkaunt uchun xavf yoʻq.
16
+
17
+ ## Tez boshlash
18
+
19
+ Kerak boʻladi: [uv](https://docs.astral.sh/uv/getting-started/installation/), Claude Desktop, **Business** yoki
20
+ **Creator** turidagi Instagram akkaunt, unga ulangan **Facebook sahifa** va oʻzingizning Meta ilovangiz
21
+ ([qoʻllanma, ingliz tilida](docs/meta-setup.md)).
22
+
23
+ ```bash
24
+ uvx --from creatorloop creatorloop-setup
25
+ uvx --from creatorloop creatorloop-auth exchange --short-token <TOKEN> --write
26
+ uvx --from creatorloop creatorloop-auth whoami --write
27
+ ```
28
+
29
+ Ikkinchi buyruqdan oldin birinchi buyruq koʻrsatgan sozlamalar fayliga `META_APP_ID` va `META_APP_SECRET` ni yozing.
30
+ Claude Desktop'ni qayta ishga tushiring va soʻrang: *«Oxirgi 10 ta postim qanday ketdi va keyin nima joylashim kerak?»*
31
+
32
+ Toʻliq hujjatlar — [ingliz tilidagi README](README.md)da.
33
+
34
+ Mustaqil ochiq kodli loyiha, Meta va Instagram bilan bogʻliq emas. Litsenziya: [MIT](LICENSE).