Who an account starts following is a public signal: a brand following a creator before a campaign, an investor following a founder, a label following an artist. Instagram shows the list but not the dates, so the only way to see a new follow is to remember the list and compare it later. That comparison is where it goes wrong: read the same list twice in a minute and you get two different lists.
This guide builds a tracker that copes with that. It checks each account's following count with one call, reads the whole list only when the count moved, and reports an account as newly followed only when the count backs it up. Every response, number and output below is real, collected through ScrapingBot on November 17, 2026, plus one list we had saved on October 27.
Before you start
- A ScrapingBot API key. Create a free account for 100 credits: enough to start watching a small account and check it 18 times. No card needed.
- Python 3.9 or newer and
pip install requests. State is kept in SQLite, which ships with Python. - Public accounts to watch. A private account's following list isn't available.
Instagram gives a count and a list, never a date
Meta's Instagram API exposes follows_count for business and creator accounts, and none of its edges lists the accounts behind that number (checked November 2026). The list is visible in Instagram itself, and /following/by_user_id returns it as JSON. Neither says when a follow happened, so a tracker has to keep its own memory.
One page of a following list
Every Instagram call is a POST to https://scrapingbot.io/api/v1/instagram. Send the account in user_id: the numeric ID, or the username, which is looked up within the same call and charge.
curl -X POST https://scrapingbot.io/api/v1/instagram \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"endpoint": "/following/by_user_id", "params": {"user_id": "lancehedrick"}}'
The first page of the accounts coffee educator Lance Hedrick follows, trimmed to one of its 46:
{
"success": true,
"data": {
"users": [
{
"id": "1196670086",
"username": "homebaristabelgium",
"full_name": "Home Barista ® Webstore",
"is_private": false,
"is_verified": false,
"latest_reel_media": 0,
"profile_pic_url": "https://scontent-arn2-1.cdninstagram.com/v/t51.2885-19/…",
…
},
…
],
"user_count": 1309,
"page_size": 46,
"has_more": true,
"next_max_id": "QVHYlZ7Il7qmSgAAAC4PS1PRCmS-YzA5",
"should_limit_list_of_followings": false,
"status": "ok",
…
},
"duration": "3.44",
"statusCode": 200,
"creditsUsed": 5
}
| Field | What it is |
|---|---|
users[].id | The followed account's numeric ID. It survives a change of username, so it is the key for everything the tracker stores. |
username, full_name | The handle and display name. full_name can be empty. |
is_private, is_verified | Whether the followed account is private, and whether it has the verified badge. |
user_count | How many accounts the profile follows in all. It is on every page, it matched the profile's following_count each time we compared, and the tracker leans on it. |
has_more, next_max_id | Whether another page exists, and the cursor to send back as max_id to get it. A page usually holds 50 accounts; the first can hold a few fewer and the last a few more. |
should_limit_list_of_followings | false on every following list we looked at. If it is ever true, Instagram ignores query searches on that list. |
What reading a list twice tells you
Before writing the tracker we read the same lists over and over. Lance Hedrick follows 1,309 accounts and James Hoffmann 1,124, and we still had both lists from the followers export guide, saved three weeks earlier. Four things came out of it.
1. The order is different on every call. Two reads of Lance Hedrick's list two minutes apart put the same account in the same place for 206 of 1,305 positions. And new follows aren't at the top: the 39 accounts in today's list that weren't in the October 27 one sat anywhere from the 22nd place to the 1,130th. Reading page 1 and calling it "the latest follows" doesn't work.
2. Every read leaves some accounts out, and not always the same ones.
| List (Instagram's count) | Accounts returned by each full read |
|---|---|
| @lancehedrick (1,309) | 1,305, 1,306, 1,309 within four minutes; 1,306 and 1,309 later in the hour |
| @jimseven (1,124) | 1,123, 1,123, 1,112 within four minutes; 1,110 and 1,111 half an hour later; 1,124 after another half hour |
| @techcrunch (114) | 91, then 114 thirty minutes later |
| @canva (1,410) | 1,374, then 1,393; one read stopped early after 22 pages, at about 1,000 |
| @shopify (1,700) | 1,658, then 1,698 |
| @figma (19), @wired (76) | All of them, both times |
The accounts left out were still followed: we checked. Several were dormant, among them a food magazine that closed in 2017.
3. So a plain comparison invents follows. Compare James Hoffmann's third read with his first and you get "12 new follows" in three minutes. The count said 1,124 the whole time.
4. The count holds still, and search sees what a read leaves out. user_count was the same on every read above, whatever the list held. And adding query to the call searches the whole list by name: of 14 accounts one read of James Hoffmann's list left out, a search for each handle found all 14. Search has gaps of its own, though. On a sample of 70 accounts from Lance Hedrick's list it found 69 by handle (the miss, a handle with a dot in it, turned up when we searched for its longest word), and once five searches came back empty for accounts that the same searches found six minutes later.
That gives the tracker its three rules:
- Remember every account ever seen, not just the last read. An account left out of one read is then never mistaken for a new one later.
- Let the count referee. Check it first, for the price of one page, and read the list only when it moved. An account you haven't seen before is news only as far as the count rose.
- Believe "it's there" at once and "it's gone" slowly. An account in a list is followed. An account missing from a list, or from one search, proves nothing yet.
The script
Save this as ig_watch.py. add starts watching accounts and stores who they follow today. check (the default) reads page 1 of each list, stops there when the count hasn't moved, and otherwise reads the rest and records the new follows, which end up in new_follows.csv.
import csv
import os
import sqlite3
import sys
import time
from datetime import datetime, timezone
import requests
API = "https://scrapingbot.io/api/v1/instagram"
HEADERS = {"x-api-key": "YOUR_API_KEY"}
DB, OUT = "ig_watch.db", "new_follows.csv"
FIELDS = ["detected_at", "account", "event", "username", "full_name", "verified", "private", "user_id"]
calls = 0
class Stop(Exception):
"""Why a call gave up. Nothing is recorded for the account being checked."""
def call(endpoint, params, tries=4):
"""One Instagram call: 5 credits on success. Failed calls are refunded."""
global calls
error = None
for attempt in range(tries):
try:
res = requests.post(API, headers=HEADERS, timeout=60,
json={"endpoint": endpoint, "params": params})
body = res.json()
except (requests.RequestException, ValueError) as err: # no answer, or not JSON
error = err
else:
if body.get("success"):
calls += 1
return body["data"]
if res.status_code in (400, 401, 402, 404): # retrying will not help
raise Stop(f"{res.status_code} {body.get('error')}")
error = body.get("error")
time.sleep(2 ** attempt) # 408, 429, 5xx or a network error: wait and try again
raise Stop(f"kept failing: {error}")
def listing(account_id, first=None):
"""One pass over the following list, as {id: account}. `first` is page 1 if you already have it."""
data = first or call("/following/by_user_id", {"user_id": account_id})
users = {}
for _ in range(400): # Instagram allows 7,500 followed accounts: about 150 pages
for u in data.get("users", []):
users.setdefault(u["id"], u)
if not data.get("has_more") or not data.get("next_max_id"):
break
data = call("/following/by_user_id", {"user_id": account_id, "max_id": data["next_max_id"]})
return users
def now():
return datetime.now(timezone.utc).strftime("%Y-%m-%d %H:%M:%S")
def safe(text):
"""Names are written by strangers and end up in a spreadsheet: never let one start a formula."""
text = (text or "").replace("\n", " ").strip()
return "'" + text if text[:1] in ("=", "+", "-", "@") else text
def store(db, account_id, users, at):
db.executemany(
"INSERT INTO follows VALUES (?, ?, ?, ?, ?, NULL) ON CONFLICT (account_id, target_id) "
"DO UPDATE SET username = excluded.username, last_seen = excluded.last_seen, not_found = NULL",
[(account_id, u["id"], u["username"], at, at) for u in users])
def add(db, username):
"""Start watching: store everyone the account follows today, so only later follows are news."""
prof = call("/user/by_username", {"username": username})
if prof.get("is_private"):
raise Stop("is private: Instagram lists the following of public accounts only")
users, count, at = listing(prof["id"]), prof.get("following_count") or 0, now()
left_out = max(0, count - len(users)) # counted by Instagram, not shown to us yet
with db:
db.execute("DELETE FROM follows WHERE account_id = ?", (prof["id"],))
db.execute("INSERT OR REPLACE INTO accounts VALUES (?, ?, ?, 0, ?, ?, ?)",
(prof["id"], prof["username"], count, 2 if left_out else 0, left_out, at))
store(db, prof["id"], users.values(), at)
print(f"@{prof['username']}: watching, {len(users):,} of {count:,} followed accounts stored"
+ (f" ({left_out} left out of this pass; the next checks read the list again)" if left_out else ""))
def check(db, acct, full=False):
"""Page 1 says whether the count moved. Only then read the whole list and compare."""
first = call("/following/by_user_id", {"user_id": acct["id"]})
count = first.get("user_count")
if count is None:
print(f"@{acct['username']}: no list (the account is private now); skipped")
return []
if count == acct["count"] and not acct["owed"] and not full:
print(f"@{acct['username']}: {count:,} following, no change")
return []
users, at = listing(acct["id"], first), now()
known = {r[0] for r in db.execute("SELECT target_id FROM follows WHERE account_id = ?", (acct["id"],))}
unseen = [u for i, u in users.items() if i not in known]
# The count is the referee. An account we have not seen before is either one of the new follows the
# count announces (`budget`), or one Instagram counted all along and never showed us (`hidden`).
budget, hidden = count - acct["count"] + acct["short"], acct["hidden"]
event = None if budget <= 0 else "followed" if not hidden and len(unseen) <= budget else "followed?"
rows = [{"detected_at": at, "account": acct["username"], "event": event, "username": u["username"],
"full_name": safe(u.get("full_name")), "verified": str(bool(u.get("is_verified"))),
"private": str(bool(u.get("is_private"))), "user_id": u["id"]} for u in unseen if event]
# When either could explain an unseen account, charge it to `hidden`, so a follow the count
# announced stays owed until an account turns up for it.
old = len(unseen) if budget <= 0 else min(hidden, len(unseen))
hidden, short = max(0, hidden - old), max(0, budget - (len(unseen) - old))
again = short > 0 or hidden > 0 or len(unseen) > max(budget, 0) # the list is worth another pass
owed = 0 if not again else (acct["owed"] - 1 if acct["owed"] else 2)
waiting, short = short, short if owed else 0 # after three passes, stop waiting for them
with db: # one transaction: the list, the count and the news are stored together or not at all
store(db, acct["id"], users.values(), at)
db.executemany("INSERT INTO events VALUES (?, ?, ?, ?, ?, ?, ?, ?)",
[[row[f] for f in FIELDS] for row in rows])
db.execute("UPDATE accounts SET count = ?, short = ?, owed = ?, hidden = ?, passed_at = ? WHERE id = ?",
(count, short, owed, hidden, at, acct["id"]))
print(f"@{acct['username']}: {acct['count']:,} -> {count:,} following, {len(unseen)} not seen before")
for row in rows:
print(f" {row['event']} @{row['username']}" + (f" ({row['full_name']})" if row["full_name"] else ""))
if unseen and budget <= 0:
print(f" the count did not rise: they were followed all along and left out of earlier passes")
elif len(unseen) > budget:
print(f" {len(unseen) - budget} more than the count rose by: as many accounts left the list, "
f"or some of these were followed all along")
elif unseen and acct["hidden"]:
print(f" not certain: Instagram counted {acct['hidden']} followed account"
f"{'s' if acct['hidden'] != 1 else ''} it had never shown, and these could be among them")
elif waiting:
print(f" the count rose by {waiting} more than this pass showed; "
+ ("the next check reads the list again" if owed
else "three passes did not show them, so no longer waiting"))
return rows
def export(db):
"""Rewrite the CSV from the database, so a crash or a failed write never loses a new follow."""
rows = db.execute("SELECT * FROM events ORDER BY rowid").fetchall()
if rows:
with open(OUT + ".tmp", "w", newline="", encoding="utf-8") as f:
csv.writer(f).writerows([FIELDS] + [list(r) for r in rows])
os.replace(OUT + ".tmp", OUT)
if __name__ == "__main__":
db = sqlite3.connect(DB)
db.row_factory = sqlite3.Row
db.execute("CREATE TABLE IF NOT EXISTS accounts (id TEXT PRIMARY KEY, username TEXT, count INTEGER, "
"short INTEGER, owed INTEGER, hidden INTEGER, passed_at TEXT)")
db.execute("CREATE TABLE IF NOT EXISTS follows (account_id TEXT, target_id TEXT, username TEXT, "
"first_seen TEXT, last_seen TEXT, not_found TEXT, PRIMARY KEY (account_id, target_id))")
db.execute("CREATE TABLE IF NOT EXISTS events (detected_at TEXT, account TEXT, event TEXT, username TEXT, "
"full_name TEXT, verified TEXT, private TEXT, user_id TEXT)")
command, args = (sys.argv[1:2] or ["check"])[0], sys.argv[2:]
found = []
try:
if command == "add":
for name in args:
add(db, name.lstrip("@"))
else:
for acct in db.execute("SELECT * FROM accounts ORDER BY username").fetchall():
try:
found += check(db, acct, full="--full" in args)
except Stop as reason:
print(f"@{acct['username']}: {reason}; nothing recorded for it this run")
if str(reason)[:3] in ("401", "402"): # bad key or no credits: the rest would fail too
break
except Stop as reason:
print(f"Stopped: {reason}")
finally:
export(db) # also after an interrupted run: what is in the database reaches the file
if found:
print(f"{len(found)} new follow{'s' if len(found) != 1 else ''} appended to {OUT}")
print(f"{calls} call{'s' if calls != 1 else ''}, {calls * 5} credits")
- The gate is page 1. It costs the same 5 credits as a profile lookup and carries
user_count, and when the count did move it is already the first page of the read. followedorfollowed?. An unseen account is certain, and markedfollowed, only when two things hold: the count rose by at least as many, and Instagram has by now shown every account it counted when you started. Otherwise it is markedfollowed?: either there are more unseen accounts than the count rose by (as many accounts left the list, or some were followed all along), or the first read fell short and an account it never showed could be surfacing now. The line under the list says which.- A first read that falls short is finished later. When
addgets fewer accounts than Instagram counts, the tracker remembers how many are missing. The next two checks read the list again even if the count is unchanged, and whatever turns up without a rise in the count is stored without being called new. A rise that a read does not show earns the same two extra reads, and the follow stays owed until an account turns up for it. - Nothing is half-recorded, and nothing is lost. A list, its count and its new follows are stored in one SQLite transaction after the last page, and
new_follows.csvis rewritten from the database at the end of every run, including one that is interrupted. A bad key, an empty balance (402) or a failed page ends that account's check with nothing written, and the next run finds the same changes. Timeouts (408), concurrency limits (429), server errors and dropped connections are retried with a growing pause. Failed calls are refunded. - IDs, not usernames. Watched accounts and the accounts they follow are keyed on the numeric ID, so a rename on either side is not mistaken for a new follow.
Run it
Start a watchlist: two creators and nine company accounts.
python ig_watch.py add lancehedrick jimseven figma notionhq duolingo wired techcrunch hubspot canva shopify hootsuite
@lancehedrick: watching, 1,309 of 1,309 followed accounts stored
@jimseven: watching, 1,110 of 1,124 followed accounts stored (14 left out of this pass; the next checks read the list again)
@figma: watching, 19 of 19 followed accounts stored
@notionhq: watching, 35 of 39 followed accounts stored (4 left out of this pass; the next checks read the list again)
@duolingo: watching, 356 of 357 followed accounts stored (1 left out of this pass; the next checks read the list again)
@wired: watching, 76 of 76 followed accounts stored
@techcrunch: watching, 114 of 114 followed accounts stored
@hubspot: watching, 69 of 69 followed accounts stored
@canva: watching, 1,393 of 1,410 followed accounts stored (17 left out of this pass; the next checks read the list again)
@shopify: watching, 1,698 of 1,700 followed accounts stored (2 left out of this pass; the next checks read the list again)
@hootsuite: watching, 1,856 of 1,873 followed accounts stored (17 left out of this pass; the next checks read the list again)
173 calls, 865 credits
That took 3 minutes 51 seconds: 8,035 accounts in 162 pages, plus one profile lookup per watched account. Then check, as often as you like:
python ig_watch.py check
@canva: 1,410 -> 1,410 following, 1 not seen before
the count did not rise: they were followed all along and left out of earlier passes
@duolingo: 357 -> 357 following, 0 not seen before
@figma: 19 following, no change
@hootsuite: 1,873 -> 1,873 following, 0 not seen before
@hubspot: 69 following, no change
@jimseven: 1,124 -> 1,124 following, 0 not seen before
@lancehedrick: 1,309 following, no change
@notionhq: 39 -> 39 following, 4 not seen before
the count did not rise: they were followed all along and left out of earlier passes
@shopify: 1,700 -> 1,700 following, 0 not seen before
@techcrunch: 114 following, no change
@wired: 76 following, no change
133 calls, 665 credits
Five accounts cost one call each. The six whose first read fell short were read again, and five accounts that read had left out were stored without being reported: no count had risen, so none of them could be new. A plain comparison would have announced five follows here. The second check read the same six lists once more (133 calls again) and stored 17 more accounts the same way. By the third, the extra reads were used up and no count had moved: all 11 accounts checked in 11 calls, 55 credits.
Three reads within ten minutes did not complete every list: James Hoffmann's still held 1,110 of 1,124, though the same list had come back whole earlier that afternoon. Reads close together tend to leave out the same accounts. While any are missing, the tracker marks that account's new follows followed?; a python ig_watch.py check --full some hours later reads every list again and often fills the gap.
Three weeks of real changes
To see real changes without waiting for them, we loaded the two lists saved on October 27 into the tracker as if add had run that day, then ran check on November 17:
@jimseven: 1,118 -> 1,124 following, 3 not seen before
followed @puncheur_official (Røddige memes)
followed @tompidcock (ᵀᴼᴹ ᴾᴵᴰᶜᴼᶜᴷ)
…
the count rose by 3 more than this pass showed; the next check reads the list again
@lancehedrick: 1,285 -> 1,309 following, 39 not seen before
…
followed? @unspecialty_official (언스페셜티 | unspecialty)
followed? @drewbinsky (Drew Binsky)
followed? @anzacoffee
…
15 more than the count rose by: as many accounts left the list, or some of these were followed all along
42 new follows appended to new_follows.csv
48 calls, 240 credits
Both lists, 48 pages, took 79 seconds. The two verdicts show the referee at work:
- James Hoffmann: three certain follows. The count rose by six and three unseen accounts turned up, so all three are news. The other three never appeared: on October 27 his list already held four accounts more than its count, so the count was running behind. The tracker reads the list twice more, then stops waiting.
- Lance Hedrick: 39 probable follows. None is marked certain, for both reasons the script knows. The count rose by 24, so 15 of the 39 need another explanation. Ten are accounted for below: he stopped following ten accounts, and each departure hides one new follow in the count. That leaves five, and the October 27 read had held only 1,281 of his 1,285 accounts. A handful of the 39 were followed all along, and nothing in the data says which.
That is the price of a single first read that fell short. Had the tracker run over those weeks, its follow-up reads would have filled the gap, and with checks every hour or day most changes arrive one at a time, where the count leaves no doubt.
new_follows.csv has one row per new follow, oldest first. It is a copy of the events table in ig_watch.db, written again after every run:
detected_at,account,event,username,full_name,verified,private,user_id
2026-11-17 18:11:11,jimseven,followed,tompidcock,ᵀᴼᴹ ᴾᴵᴰᶜᴼᶜᴷ,True,False,480357514
2026-11-17 18:11:51,lancehedrick,followed?,drewbinsky,Drew Binsky,True,False,381950622
…
Who are the new accounts?
The list gives a handle and a name. For size and type, look each new account up by its ID with /user/by_id, 5 credits each. Save this as who.py:
import csv
import sys
from ig_watch import OUT, Stop, call
found = []
for row in csv.DictReader(open(OUT, encoding="utf-8")):
if sys.argv[1:] and row["account"] != sys.argv[1].lstrip("@"):
continue
try:
p = call("/user/by_id", {"user_id": row["user_id"]}) # the ID still works after a rename
except Stop as reason:
print(f"@{row['username']}: {reason}")
continue
found.append((p.get("follower_count") or 0, row["account"], p["username"],
p.get("category") or "", "verified" if p.get("is_verified") else ""))
for followers, account, username, category, badge in sorted(found, reverse=True):
print(f"@{account:<13} @{username:<22} {followers:>10,} {category:<20} {badge}")
python who.py lancehedrick
@lancehedrick @drewbinsky 1,518,886 Reel creator verified
@lancehedrick @parkjjongaa 1,036,622 verified
@lancehedrick @nadiaxcoffee 160,771 verified
@lancehedrick @hello_.woo 71,739
@lancehedrick @anzacoffee 63,950
…
@lancehedrick @cafemarch21 17,102 Coffee shop
…
Sorted by followers, the 39 lookups (195 credits) put a travel creator with 1.5 million followers at the top and coffee shops, roasters and equipment makers below. category is empty for most accounts; when you need to sort businesses from people, is_business and account_type are in the same response.
Who did they stop following?
Departures are harder, because the only evidence is absence, and both a read and a search can miss an account that is still there. Take it in steps: ask search about every stored account the latest read did not show, look a missing account up by its ID in case it was renamed, and believe a "not found" only when it repeats on another day. Save this as gone.py:
import re
import sqlite3
import sys
from ig_watch import DB, Stop, call, now
def in_list(account_id, username, target_id):
"""Search a following list for one account. True, False, or None when the search can't tell."""
finished = True
words = [username, max(re.split(r"[^a-z0-9]+", username), key=len)] # the handle, then its longest word
for query in [w for w in dict.fromkeys(words) if w]:
params = {"user_id": account_id, "query": query}
for _ in range(5): # a common word matches many accounts: read a few pages of matches
hit = call("/following/by_user_id", params)
if hit.get("should_limit_list_of_followings") is not False:
raise Stop("Instagram ignores the search on this list: can't tell who left")
if any(u["id"] == target_id for u in hit.get("users", [])):
return True
if not hit.get("has_more") or not hit.get("next_max_id"):
break
params["max_id"] = hit["next_max_id"]
else:
finished = False # more matches than we read: not finding it there proves nothing
return False if finished else None
def current_name(target_id):
"""The account's handle today, by its ID: it may have been renamed since we stored it. None if it is gone."""
try:
p = call("/user/by_id", {"user_id": target_id})
except Stop as reason:
if not str(reason).startswith("404"):
raise
return None
return p.get("username") if str(p.get("id")) == target_id else None
if __name__ == "__main__":
db = sqlite3.connect(DB)
db.row_factory = sqlite3.Row
acct = db.execute("SELECT * FROM accounts WHERE username = ?", (sys.argv[1].lstrip("@"),)).fetchone()
if acct is None:
sys.exit("not watched: add it with ig_watch.py first")
# Stored accounts the latest pass did not show. Most are still followed; search says which.
rows = db.execute("SELECT * FROM follows WHERE account_id = ? AND last_seen < ? ORDER BY username",
(acct["id"], acct["passed_at"])).fetchall()
print(f"@{acct['username']}: {len(rows)} stored account{'s were' if len(rows) != 1 else ' was'} "
f"not in the latest pass")
try:
for r in rows:
name, where = r["username"], "account_id = ? AND target_id = ?"
found = in_list(acct["id"], name, r["target_id"])
if found is False: # before believing a miss, ask again under the handle the account has now
name = current_name(r["target_id"]) or name
if name != r["username"]:
found = in_list(acct["id"], name, r["target_id"])
with db:
if found: # still followed: count it as seen in that pass
db.execute("UPDATE follows SET username = ?, last_seen = ?, not_found = NULL WHERE " + where,
(name, acct["passed_at"], acct["id"], r["target_id"]))
elif found is None:
print(f" can't tell @{name}: too many accounts match its name to search them all")
elif r["not_found"] and r["not_found"][:10] < now()[:10]: # search missed it on an earlier day too
db.execute("DELETE FROM follows WHERE " + where, (acct["id"], r["target_id"]))
print(f" gone @{name} (not found on {r['not_found'][:10]} or today)")
else:
db.execute("UPDATE follows SET not_found = COALESCE(not_found, ?) WHERE " + where,
(now(), acct["id"], r["target_id"]))
print(f" not found @{name}: run this again another day before you believe it")
except Stop as reason:
sys.exit(str(reason))
python gone.py lancehedrick
python gone.py jimseven
@lancehedrick: 10 stored accounts were not in the latest pass
…
not found @breezygolf: run this again another day before you believe it
…
not found @rangegoatsgc: run this again another day before you believe it
…
@jimseven: 15 stored accounts were not in the latest pass
…
For Lance Hedrick the latest read had shown every stored account but ten, and search missed all ten. For James Hoffmann the read had left 15 out; search found 14 of them, which are marked as seen, and missed one. Run on a later day, the script reports the ones it misses again as gone and forgets them, so a later re-follow counts as new. We could not wait a day, but the same ten had already been missing from searches twice earlier that afternoon, and ten departures account for most of the gap between Lance Hedrick's 39 unseen accounts and a count that rose by 24. "Gone" means the account left the list: unfollowed, deleted or deactivated.
- Each account costs one or two search calls, a few more when its handle is a common word: the whole handle first, then its longest word, which rescues handles that search can't match as written. The two runs above came to 40 calls, 200 credits.
- A miss is checked against a rename. The stored handle may be out of date, so before a miss is recorded the account is looked up by its ID with
/user/by_id(5 credits) and, if its handle changed, searched for again under the new one. - A search that could not finish proves nothing. When a handle's word matches more accounts than five pages of results hold, the script says it can't tell and leaves the account alone, however many days that repeats.
- Run
python ig_watch.py check --fullfirst when the last read is old.--fullreads every list whether or not its count moved. - If Instagram ever limits a list (
should_limit_list_of_followings), search is ignored there and the script stops rather than guess.
Schedule it
The tracker is a plain script with a SQLite file beside it, so cron is enough. Hourly checks, and once a week a full read followed by a look for departures:
0 * * * * cd /path/to/tracker && python3 ig_watch.py check >> watch.log 2>&1
30 6 * * 1 cd /path/to/tracker && python3 ig_watch.py check --full >> watch.log 2>&1 && python3 gone.py lancehedrick >> watch.log 2>&1
To be told about new follows rather than read a file, send the rows check() returns to Slack or email at the end of the script. Accounts are checked one after another; a list can't be read in parallel because each page needs the previous page's cursor, but different accounts can run side by side up to your plan's concurrency limit.
Cost and speed
| What | Calls | Credits |
|---|---|---|
| A check that finds no change | 1 per account | 5 |
| Reading a 1,309-account list (26 pages, about 40 seconds) | 26 | 130 |
| Starting the 11-account watchlist above | 173 | 865 |
| Checking those 11 accounts every hour for a day, no changes | 264 | 1,320 |
| Reading all 11 lists in full every hour for a day instead | 3,888 | 19,440 |
- Hourly checks of 11 accounts are about 39,600 credits a month, roughly 14% of the Starter plan ($49.99 for 275,000 credits). Reading every list in full each hour would be about 583,000, more than twice the plan.
- The count gate is what scales. 100 accounts checked every three hours is 120,000 credits a month before any list is read; hourly it is 360,000, which needs the Startup plan ($99.99 for 1.1 million).
- A change costs one read of that list: 5 credits per page of about 50 accounts, at 1 to 4 seconds a page in our runs. A read that falls short earns up to two more, which is why the first two checks of the new watchlist above cost 133 calls each.
- Failed calls cost nothing, and a missing account is a free
404. A private account's empty list is a successful call, 5 credits.
What the tracker can't see
- A follow and an unfollow between two checks cancel out. The count ends where it began, so no list is read. At the next full read the new account is stored unreported, or shows up as a
followed?beside a later change. Check more often if that matters. - When a follow happened. You learn it was between two checks. The check interval is your resolution.
- Counts that run a few off. Twice in our data a count and its list disagreed by a few accounts for a while. The tracker reads again when that happens and gives up after three reads, which is why a rise can go unexplained.
- Private accounts, and accounts that turn private: their checks are skipped until the list is back.
- New followers. The same idea works on
/followers/by_user_idonly for small accounts whose follower lists Instagram shows in full; many large accounts' lists stop after about 50.
Use it on public figures and organisations
A following list is public, but watching one closely is still watching someone. Keep the watchlist to brands, organisations and public figures whose follows are part of their public work, don't use it to monitor private individuals, and don't publish what you infer about someone's relationships. If you store data about people in the EU or UK, the GDPR applies to it. The terms of service cover what you may do with data from ScrapingBot.
Where to go from here
- Need one whole list as a file, or the accounts two creators both follow? Export Instagram followers and following to CSV.
- Size up the accounts you find: follower counts in bulk, then engagement rate for a list of creators.
- Watching what accounts post rather than who they follow: post and reel stats by URL and a profile and its reels.
- One account, no code: the free Instagram profile stats tool. For TikTok, the engagement rate calculator and the sound tracker.
- Coming from an open-source scraper? Instaloader compared with ScrapingBot. The followers and following reference lists every parameter, and the Instagram API page every endpoint.
Common questions
Can I see who someone recently followed on Instagram?
Not directly. Instagram shows a public account's following list but no dates, and Meta's official API has only the count. To learn who an account started following, store its list and compare a later one. ScrapingBot's /following/by_user_id returns the list as JSON, and the script in this guide does the comparing.
Is the Instagram following list in chronological order?
Not through an API. In our test the order was different on every call: two reads of the same 1,309-account list two minutes apart had the same account in the same place for 206 of 1,305 positions, and 39 accounts followed over the previous three weeks sat anywhere from the 22nd place to the 1,130th. You can't read the first page and call it the newest follows.
Why does comparing two following lists show follows that never happened?
Because each read of a list leaves some accounts out, and not always the same ones. Three reads of a 1,124-account list within four minutes returned 1,123, 1,123 and 1,112 accounts. Comparing the third with the first reports 12 new follows while the following count never moved. Keep every account you have ever seen, and count an unseen account as new only when the count rose.
How much does it cost to track Instagram following changes?
A check that finds no change is one call per account, 5 credits. Reading a whole list costs 5 credits per page of about 50 accounts, and the script does that only when the count moved. Watching 11 accounts every hour came to about 1,320 credits a day in our run, roughly 14% of the Starter plan ($49.99 for 275,000 credits).
Can I track who a private Instagram account follows?
No. A private account's following list comes back empty, with no count, and the script refuses to add it. Only public accounts' lists are available.
Can I see who an account unfollowed?
With less certainty than new follows. An account missing from one read is usually still followed, so the guide's second script searches the list for each missing account and calls it gone only when the search fails on two different days. In our data that pointed to 10 accounts one creator had stopped following in three weeks.