How to get an Instagram followers count with an API
Updated 2026-10-24
If you only need the number of followers — not the list of who they are — you do not need to page through a follower list. One profile request returns follower_count, following_count and media_count. This guide shows that call, then builds a small script that records the count every day so you can chart growth.
Count vs. list: pick the right endpoint
- Follower count → /api/user/info. One request per account, returns the number directly.
- Follower list → /api/user/followers. Paginated, one request per page. Use it only when you need the actual accounts.
For dashboards, influencer vetting or growth tracking, the count is almost always what you want, and it costs a fraction of the requests.
Get the follower count
curl -s -H "X-Api-Key: sk_live_your_key_here" \
"https://api.instagapi.com/api/user/info?username_or_id=nike" \
| jq '.data.follower_count'follower_count is an exact integer, not the rounded "302M" shown in the Instagram app, so you can compare values day by day.
Track follower growth every day
Save the script below as track_followers.py. Each run appends one row per account to followers.csv with the date and the three counts.
import csv, datetime, os, time, requests
API_KEY = os.environ["INSTAGAPI_KEY"]
ACCOUNTS = ["nike", "adidas", "puma"]
OUT = "followers.csv"
new_file = not os.path.exists(OUT)
with open(OUT, "a", newline="") as f:
writer = csv.writer(f)
if new_file:
writer.writerow(["date", "username", "followers", "following", "posts"])
today = datetime.date.today().isoformat()
for username in ACCOUNTS:
res = requests.get(
"https://api.instagapi.com/api/user/info",
params={"username_or_id": username},
headers={"X-Api-Key": API_KEY},
timeout=60,
)
if res.status_code != 200:
print(username, "->", res.status_code)
continue
d = res.json()["data"]
writer.writerow([today, username, d["follower_count"],
d["following_count"], d["media_count"]])
time.sleep(2)Run it once a day with cron:
# every day at 06:00
0 6 * * * cd /path/to/script && INSTAGAPI_KEY=sk_live_your_key_here python3 track_followers.pyTurn the CSV into growth numbers
import pandas as pd
df = pd.read_csv("followers.csv", parse_dates=["date"])
pivot = df.pivot_table(index="date", columns="username", values="followers")
print(pivot.diff().tail(7)) # daily gain per account
print((pivot.iloc[-1] / pivot.iloc[0] - 1) * 100) # % growth over the periodHow many requests does this use?
One request per account per run. Tracking 3 accounts daily uses about 90 requests a month. The free plan (30 requests a month) covers one account checked daily; the Pro plan (3,000 a month) covers about 100.
Common questions
- Private accounts: follower_count is still returned, with is_private set to true.
- Renamed accounts: store the pk (numeric user ID) from the first response and query by it, so a username change does not break your tracking.
- Accuracy: the value is what Instagram reports at request time. Large accounts can move by thousands between two calls.
Related
Try it with a free API key
Create a free account, copy your key into the examples above, and make your first request in minutes. No credit card required.