How to Build a Brand Monitoring Tool
A practical 5-step guide to shipping a working brand monitoring tool across Twitter/X, Instagram, TikTok, and Reddit — using the XPOZ SDK or MCP server.
What you'll build
By the end of this guide you'll have a script that sweeps mentions of your brand across four platforms, dedupes them, scores basic sentiment, and prints a daily summary. You can wrap it in a cron job, an n8n workflow, or a Claude Code slash command.
Prerequisites
- A free XPOZ account and API token — grab one at /get-token.
- Node.js 18+ OR Python 3.9+.
- Optional: a Slack or email webhook for alerts.
5 steps to a working tool
Copy each block, wire them together, and you have a minimum viable brand monitor.
Step 1: Install the SDK
Install the XPOZ SDK for your language of choice. The TypeScript SDK ships on npm; the Python SDK ships on PyPI. Both expose the same typed interface over Twitter/X, Instagram, TikTok, and Reddit.
npm install @xpoz/xpoz
# or
pip install xpozStep 2: Sweep mentions across platforms
Run parallel searches against every platform you care about. The SDK returns typed, paginated results so the same query shape works across Twitter/X, Reddit, Instagram, and TikTok. Export your XPOZ_API_KEY before running.
import { XpozClient } from "@xpoz/xpoz";
const client = new XpozClient({ apiKey: process.env.XPOZ_API_KEY });
await client.connect();
const brand = "YourBrand";
const [twitter, reddit, instagram] = await Promise.all([
client.twitter.searchPosts(brand, { limit: 100 }),
client.reddit.searchPosts(brand, { limit: 100 }),
client.instagram.searchPosts(brand, { limit: 100 }),
]);
const all = [...twitter.data, ...reddit.data, ...instagram.data];
console.log(`Found ${all.length} mentions across platforms`);Step 3: Dedupe and normalize
The same mention can surface more than once — reposts, quote tweets, crossposts. Keying by post id collapses duplicates before you score or alert on them.
const byId = new Map();
for (const mention of all) {
if (!byId.has(mention.id)) byId.set(mention.id, mention);
}
const unique = Array.from(byId.values());Step 4: Score basic sentiment
Start simple. A keyword heuristic is enough to triage the first batch; swap it for a proper sentiment library or an LLM call when you need nuance. The shape of the output stays the same.
const scored = unique.map((m) => ({
...m,
sentiment: quickSentiment(m.text),
}));
function quickSentiment(text) {
const negatives = ["bad", "broken", "terrible", "hate", "worst", "broken"];
const lower = text.toLowerCase();
return negatives.some((w) => lower.includes(w)) ? "negative" : "neutral-or-positive";
}Step 5: Alert on what matters
Pipe the scored mentions into whatever notification channel your team already uses — Slack, email, PagerDuty, or a daily digest cron. Keep alert volume sane by filtering to the sentiment class you care about.
const alerts = scored.filter((m) => m.sentiment === "negative");
if (alerts.length > 0) {
await sendSlackAlert(`${alerts.length} negative mentions today`, alerts);
}
async function sendSlackAlert(message, items) {
await fetch(process.env.SLACK_WEBHOOK_URL, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ text: `${message}\n${items.slice(0, 5).map((i) => `- ${i.text}`).join("\n")}` }),
});
}Next steps
Go deeper once your first sweep is running.
Brand Monitoring API reference
Endpoint-by-endpoint reference for the brand monitoring surface across all four platforms.
Read moreReal-time Brand Monitoring Dashboard
Recipe for streaming mentions into a single live dashboard as they happen.
Read moreSDK reference
Full TypeScript and Python SDK reference with typed methods for every platform.
Read moreFrom Claude Code, Codex, or Gemini CLI
If you're building with an agent instead of writing code directly.
Claude Code
Run the same brand monitoring workflow through Claude Code as natural-language commands.
See integrationCodex
Drive XPOZ from the Codex CLI — search, dedupe, and alert without writing application code.
See integrationGemini CLI
Use Gemini CLI to orchestrate mention sweeps and send summaries on demand.
See integrationFrequently asked questions
Ship your brand monitoring tool today.
Free tier includes 100,000 results per month. Scale to Pro at $20/month or Max at $200/month when you are ready.
