Social media monitoring API: Build custom brand listening and alert systems

How to build social media monitoring and brand listening systems using APIs — the landscape of monitoring tools, native platform search endpoints, and how to close the loop from detection to publishing with Postproxy.

Social media monitoring API: Build custom brand listening and alert systems

Monitoring is the other half of the social media stack

Most developers building social media tools start with publishing. You automate posting, scheduling, cross-platform delivery. But publishing is only half the picture. The other half is knowing what is being said — about your brand, your competitors, your industry — across the platforms you publish to.

Social media monitoring (also called brand listening or social listening) means programmatically tracking mentions, keywords, hashtags, and sentiment across social networks. If publishing is the outbound channel, monitoring is the inbound one.

The challenge is familiar: every platform handles this differently. Some expose search endpoints. Some require firehose access. Some expose nothing useful at all. And the third-party monitoring APIs that aggregate this data have their own pricing, coverage gaps, and integration quirks.

This article covers the monitoring API landscape — what is available natively, what the dedicated monitoring tools offer, and how to connect monitoring to action by closing the loop with publishing.


What each platform exposes natively

X / Twitter (API v2)

X has the strongest native search capabilities of any social platform. The GET /2/tweets/search/recent endpoint lets you search tweets from the last 7 days using a powerful query language:

Terminal window
curl "https://api.x.com/2/tweets/search/recent?query=%22your+brand%22+-is:retweet&tweet.fields=created_at,public_metrics,author_id&max_results=100" \
-H "Authorization: Bearer {token}"

The query language supports boolean operators, exact phrases, author filters, entity filters, conversation threading, and more. You can track mentions of your brand, monitor competitor names, or watch for specific hashtags.

The catch: The Free tier gets 1 request per 15-minute window and only searches the last 7 days. Basic ($200/month) gets 60 requests per 15 minutes. Full archive search — going back to Twitter’s founding — requires the Academic Research or Enterprise tier.

For real-time monitoring, X offers Filtered Stream (POST /2/tweets/search/stream/rules) which pushes matching tweets to you as they are posted. This is the most powerful native monitoring capability on any platform, but it requires a Pro or Enterprise tier.

Reddit (Data API)

Reddit’s search API is surprisingly useful for brand monitoring. The GET /search.json endpoint searches across all subreddits:

Terminal window
curl "https://www.reddit.com/search.json?q=%22your+brand%22&sort=new&limit=100&t=week"

For monitoring specific subreddits:

Terminal window
curl "https://www.reddit.com/r/SaaS/search.json?q=%22your+brand%22&restrict_sr=on&sort=new"

Reddit also supports comment search through the API, which is valuable — brand mentions on Reddit often happen in comment threads, not top-level posts. Rate limits are 100 requests per minute for OAuth-authenticated apps.

LinkedIn

LinkedIn does not expose a public search API for posts. The Marketing API has some mention tracking for organization pages, but it is limited to direct @mentions — not keyword monitoring. There is no way to search LinkedIn posts for arbitrary terms through the API.

For LinkedIn monitoring, you need a third-party tool.

Instagram and Facebook (Meta Graph API)

Meta’s Graph API provides hashtag search for Instagram (GET /{hashtag-id}/recent_media) and page mention tracking, but no general keyword search. You can monitor who mentions your brand’s Instagram account (GET /me/tags), but you cannot search Instagram for posts containing a keyword.

Facebook’s page feed includes mentions and comments on your content, but there is no cross-platform keyword search.

TikTok

TikTok’s Research API provides keyword search, but access is restricted to approved academic and research institutions. Commercial access to TikTok search is not available through the official API.

YouTube (Data API v3)

YouTube’s search endpoint supports keyword queries:

Terminal window
curl "https://www.googleapis.com/youtube/v3/search?part=snippet&q=%22your+brand%22&type=video&order=date&maxResults=50&key={api_key}"

This returns videos matching your query, sorted by date. You can filter by channel, region, and publish date. The Data API v3 has a quota of 10,000 units per day by default, and each search request costs 100 units — so you get 100 searches per day on the free tier.


The monitoring API landscape

When native platform endpoints are not enough — and for most monitoring use cases, they are not — dedicated monitoring APIs fill the gap.

Brandwatch

Brandwatch is the enterprise standard. Their API provides access to historical and real-time social data across Twitter/X, Reddit, YouTube, forums, blogs, news sites, and review platforms. It includes sentiment analysis, topic classification, and demographic breakdowns.

The API uses a query-based model: you define boolean queries, and Brandwatch continuously collects matching content. Results are accessible via REST endpoints with filtering, aggregation, and export capabilities.

Pricing starts in the thousands per month. Brandwatch targets enterprise teams with large monitoring needs. If you are building a monitoring feature for a SaaS product, the per-seat pricing model does not map well to multi-tenant architectures.

Mention

Mention provides a more accessible monitoring API. It covers Twitter/X, Facebook, Instagram, Reddit, YouTube, forums, blogs, and news. The API returns mentions matching your configured alerts:

Terminal window
curl "https://web.mention.com/api/accounts/{account_id}/alerts/{alert_id}/mentions" \
-H "Authorization: Bearer {token}"

