Guides
Build a FOMO Trader Alert Bot for Telegram, by Username
Subscribe to a single FOMO trader by username over the realtime WebSocket and forward every buy, sell, and thesis to Telegram. A short build with the full code.
You want a ping the moment a specific FOMO trader makes a move. Their buys, their sells, and the thesis they write when they take a position. Not the whole firehose, just one trader, by their username. Here is a Telegram bot that does exactly that, and it takes about fifteen lines.
The whole thing works because the FOMO API lets you subscribe to a single trader by their handle and receive only their activity in real time.
What you need
- A Telegram bot token from @BotFather (message it, send /newbot, copy the token).
- Your Telegram chat id (message your new bot, then read it from the getUpdates call, or use a chat-id helper bot).
- A FOMO API key. It is free to start at fomoapi.io.
The one connection that does it
The realtime stream is at wss://api.fomoapi.io/ws/alerts. Add ?trader=<username> and the server sends you only that trader's events: every buy, sell, and thesis, live, and nothing else. You do not filter on your side.
wss://api.fomoapi.io/ws/alerts?trader=frankdegods
The bot
const BOT_TOKEN = "your-telegram-bot-token";
const CHAT_ID = "your-telegram-chat-id";
const TRADER = "frankdegods";
const ws = new WebSocket("wss://api.fomoapi.io/ws/alerts?trader=" + TRADER);
ws.onmessage = async (e) => {
const m = JSON.parse(e.data);
if (m.type !== "alert") return; // skip the welcome message
const line = m.text + (m.tokenAddress ? "\n" + m.tokenAddress : "");
await fetch("https://api.telegram.org/bot" + BOT_TOKEN + "/sendMessage", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({ chat_id: CHAT_ID, text: TRADER + ": " + line }),
});
};
Run it, and every time that trader acts, the message lands in your Telegram. Buys, sells, and theses all come through the same stream, so one connection covers everything they do.
What each alert carries
Every message has the fields you need to act or to look the token up:
- alertType:
buy,sell,thesis,transfer, orperp. - trader: the FOMO handle.
- token and tokenAddress: the symbol and the contract address.
- chainId: the chain (Solana, Base, BSC, Ethereum).
- text: a human-readable summary, and ts: the timestamp.
Following more than one trader
Two options. Open one connection per trader, each with its own ?trader=, and route them to different Telegram chats. Or connect once to the full stream and filter in the bot, which is better if you are following many. You can also scope by chain (?chain=solana) or by type (?type=buy).
Resolve the trader first, if you want
Before you subscribe, you can resolve the handle to confirm it exists and pull their wallets and PnL:
curl https://api.fomoapi.io/v2/users/frankdegods
That is the whole build: pick a username, open one WebSocket, forward to Telegram. The API does the hard part of watching FOMO and scoping the stream to the one trader you care about.
FOMO API is an independent, unofficial data layer for fomo.family. It is not affiliated with FOMO.
Ship on verified trader data
Both-chain wallets, real PnL, and a realtime feed. One API.
Get an API key