Skip to content
ScrapeField

Blog · Guides ·

An Instagram account’s engagement rate, from its posts

Followers can be bought; likes and comments on recent posts are harder to fake. Two calls give an account’s followers and its last 24 posts, and a median turns them into one number you can compare across creators.

ScrapeField

An Instagram account’s follower count says how many people could see a post. Its engagement rate says how many did something about it, which is what a sponsor is paying for. This guide works it out for any public account from two calls, with no Instagram login of yours.

Two calls

GET /v1/instagram/profile gives the account’s followers_count. GET /v1/instagram/posts gives its recent posts and Reels, up to 24 a call, each with like_count, comments_count, view_count for a Reel, media_product_type and is_paid_partnership:

curl -H "Authorization: Bearer $SCRAPEFIELD_KEY" \
  "https://api.scrapefield.com/v1/instagram/posts?username=ferrari"

The two together cost 6 credits an account, from our cache or not: about $4.68 per 1,000 accounts on the smallest pack and $2.64 on the largest. A call that fails costs nothing.

One number

For each post, likes plus comments over followers; then the median across the posts, so one post that went viral does not decide it. A post whose owner hid its likes has like_count null: leave it out rather than count it as zero. In TypeScript:

const headers = { Authorization: `Bearer ${process.env.SCRAPEFIELD_KEY}` };
const base = 'https://api.scrapefield.com/v1/instagram';
const get = async (path: string) => {
  const res = await fetch(`${base}/${path}`, { headers });
  const body = await res.json();
  if (!res.ok) throw new Error(body.error.message);
  return body.data;
};
const account = await get('profile?username=ferrari');
const recent = await get('posts?username=ferrari&limit=24');
const followers = account.followers_count ?? 0;
const rates = recent
  .filter((p) => p.like_count !== null && followers > 0)
  .map((p) => (p.like_count + (p.comments_count ?? 0)) / followers)
  .sort((a, b) => a - b);
const median = rates.length ? rates[Math.floor(rates.length / 2)] : null;
console.log(median === null ? 'no visible likes' : `${(median * 100).toFixed(2)}%`);

And in Python:

import os, requests, statistics

headers = {"Authorization": f"Bearer {os.environ['SCRAPEFIELD_KEY']}"}
base = "https://api.scrapefield.com/v1/instagram"

def get(path, **params):
    body = requests.get(f"{base}/{path}", params=params, headers=headers).json()
    if "error" in body:
        raise RuntimeError(body["error"]["message"])
    return body["data"]

account = get("profile", username="ferrari")
recent = get("posts", username="ferrari", limit=24)
followers = account["followers_count"] or 0
rates = [
    (p["like_count"] + (p["comments_count"] or 0)) / followers
    for p in recent
    if p["like_count"] is not None and followers > 0
]
print(f"{statistics.median(rates) * 100:.2f}%" if rates else "no visible likes")

Reading it

Compare accounts of about the same size: the rate falls as an account grows, so a creator with 20,000 followers and one with 2 million are not on one scale. Split the posts by media_product_type, since Reels reach people who do not follow the account; for a Reel, view_count over followers says how far past the followers it went. And check is_paid_partnership: a creator’s sponsored posts against the others is the number a sponsor wants.

For many creators at once, account search finds them by keyword, and a hashtag leads to more. For a list of accounts, run both calls for each, several side by side, up to your limit of calls at once.

More articles