Real-Time X (Twitter) Brand Mention Monitoring Without the Enterprise Price Tag
X is still where things break first, a product outage, a viral complaint, a competitor's launch, a founder's offhand comment that catches fire. If you find out hours late, you've already lost the thread. The enterprise social-listening suites that monitor this cost thousands a month and bundle a hundred features you'll never touch. If all you need is "tell me when people are talking about us on X," you can build that yourself for pocket change.
Here's a lightweight, near-real-time mention monitor you fully control.
"Real-time" is really "frequent polling"
Let's be precise about the term, because it matters for expectations. You're not getting a firehose push stream here; you're polling X search on a tight schedule and treating anything new since the last check as a fresh mention. Poll every few minutes and it's near-real-time in practice, plenty fast for reacting to a brewing issue. Calling it "real-time" is marketing; "frequent polling with dedupe" is the honest description, and it's genuinely enough for most brand-monitoring needs.
The core loop: search, filter new, alert
SociaVault's X search endpoint takes a query and a type (recent vs top). Base URL https://api.sociavault.com/v1, x-api-key header, 1 credit per call, payload under data:
const API_KEY = process.env.SOCIAVAULT_API_KEY;
const BASE = "https://api.sociavault.com/v1";
async function searchX(query) {
const qs = new URLSearchParams({ query, type: "Latest" }).toString();
const res = await fetch(`${BASE}/scrape/twitter/search?${qs}`, {
headers: { "x-api-key": API_KEY },
});
if (!res.ok) throw new Error(`search failed: ${res.status}`);
return (await res.json()).data;
}
The monitor keeps track of which tweet IDs it has already seen, so each poll only surfaces genuinely new mentions:
const seen = new Set(); // persist this (Redis/DB) in production
async function poll(query, onNew) {
const data = await searchX(query);
const tweets = data?.tweets ?? data?.results ?? []; // read defensively
const fresh = [];
for (const t of tweets) {
const id = t.id ?? t.tweet_id;
if (id && !seen.has(id)) {
seen.add(id);
fresh.push(t);
}
}
if (fresh.length) await onNew(fresh);
}
Wire onNew to Slack, email, or a dashboard (the Slack alert pattern drops straight in), run poll on a short interval, and you've got mentions landing as they happen. Persist the seen set (Redis or a table) so a restart doesn't re-alert on everything.
Craft the query so you get signal, not noise
The whole quality of a mention monitor lives in the query. A few practical moves:
- Track variants: your brand name, common misspellings, your product names, your handle, and your domain. People rarely spell or @ you correctly.
- Exclude the obvious noise: if your brand name is also a common word, you'll drown. Add distinguishing terms or plan to filter results before alerting.
- Separate the urgent from the ambient: run a tight, high-signal query for "needs a human now" alerts, and a broader one for a daily digest. One channel for fires, one for the slow read.
Getting this right is the difference between a channel your team watches and one they mute in a week.
Prioritize what actually needs a response
Not every mention deserves a ping. Rank incoming mentions so the important ones stand out, an account's follower count and the tweet's early engagement are decent proxies for reach and urgency. A complaint from a 200k-follower account that's already getting quote-tweeted is a drop-everything; the same words from a brand-new account with zero engagement usually isn't. You can pull the author's profile to weight by reach, and re-check high-priority tweets a few minutes later to see if they're accelerating.
The honest limits
- It's polling, not a true stream. Your freshness equals your polling interval. Every-few-minutes is near-real-time; don't promise literal instant.
- Search returns a sample. You'll catch most relevant mentions, not provably every one. For brand monitoring that's fine; for legal-grade completeness it isn't.
- Ambiguous names are hard. Common-word brand names generate noise that no query fully eliminates. Budget for filtering, and sanity-check results.
- Public tweets only. You see public posts, not protected accounts or DMs. That's the scope, and it's the right scope for brand listening.
- Persist your dedupe state. An in-memory
seenset re-alerts on restart and won't work across multiple workers, use a shared store in production.
Frequently Asked Questions
Can I really monitor X mentions in real time without an enterprise tool?
You can get near-real-time monitoring by polling X search on a short interval (every few minutes) and treating new results as fresh mentions. It's not a literal push stream, but for reacting to brewing issues it's fast enough, and a fraction of enterprise-suite cost.
How does the mention monitor avoid duplicate alerts?
It keeps a set of tweet IDs it has already seen and only alerts on IDs that are new since the last poll. Persist that set in Redis or a database so a restart doesn't re-alert on every existing mention.
How do I reduce noise in mention monitoring?
Craft the query carefully: track name variants, misspellings, product names, and your domain, exclude common-word collisions, and split a tight urgent query from a broad digest query. Then rank mentions by author reach and early engagement before alerting.
How often should I poll?
Every few minutes gives near-real-time coverage for most brand needs. Shorter intervals catch things faster but cost more credits, since each poll is a call. Match the cadence to how quickly you actually need to react.
Will I catch every single mention?
No, search returns a strong sample, not a guaranteed complete record. That's ample for brand monitoring and rapid response, but it isn't suitable for legal-grade "every mention" completeness. Set expectations accordingly.
How much does this cost to run?
Each poll is 1 credit. Polling one query every five minutes is a predictable daily spend, far below enterprise listening tools, and you start with 50 free credits, no card, to prototype it.
Want to catch what people say about you on X while it still matters? Start free with 50 credits, no card required and stand up your mention monitor today. Prefer X off official API pricing? See our Twitter/X API alternative.
Found this helpful?
Share it with others who might benefit
Ready to Try SociaVault?
Start extracting social media data with our powerful API. No credit card required.