Each mention includes the source platform, author information, text content, sentiment score, and metadata. Mention supports webhooks — you can receive real-time notifications when new mentions match your alert criteria.

Pricing starts around $49/month for a limited number of alerts and mentions. More practical for small teams and SaaS builders than Brandwatch.

Talkwalker (now Hootsuite Listening)

Talkwalker, acquired by Hootsuite, covers 150 million sources including social, news, blogs, forums, and podcasts. Their API supports topic detection, sentiment analysis, image recognition (detecting brand logos in images), and competitive benchmarking.

Access is enterprise-only and requires a sales conversation.

Social Searcher API

Social Searcher provides a lightweight, developer-friendly API for real-time social search across multiple platforms. It is the most affordable option for developers who need basic monitoring without enterprise contracts:

Terminal window
curl "https://api.social-searcher.com/v2/search?q=%22your+brand%22&network=web,twitter,facebook&key={api_key}"

Returns matching posts with platform, author, timestamp, and basic sentiment. Pricing starts with a free tier (100 searches/day) and paid plans from $3.49/month.

The trade-off: less historical depth and lower coverage compared to Brandwatch or Mention.


Building a monitoring system: the architecture

A practical monitoring system has four components:

  1. Data collection — Platform APIs + monitoring APIs
  2. Processing pipeline — Dedup, classify, score sentiment
  3. Storage + alerting — Database, notification rules
  4. Action layer — Respond, publish, escalate

Data collection

Pull from multiple sources on a schedule. Mix native platform APIs (where available) with a dedicated monitoring tool for broader coverage:

// Collect mentions from multiple sources
async function collectMentions(query) {
const mentions = [];
// X/Twitter native search (last 7 days, most granular)
const xResults = await searchX(query);
mentions.push(...xResults.map(tweet => ({
source: 'twitter',
id: tweet.id,
text: tweet.text,
author: tweet.author_id,
created_at: tweet.created_at,
metrics: tweet.public_metrics,
url: `https://x.com/i/status/${tweet.id}`
})));
// YouTube search (video mentions)
const ytResults = await searchYouTube(query);
mentions.push(...ytResults.map(video => ({
source: 'youtube',
id: video.id.videoId,
text: video.snippet.title + ' ' + video.snippet.description,
author: video.snippet.channelTitle,
created_at: video.snippet.publishedAt,
url: `https://youtube.com/watch?v=${video.id.videoId}`
})));
// Mention API (broader coverage: Instagram, Facebook, Reddit, forums, news)
const mentionResults = await searchMention(query);
mentions.push(...mentionResults.map(m => ({
source: m.source_name,
id: m.id,
text: m.title + ' ' + m.description,
author: m.author_name,
created_at: m.published_at,
sentiment: m.sentiment,
url: m.original_url
})));
return deduplicate(mentions);
}

Processing

Raw mentions need filtering. Not every mention of your brand name is relevant — especially if your brand name is a common word. A processing pipeline handles deduplication, relevance scoring, and sentiment classification:

function processMentions(mentions) {
return mentions
.filter(m => isRelevant(m.text)) // drop false positives
.map(m => ({
...m,
sentiment: m.sentiment || classifySentiment(m.text),
priority: calculatePriority(m)
}))
.sort((a, b) => b.priority - a.priority);
}
function calculatePriority(mention) {
let score = 0;
if (mention.sentiment === 'negative') score += 10; // negative mentions need attention
if (mention.metrics?.like_count > 100) score += 5; // high-engagement mentions amplify
if (mention.source === 'twitter') score += 2; // real-time platform, faster response needed
return score;
}

Alerting

Route high-priority mentions to the right people. A negative mention with high engagement needs immediate attention. A neutral brand mention in a blog post can wait for the weekly digest:

async function routeAlert(mention) {
if (mention.priority >= 10) {
// High priority: Slack notification + email
await sendSlackAlert('#brand-alerts', formatMention(mention));
await sendEmail('[email protected]', 'Urgent brand mention', formatMention(mention));
} else if (mention.priority >= 5) {
// Medium priority: Slack only
await sendSlackAlert('#brand-monitoring', formatMention(mention));
} else {
// Low priority: log for weekly digest
await db.insertMention(mention);
}
}

Closing the loop: from monitoring to publishing

Here is where monitoring systems typically fall short. You detect a trending conversation about your brand. You identify a negative review gaining traction. You spot a question from a potential customer. Now what?

In most monitoring setups, the answer is: someone manually switches to a publishing tool, drafts a response, and posts it. The detection is automated. The response is not.

Monitoring without action is half a system. The value of knowing what people are saying is in being able to respond — quickly, across the right platforms, at the moment when the conversation is still live.

The detect-respond-publish pattern

Connect your monitoring pipeline to Postproxy to close the loop programmatically:

