Instagram API: Get engagement stats
Gets an Instagram account's follower count plus its posting and engagement over the last 30 days: posts published, average views of its videos and reels, and average likes and comments per post, from a username or profile link.
Unofficial. Not affiliated with or endorsed by Instagram.
Inputs
No run is shown, so each box holds the field’s default.
- Username, required
username Instagram account name, @name, or profile link, for example cricketwithsawan or https://www.instagram.com/cricketwithsawan
Not set
Input as JSON
{}Output
No run of this method is shown here. Its output schema, under Schema, lists what it returns.
Run it in StudioCode
curl https://api.fous.com/v1/runs \ -H "Authorization: Bearer $FOUS_API_KEY" \ -H "Content-Type: application/json" \ -d '{"method":"instagram.com/get_engagement_stats_2","input":{}}' # Save as fous.py, then run: python3 fous.pyimport json, os, timefrom urllib.error import HTTPErrorfrom urllib.request import Request, urlopenAPI = "https://api.fous.com/v1/runs" KEY = os.environ["FOUS_API_KEY"]HEADERS = { "Authorization": f"Bearer {KEY}", "Content-Type": "application/json" ,}def call(url, body=None): data = json.dumps(body).encode() if body else None request = Request(url, data, HEADERS) try: with urlopen(request, timeout=120) as r: return r.status, json.load(r) except HTTPError as error: message = json.load(error)["error"]["message"] raise RuntimeError(message) from errorstatus, run = call(API, { "method": "instagram.com/get_engagement_stats_2" , "input": {}})# 202: still going after 30 s. Ask again until it ends.while status == 202: time.sleep(2) status, run = call(f"{API}/{run['id']}")print(json.dumps(run["data"], indent=2))// Save as fous.mjs, then run: node fous.mjsconst api = "https://api.fous.com/v1/runs" ;const headers = { Authorization: `Bearer ${process.env.FOUS_API_KEY}`, "Content-Type": "application/json" ,};let response = await fetch(api, { method: "POST", headers, body: JSON.stringify({ "method": "instagram.com/get_engagement_stats_2" , "input": {} }), signal: AbortSignal.timeout(120_000),});let run = await response.json();// 202: still going after 30 s. Ask again until it ends.while (response.status === 202) { await new Promise((done) => setTimeout(done, 2_000)); response = await fetch(`${api}/${run.id}`, { headers }); run = await response.json();}if (!response.ok) throw new Error(run.error.message);console.log(run.data);# Connect your agent to Fous once, over MCP (Streamable HTTP):# https://api.fous.com/mcp# Set FOUS_API_KEY first: create a key at https://app.fous.com/keys.# Claude Codeclaude mcp add \ --scope user \ --transport http fous https://api.fous.com/mcp \ --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"# Codexcodex mcp add fous \ --url https://api.fous.com/mcp \ --bearer-token-env-var FOUS_API_KEY# Cursor, VS Code, Windsurf, Cline and morenpx -y add-mcp https://api.fous.com/mcp -g -n fous \ --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"# Then ask your agent:# "Use Fous to run instagram.com/get_engagement_stats_2# with {}"Over HTTP, the answer’s data holds the output. A run still going after 30 seconds answers 202 with its id: ask GET /v1/runs/{id} until it ends.
Schema
Input schema
{ "type": "object", "required": [ "username" ], "properties": { "username": { "type": "string", "description": "Instagram account name, @name, or profile link, for example cricketwithsawan or https://www.instagram.com/cricketwithsawan" } }, "additionalProperties": false}Output schema
{ "type": "object", "required": [ "username", "full_name", "profile_link", "followers", "posts_last_30_days", "avg_views_30_days", "avg_likes", "avg_comments", "videos_with_views", "is_private", "period_start", "period_end" ], "properties": { "username": { "type": "string", "description": "Account username." }, "avg_likes": { "type": [ "integer", "null" ], "description": "Average likes per post over the last 30 days (平均点赞数)." }, "followers": { "type": [ "integer", "null" ], "description": "Followers (粉丝数量)." }, "full_name": { "type": [ "string", "null" ], "description": "Account display name." }, "is_private": { "type": "boolean", "description": "Whether the account is private (post stats unavailable)." }, "period_end": { "type": "string", "format": "date", "description": "Last day of the 30-day window (today)." }, "avg_comments": { "type": [ "integer", "null" ], "description": "Average comments per post over the last 30 days (平均评论数)." }, "period_start": { "type": "string", "format": "date", "description": "First day of the 30-day window." }, "profile_link": { "type": "string", "description": "Instagram profile link." }, "avg_views_30_days": { "type": [ "integer", "null" ], "description": "Average views of videos and reels posted in the last 30 days (近30天平均播放量)." }, "videos_with_views": { "type": [ "integer", "null" ], "description": "Number of videos and reels the view average is based on." }, "posts_last_30_days": { "type": [ "integer", "null" ], "description": "Posts published in the last 30 days (近30天发布数)." } }, "additionalProperties": false}- Price
- 1 credit per completed run (1¢ with pay as you go); failed runs are free.
- Method
instagram.com/get_engagement_stats_2- Returns
- username, full name, profile link, followers, posts in the last 30 days, average views, likes and comments, private flag, period
Use it from your agent
Give your agent this line. It reads SKILL.md, gets a Fous API key and connects the Fous MCP server. Its run then takes the method instagram.com/get_engagement_stats_2 with the inputs above.
Ask your agent
- How many followers does @nasa have, and what are their average likes and comments per post this past month?
- Pull the last 30 days of engagement for https://www.instagram.com/glossier — post count, average reel views, likes and comments.
- I'm vetting an influencer, the fitness creator kaylaitsines. How often has she posted recently and what kind of engagement is she getting?
- Check whether the account chefjoseandres is private and give me its follower total plus average views on recent videos.
- On Instagram, how active has @bonappetitmag been over the last month? I need the number of posts and average interactions per post.
See more
All Instagram methodsGets an Instagram account's public profile from its username, @name or profile link: name, bio, exact follower, following and post counts, verified and private flags, first bio link, profile picture and account ID.
instagram.com/get_profileLists the latest publicly embeddable posts and reels from an Instagram account, newest first. Without login Instagram may show fewer posts than requested. View counts that are not available are null.
instagram.com/list_recent_postsLooks up public Instagram account totals, engagement and grade on Social Blade by handle or profile link. Daily history and 30-day follower change need a Social Blade sign-in, so they are not returned.
socialblade.com/get_instagram_statsGets a TikTok creator's public profile and totals (followers, following, likes, videos) from a username, @handle or profile link. Profiles not visible to public visitors cannot be returned.
tiktok.com/get_profileGets a TikTok creator's Social Blade profile totals, grade when shown, 30-day follower and like changes, and up to 14 days of daily totals, from a TikTok handle or a TikTok or Social Blade profile link. Counts reflect Social Blade's recorded and sometimes rounded figures.
socialblade.com/get_tiktok_statsLists an account's latest public Threads posts, newest first, with text, engagement counts, thumbnails and links. Only posts shown without logging in are returned.
threads.com/list_recent_postsGets a public Pinterest profile and its visible boards in profile order. Monthly views are null when Pinterest does not show them.
pinterest.com/get_profileGets the public X profile for a username or profile link, including counts, verification, images and account details. Does not include posts or a timeline.
x.com/get_profile