Skip to content

Build a Twitter follower tracker with an API

Build your own Twitter follower tracker: a Python script that logs daily follower counts, diffs follower lists for new and lost followers, and shows the real cost.

Piyushh · October 14, 2026 · 6 min read

A Twitter follower tracker does two jobs. It logs an account's follower count over time, and it compares follower lists to show who followed and who left. X only shows you today's number. You can build both parts in about 100 lines of Python: one cheap API call a day for the count, plus a paged follower export that you diff against the previous one.

This post builds that tracker step by step, using real API responses. It also covers the part most "free tracker" pages leave out. Full follower lists cost money per page, so the right design depends on how big the account is.

What a Twitter follower tracker needs to do

X shows a follower count and a follower list, but no history for either. @chams_builds summed it up: "X shows you today's follower count. It won't show you last month's." The workarounds are screenshots, Premium analytics, or "you just... lose the history" (post).

A tracker needs four things:

  1. A daily count. Store one number per account per day, with the date. That gives you the growth chart and the net change.
  2. New followers. These are the IDs in today's list that weren't in yesterday's.
  3. Lost followers. These are the IDs in yesterday's list that aren't in today's, which is what people mean by "who unfollowed me."
  4. Context. Keep each follower's bio and follower count so the list of new followers tells you who they are.

People keep building their own. @oubagaku described a vibe-coded version that can "see who follows and unfollows me" and add notes to accounts (post). The tracker is easy to build once you have follower data. Getting that data is the hard part.

The two API calls

Both are ChatterAPI endpoints on one key, and neither needs an X developer account.

  • x.user (GET /v1/x/users/{handle}) returns the profile with followers, following and tweets counts. 3 credits.
  • x.followers (GET /v1/x/users/{handle}/followers) returns the follower list a page at a time, about 20 per page, each with bio, follower count and canDm. 3 credits per page. The free X follower exporter runs the same call in a browser and downloads a CSV.

Here is the count. It came from a test key, which returns a recorded real sample per endpoint at no charge, and it is trimmed to the useful fields:

curl "https://api.chatterapi.com/v1/x/users/levelsio" \
  -H "Authorization: Bearer $CHATTERAPI_KEY"
{
  "data": {
    "id": "1577241403",
    "handle": "levelsio",
    "name": "@levelsio",
    "followers": 974707,
    "following": 3276,
    "tweets": 181450,
    "blueVerified": true,
    "createdAt": "2013-07-08T09:31:59.000Z"
  },
  "credits": { "charged": 0, "remaining": 719 },
  "requestId": "req_01M4X1HX40NTY80C1W38",
  "cached": true
}

And one page of followers:

curl "https://api.chatterapi.com/v1/x/users/levelsio/followers" \
  -H "Authorization: Bearer $CHATTERAPI_KEY"
{
  "data": [
    {
      "id": "197785542",
      "handle": "dannypostma",
      "name": "Danny Postma",
      "bio": "Founder of HeadshotPro, a Singapore-based AI photography company.",
      "followers": 187346,
      "canDm": true
    },
    {
      "id": "24179991",
      "handle": "dvassallo",
      "name": "Daniel Vassallo",
      "followers": 205470,
      "canDm": false
    }
  ],
  "page": { "nextCursor": "AUh5tDS6CvbbCn4S…", "hasMore": true },
  "credits": { "charged": 0, "remaining": 719 }
}

The sample page held 20 followers, which costs 3 credits on a live key. To get the next page, pass page.nextCursor as cursor. Store follower id rather than handle, because people change handles and the id does not change.

What tracking costs, honestly

This part decides the design. The count is cheap. The full list is not, because you pay per page and a page holds about 20 followers.

Account sizePages per full snapshotCredits per snapshotDaily snapshots for 30 days
500 followers25752,250
2,000 followers1003009,000
10,000 followers5001,50045,000
100,000 followers5,00015,000450,000
~975,000 (the sample account)~48,750~146,000not sensible