async function handleMention(mention) {
// 1. Detect: high-priority negative mention on X
if (mention.priority >= 10 && mention.source === 'twitter') {
// 2. Generate response (or pull from approved templates)
const response = await generateResponse(mention);
// 3. Publish response via Postproxy
const post = await fetch('https://api.postproxy.dev/api/posts', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
post: { body: response },
profiles: ['twitter']
})
});
// 4. Log the response for audit trail
await db.logResponse({
mention_id: mention.id,
response_post_id: post.id,
responded_at: new Date().toISOString()
});
}
}

When to automate vs. when to approve

Full automation — detect mention, generate response, publish immediately — is risky for public-facing social communication. A misclassified sentiment or a poorly generated response can escalate a situation instead of resolving it.

A safer pattern is detect-draft-approve-publish. Use Postproxy’s draft workflow to stage responses for human review:

async function handleMentionWithApproval(mention) {
const response = await generateResponse(mention);
// Create as draft — requires manual approval before publishing
const draft = await fetch('https://api.postproxy.dev/api/posts', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
post: {
body: response,
status: 'draft'
},
profiles: ['twitter']
})
});
// Notify the team with a link to approve
await sendSlackAlert('#brand-responses', {
mention: formatMention(mention),
draft_response: response,
approve_url: `https://app.postproxy.dev/posts/${draft.id}`
});
}

The team reviews the draft, edits if needed, and publishes with one click or a POST /api/posts/{id}/publish call. The monitoring system did the detection and drafting. A human made the judgment call.

Trend detection and proactive publishing

Monitoring is not only reactive. Trend detection — spotting topics gaining momentum before they peak — creates publishing opportunities:

async function detectTrends(mentions, timeWindowHours = 4) {
const recent = mentions.filter(m =>
new Date(m.created_at) > new Date(Date.now() - timeWindowHours * 3600000)
);
// Group by topic/keyword and find spikes
const topicCounts = {};
for (const mention of recent) {
const topics = extractTopics(mention.text);
for (const topic of topics) {
topicCounts[topic] = (topicCounts[topic] || 0) + 1;
}
}
// Compare to baseline (previous 7-day average for same window)
const trending = [];
for (const [topic, count] of Object.entries(topicCounts)) {
const baseline = await db.getBaselineCount(topic, timeWindowHours);
if (count > baseline * 3) { // 3x spike threshold
trending.push({ topic, count, baseline, multiplier: count / baseline });
}
}
return trending.sort((a, b) => b.multiplier - a.multiplier);
}

When a trend is detected, you can generate timely content and publish it across platforms while the topic is still rising:

async function publishTrendResponse(trend) {
const content = await generateTrendContent(trend.topic);
await fetch('https://api.postproxy.dev/api/posts', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
post: { body: content },
profiles: ['twitter', 'linkedin', 'threads']
})
});
}

The monitoring system becomes an input to the publishing system. Detection feeds creation.


Monitoring API comparison

X Native SearchYouTube SearchMentionBrandwatchSocial Searcher
PlatformsX onlyYouTube only10+ platforms100M+ sources10+ platforms
Real-timeFiltered StreamNoWebhooksYesPolling
Historical depth7 days (Basic)Full archiveVaries by planYears30 days
SentimentNoNoYesYes (advanced)Yes (basic)
PricingFree–$5K+/moFree (quota)$49+/mo$1K+/moFree–$100/mo
Best forX-focused monitoringVideo mentionsMid-marketEnterpriseBudget/prototyping

Practical considerations

Start narrow. Monitor one or two platforms where your audience is most active. Expand coverage once you have a working pipeline. Trying to monitor everything on day one leads to noisy data and alert fatigue.

Deduplicate aggressively. The same content appears across multiple sources — a tweet quoted in a blog post, a Reddit thread shared to X, a YouTube comment summarizing a news article. Without dedup, your mention counts are inflated and your team responds to the same signal multiple times.

Set sentiment thresholds carefully. Automated sentiment analysis is imperfect. A sarcastic compliment reads as positive. A feature request reads as negative. Use sentiment as a sorting signal, not a classification. Human review catches what algorithms miss.

Rate limit your responses. An automated system that replies to every mention looks like a bot — because it is one. Set cooldown periods, cap daily response volume, and ensure variety in your published responses.

Store everything. Even mentions you do not act on today are valuable for trend analysis, competitive intelligence, and content strategy. Storage is cheap. Missing a signal because you filtered too aggressively is expensive.


The full social media developer stack

Monitoring and publishing are complementary capabilities. A monitoring API tells you what is happening. A publishing API lets you do something about it.

For developers building social media tools — agency dashboards, brand management platforms, AI-powered social assistants — the stack looks like this:

Inbound (monitoring): What is being said, by whom, with what sentiment, at what velocity — powered by Mention, Brandwatch, native platform APIs, or whatever fits your budget.

Outbound (publishing): Responses, proactive content, cross-platform distribution — powered by Postproxy.

Postproxy handles the publishing layer — one API call to publish across Instagram, X, LinkedIn, TikTok, YouTube, Threads, Facebook, and Pinterest. Pair it with a monitoring API that fits your budget and coverage needs, and you have the full loop: listen, understand, respond, publish.

Start building with Postproxy and connect it to your monitoring pipeline.

Ready to get started?

Start with our free plan and scale as your needs grow. No credit card required.