Twitter/X Follow & Unfollow Detection API (2026)

When a high-profile crypto trader follows a new account, it's a signal. When multiple KOLs follow the same account within hours, it's a strong signal. But Twitter/X doesn't offer a native API for detecting follow and unfollow events in real time.

Xanguard's Follow Detection API, part of the B2B Enterprise plans, tracks the accounts you choose and streams an event over WebSocket whenever one of them follows or unfollows someone. It's built for crypto trading bots, DeFi protocols, and social intelligence platforms.

Why Follow Detection Matters for Crypto Traders

In crypto markets, social signals precede price movements. When a whale account or KOL follows a new project account, it often indicates upcoming involvement — a partnership, advisory role, or investment. Detecting these follow events before anyone else gives you a measurable edge.

Real-World Signal

When several of your tracked accounts follow the same new account within a short window, that clustering is one of the strongest signals in the stream. Because each event names both the follower and the followed account, spotting it takes only a few lines of code on your side.

Use Cases

How It Works

You add the accounts you want to track. Whenever one of them follows or unfollows someone, an event is sent over the WebSocket as soon as it is detected. For reference, the Telegram version of this feature (Follow Watch) alerted new follows in a median of 284 ms in our 18-20 Sep 2026 measurement.

Event Format

{
  "op": 0,
  "d": {
    "event": "twitter.following.new",
    "event_id": "evt_f_example_dev_1712000000",
    "task_info": { "handle": "example_dev" },
    "data": {
      "id": "1234567890",
      "handle": "example_project",
      "name": "Example Project"
    }
  }
}

Quick Start: Python

import asyncio, websockets, json

async def detect_follows():
    async with websockets.connect('wss://api.xanguard.tech/v1/dt/realtime/ws') as ws:
        # Receive HELLO
        hello = json.loads(await ws.recv())

        # Login with API key, then keep the connection alive
        await ws.send(json.dumps({"op": 2, "d": "dt_YOUR_API_KEY"}))
        ready = json.loads(await ws.recv())
        print(f"Monitoring {ready['d']['handles']} handles for follow changes")

        async def heartbeat():
            while True:
                await asyncio.sleep(hello["d"]["heartbeat_interval"] / 1000)
                await ws.send(json.dumps({"op": 1}))
        asyncio.create_task(heartbeat())

        # Listen for events
        while True:
            msg = json.loads(await ws.recv())
            if msg["op"] == 0 and msg["d"]["event"] == "twitter.following.new":
                data = msg["d"]["data"]
                handle = msg["d"]["task_info"]["handle"]
                print(f"@{handle} just followed @{data['handle']}")

asyncio.run(detect_follows())

Quick Start: JavaScript

const ws = new WebSocket('wss://api.xanguard.tech/v1/dt/realtime/ws');

ws.onmessage = (event) => {
  const msg = JSON.parse(event.data);

  if (msg.op === 10) { // HELLO
    ws.send(JSON.stringify({ op: 2, d: 'dt_YOUR_API_KEY' }));
  }

  if (msg.op === 0 && msg.d.event === 'twitter.following.new') {
    const { handle } = msg.d.task_info;
    const followed = msg.d.data;
    console.log(`@${handle} followed @${followed.handle}`);
  }
};

setInterval(() => ws.send(JSON.stringify({ op: 1 })), 30000);

Why Not Use Twitter/X's Official API?

The official X API does not offer follow/unfollow event streaming. The closest option — the Follows Lookup endpoint — requires polling each account individually at 15 requests per 15 minutes, making real-time detection for more than a handful of accounts impractical. Enterprise API access costs approximately $42,000/month (checked September 2026) and still doesn't provide streamed follow events.

Xanguard handles detection, deduplication, and delivery for you. You connect to one WebSocket and receive follow events for up to 1,000 accounts simultaneously.

Pricing

Follow and unfollow detection is included in the Enterprise column of the B2B Realtime plans:

HandlesStarterProEnterprise
50$49/mo$99/mo$249/mo
250$229/mo$429/mo$979/mo
500$449/mo$749/mo$1,649/mo
1,000$849/mo$1,349/mo$2,849/mo

Starter streams tweets and deleted tweets. Pro adds profile changes and new followers. Enterprise adds follow and unfollow events. All plans are paid in SOL. If you only need follow alerts in Telegram, Follow Watch starts at $15/month.

Get Started

Start monitoring follow changes in under 5 minutes:

  1. Message @B2B_Xanguard_bot on Telegram
  2. Subscribe to an Enterprise plan and get your API key
  3. Add accounts to track via /add handle or the REST API
  4. Connect to the WebSocket and start receiving events

Frequently Asked Questions

Is there an API to detect when a Twitter/X account follows someone?

Twitter/X has no native API for follow event detection. Xanguard's B2B API (Enterprise plans) streams follow and unfollow events for the accounts you track over WebSocket as soon as they are detected.

How fast does Xanguard detect Twitter/X follow and unfollow events?

For the Telegram version, Follow Watch, we measured new follows alerted in a median of 284 ms, with 93.5% under 500 ms (18-20 Sep 2026). The B2B stream delivers follow and unfollow events as soon as they are detected.

Why is follow detection useful for crypto trading?

When a whale or KOL follows a new project account, it often signals upcoming involvement like a partnership or investment. Detecting these follows before the public gives you a measurable trading edge.

Can I use follow detection to spot rug pulls on Twitter/X?

Yes. When dev accounts unfollow their own project accounts or team members, it's a strong rug pull warning signal. Xanguard streams unfollow events as they are detected, giving you time to exit positions.

← Back to Blog

Start Detecting Follow Changes Today

Get Telegram notifications for new tweets from any X account, in a median of about 270 ms on paid plans. Free for 1 account. Paid plans from $19 a month for 10 accounts.