For comparison, the plans include 25,000 credits a month on Starter ($19), 70,000 on Growth ($49) and 240,000 on Scale ($149). So:

  • Up to about 2,000 followers, a daily full diff fits comfortably in Starter.
  • At around 10,000 followers, a daily full diff costs more than Growth includes. Run it weekly (about 6,000 credits a month) and log the count daily.
  • For large accounts, full diffs stop making sense. Log the daily count for the growth chart and skip the "who unfollowed" part, or take a full snapshot once a month.

X's own API also charges for follower reads per resource. Its pricing page lists "Following/Followers: Read" at $0.010 per resource (as listed on Oct 14, 2026), so you pay per follower whichever route you take. Our X API key guide covers how that route works.

Build the Twitter follower tracker

The script below stores everything in SQLite, with one table for daily counts and one for follower snapshots. Run it once a day from cron. It takes a page budget per account, so a misconfigured run can't spend your whole balance.

import os, sqlite3, datetime as dt
import requests

API = "https://api.chatterapi.com/v1"
H = {"Authorization": f"Bearer {os.environ['CHATTERAPI_KEY']}"}
DB = sqlite3.connect("followers.db")
DB.executescript("""
CREATE TABLE IF NOT EXISTS counts (handle TEXT, day TEXT, followers INT, PRIMARY KEY (handle, day));
CREATE TABLE IF NOT EXISTS snapshot (handle TEXT, day TEXT, id TEXT, follower_handle TEXT,
  bio TEXT, follower_count INT, PRIMARY KEY (handle, day, id));
""")

def get(path, **params):
    r = requests.get(f"{API}{path}", headers=H, params=params, timeout=60)
    r.raise_for_status()
    return r.json()

def log_count(handle, day):
    body = get(f"/x/users/{handle}")
    n = body["data"]["followers"]
    DB.execute("INSERT OR REPLACE INTO counts VALUES (?,?,?)", (handle, day, n))
    return n, body["credits"]["remaining"]

def snapshot(handle, day, max_pages):
    cursor, pages = None, 0
    while pages < max_pages:
        body = get(f"/x/users/{handle}/followers", **({"cursor": cursor} if cursor else {}))
        pages += 1
        DB.executemany("INSERT OR IGNORE INTO snapshot VALUES (?,?,?,?,?,?)", [
            (handle, day, u["id"], u["handle"], u["bio"], u["followers"]) for u in body["data"]])
        if not body["page"]["hasMore"]:
            return True                      # complete list
        cursor = body["page"]["nextCursor"]
    return False                             # hit the page budget

def diff(handle, today, previous):
    q = """SELECT follower_handle, follower_count, bio FROM snapshot s
           WHERE handle=? AND day=? AND id NOT IN
           (SELECT id FROM snapshot WHERE handle=? AND day=?)"""
    new = DB.execute(q, (handle, today, handle, previous)).fetchall()
    lost = DB.execute(q, (handle, previous, handle, today)).fetchall()
    return new, lost

if __name__ == "__main__":
    handle, budget = "yourhandle", 120           # 120 pages ≈ 2,400 followers, 360 credits
    today = dt.date.today().isoformat()
    n, left = log_count(handle, today)
    print(f"{handle}: {n} followers, {left} credits left")
    complete = snapshot(handle, today, budget)
    prev = DB.execute("SELECT MAX(day) FROM snapshot WHERE handle=? AND day<?",
                      (handle, today)).fetchone()[0]
    if complete and prev:
        new, lost = diff(handle, today, prev)
        print(f"+{len(new)} new since {prev}:", [h for h, _, _ in new][:20])
        print(f"-{len(lost)} lost since {prev}:", [h for h, _, _ in lost][:20])
    elif not complete:
        # a partial list would show everyone unfetched as "lost", so drop it
        DB.execute("DELETE FROM snapshot WHERE handle=? AND day=?", (handle, today))
        print("Page budget reached before the end of the list; skipping the diff.")
    DB.commit()

Then schedule it. Add this line with crontab -e to run it every morning at 07:10:

