From Python, the call is a single requests.post to https://api.routergrowth.com/v1/run with your key in the Authorization header and a body naming social.posts, the platform and the handle. The JSON that comes back holds the posts, the run_id and what was charged, ready for a DataFrame or a CSV.
Ask your agent
Write a Python script that pulls the last 20 Instagram posts for each handle in brands.csv and saves them to posts.csv.
Connect RouterGrowth once, then ask in plain words. New workspaces start with $1 of credit. Get a key or read the setup guide.
A real run
One call to social.posts (social posts & content), run through RouterGrowth on October 19, 2026. These are the first rows it returned; fields that name a person are masked.
| created_at | text | likes | replies | views | is_video |
|---|---|---|---|---|---|
| 2026-06-09 | Meet Vanilla Bean, our newest limited-edition flavor of ceramic cookware. A warm, never-boring neutral, it’s a classic for a reason. Don’t… | 1561 | 289 | False | |
| 2025-09-30 | ✨ Meet the newest member of the Wonder Oven family: the Pro ✨All the wonder you love - air frying, steam infusion, non-toxic materials - no… | 5820 | 1708 | False | |
| 2026-04-13 | Something’s in the air… a new way to cook your grains. Launching tomorrow, 4/14. | 3289 | 730 | 85297 | True |
Five posts from the public Our Place account, as the script would receive them: product launches with like, reply and view counts.
Step by step
Store ROUTERGROWTH_API_KEY as an environment variable and send it as Authorization: Bearer. No Meta app, no OAuth flow.
requests.post to /v1/run with a JSON body: capability social.posts, input with platform, handle and limit, and routing.max_cost as a ceiling.
Loop over response.json()['result']['posts']. Each item has url, text, created_at and engagement with likes, replies and views.
Add the header on retries so a script that runs twice does not pay twice for the same request.
Price
List prices on Instagram, read from the catalog when this page was built. The exact figure is quoted before every run, and a monthly plan lowers it.
In practice
You describe the job; the agent picks the calls, shows the price and runs them.
Write a Python script that pulls the last 20 Instagram posts for each handle in brands.csv and saves them to posts.csv.
Extend the script: for every post with more than 500 replies, fetch the comments and count the questions.
Connect
One MCP server for Claude, ChatGPT, Claude Code, Codex and Cursor, or the same call over the CLI and REST with the input above.
claude mcp add --transport http routergrowth https://api.routergrowth.com/mcp
npm install -g routergrowth && routergrowth setup
routergrowth run -c social.posts -i '{"platform": "instagram", "handle": "ourplace", "limit": 5}'curl -X POST https://api.routergrowth.com/v1/run \
-H "Authorization: Bearer $ROUTERGROWTH_API_KEY" \
-d '{"capability": "social.posts", "input": {"platform": "instagram", "handle": "ourplace", "limit": 5}}'Worth knowing
The same /v1/run call reads TikTok, LinkedIn or YouTube posts by changing platform. The record shape stays the same.
A short run returns its result in the response. Longer runs return a run_id to poll at /v1/runs/<id>.
There is no Instagram SDK to install and no Meta token. RouterGrowth reads public posts independently of Meta.
FAQ
Not needed. The REST call works with requests or httpx, and the CLI covers shell scripts.
A JSON object with run_id, status, billing and result.posts. Each post has id, url, text, created_at, author, engagement and is_video.
Put routing.max_cost in each request. A run whose quote is above it is refused before it bills.
Yes. Cron or any scheduler can call the same endpoint; for repeated reads, watch returns only what changed since the last call.
More on Instagram
Reading this as an agent? This page as markdown: /tools/instagram/api-python.md
Connect your agent once. The first calls run on the $1 that comes with signup.