10 7 * * * cd /path/to/tracker && CHATTERAPI_KEY=ca_live_... python3 track.py >> track.log 2>&1

Three rules keep the diff honest:

  • Only diff complete snapshots. If the page budget runs out halfway, the "lost" list would include everyone on the pages you didn't fetch, so the script refuses to diff in that case.
  • "Lost" doesn't always mean "unfollowed." Accounts that deactivated, got suspended or went protected also drop off the list. Check a few with x.user before reading anything into it.
  • Expect a little noise. Two snapshots taken minutes apart can disagree by a follower or two because the list changes while you fetch it. Small accounts see this rarely and big ones see it constantly.

A cheaper mode for big accounts

For accounts too large to diff daily, store the count every day and run a full snapshot weekly or monthly. That still gives you the growth curve and a regular list of who's new.

You can also fetch just the first few pages each day and treat unseen IDs as new followers. Follower lists often come back newest first, but neither X's docs nor ours promise an order. Test it on your own account before you trust it: follow your account from a second account and check that the new follower shows up on page one.

What people use a follower tracker for

  • Tracking your own growth. A dated count beats screenshots, and if you pair the chart with your posting log you can see which posts moved it.
  • Tracking competitors. Log the daily count for a few accounts in your niche, at 3 credits per account per day.
  • Spotting who's new. New followers with large audiences, or with bios that match your customer, are worth a look. Every row comes back with the bio and follower count.
  • Exporting a list once. If you only want a one-time CSV of someone's followers, you don't need a tracker. XAutoDM has a walkthrough on how to export Twitter followers to CSV, and the free exporter above does it in a browser.

Follower data is public, but the people on the list didn't sign up to be targeted, so don't use a tracker to bulk-follow, bulk-unfollow or mass-message the accounts it finds. X's automation rules (checked 2026-10-14) say you "may not follow or unfollow X accounts in a bulk, aggressive, or indiscriminate manner" and may not send "unsolicited Direct Messages in a bulk or automated manner." Breaking them is the fastest way to lose the account you're trying to grow.

Is building your own worth it?

There's a fair case against building. Ready-made tracker apps exist, and some do well: @jacobrodri_ listed "The Ick (follower tracker)" among apps "making over $200k/mo" (post), which tells you how much people care about who unfollowed them. If all you want is your own unfollower list on your phone, one of those may be simpler.

Building your own makes sense when you want the raw data: your own database, as many accounts as you like, custom alerts, or numbers fed into a dashboard or an agent. You also know exactly where the data comes from and what each run costs, which a free app rarely tells you. For more ways to wire X data into an agent, see our guide to giving an AI agent Reddit and X data. To archive the tweets of the accounts you track, see how to search tweets by date.

Try it

ChatterAPI gives your code and your agents Reddit and X data through one key, over REST or MCP, and you don't have to apply for a developer account. Sign up with Google to get 100 free credits, no card required. That covers a month of daily counts for one account, or a full follower snapshot of an account with up to about 650 followers. Plans start at $19 a month for 25,000 credits.

FAQ

Can I see who unfollowed me on Twitter?
Not in X itself. X shows your current follower count and list but no history. To see who unfollowed you, save your follower list on a schedule and compare snapshots. Anyone missing from the newer snapshot unfollowed, deactivated or was suspended.
How much does it cost to track Twitter followers with an API?
With ChatterAPI, a daily follower count costs 3 credits, about 90 a month. A full follower list costs 3 credits per page of about 20, so an account with 2,000 followers costs about 300 credits per snapshot. Daily full snapshots only make sense for smaller accounts.
Can I track someone else's followers?
For a public account, yes: follower counts and follower lists are public on X. Use it for research like competitor growth, not to target or harass the people on the list.
Do I need an X developer account to build a follower tracker?
Not with a hosted API. ChatterAPI's x.user and x.followers endpoints work with one ChatterAPI key. With X's own API you need a developer app and pay X's per-resource read prices.

More from the blog

Make your first call on 100 free credits.

Sign up with Google, no card. One key for Reddit and X, over REST or MCP.