How to Track Twitter Mentions of Any Account via API
Every day, thousands of conversations happen around your brand on X (formerly Twitter) that you never see. Users tag your handle to report bugs, praise your product, ask questions, or vent frustrations - and most of these mentions disappear into the timeline within minutes. For competitors, the story is the same: their customers are publicly sharing exactly what they love and hate, and that intelligence is sitting there, uncollected. The Sorsa API/mentions endpoint turns this stream of public conversation into structured, filterable data. Point it at any public handle, set engagement thresholds to cut through spam, define a date window, and get back clean JSON with full tweet content and author profiles. This guide covers everything from your first API call to production workflows for brand monitoring, support triage, competitive auditing, and campaign measurement.
Quick Start: Your First Mention Query
Before we dive into parameters and workflows, here is the fastest path to pulling mentions. This single cURL command fetches recent high-engagement mentions of any account:Tip: You can also test this endpoint without writing code using the API Playground.Now let’s look at what you can do with the full parameter set.
Endpoint Reference
| Parameter | Type | Required | Description |
|---|---|---|---|
query | string | Yes | The handle to track, without the @ symbol. Example: "elonmusk" |
order | string | No | "latest" (default, chronological) or "popular" (engagement-ranked). |
since_date | string | No | Start date in YYYY-MM-DD format. |
until_date | string | No | End date in YYYY-MM-DD format. |
min_likes | integer | No | Minimum likes a mention must have. |
min_retweets | integer | No | Minimum retweets a mention must have. |
min_replies | integer | No | Minimum replies a mention must have. |
next_cursor | string | No | Pagination cursor from a previous response. |
next_cursor is present, more pages are available. When it is null or absent, you have reached the end.
When to Use /mentions vs. /search-tweets
Both endpoints can surface tweets that reference a brand or account, but they solve different problems:
Use /mentions when you want everything directed at a specific handle. The endpoint is tuned for this - it catches @-tags, replies, and references that a keyword search might miss. The built-in min_likes, min_retweets, min_replies, since_date, and until_date parameters make it cleaner to build programmatic queries without encoding engagement filters as search operators inside a query string.
Use /search-tweets when you want to track a brand name that people mention without tagging (e.g., users writing “I love Nike” without the @). For that, you would search for "Nike" -from:Nike lang:en using the search endpoint. You should also use /search-tweets when you need complex Boolean logic that goes beyond what /mentions supports - combining multiple keywords, excluding specific terms, filtering by media type, etc. See Search Tweets for the full guide.
In many production setups, you use both: /mentions to catch direct @-tags and /search-tweets to catch “dark mentions” where users talk about your brand without tagging you. Together, they give you complete coverage.
Scenario 1: Reputation Dashboard for a Brand
You manage social for a consumer brand that gets hundreds of mentions daily. Most are bot tags, spam, and zero-engagement noise. You need a dashboard showing only the mentions that actually matter - the ones other people are seeing and reacting to.Python Implementation
min_likes: 100 with order: "popular" gives you a clean feed of mentions that have actual audience reach. For a smaller brand, drop the threshold to 5 or 10.
JavaScript Implementation
Scenario 2: Customer Support Queue
Support accounts need the opposite strategy: catch every mention, including ones with zero engagement, because each one could be a customer waiting for help. The key parameters here areorder: "latest" (chronological) and no engagement filters.
Scenario 3: Measuring Campaign Impact
After a product launch or marketing push, you need to answer: how many people talked about us, how much engagement did those mentions generate, and who were the loudest voices?Scenario 4: Competitive Benchmarking
Thequery parameter accepts any public handle, not just your own. Run identical analysis on multiple competitors to compare public attention and sentiment.
Exporting Mentions to CSV
For serious analysis - pivot tables, sentiment classification, time series charts - you need the data in a flat file. Here is a complete export script:Real-Time Mention Alerts via Slack
Combine the/mentions endpoint with a simple polling loop to get instant Slack notifications when someone mentions your brand. This pattern is covered in depth in the Real-Time Monitoring guide, but here is the mentions-specific version:
last_seen_id to a file or database so the monitor survives restarts. Add exponential backoff for HTTP 429 errors. Route different mention types (support requests vs. praise vs. press) to different Slack channels using keyword matching.
Common Pitfalls and How to Avoid Them
Settingmin_likes too high and missing important mentions. A customer reporting a critical bug with 2 likes is more important than a meme with 500. For support use cases, always set min_likes to 0. Reserve high thresholds for reputation dashboards and trend analysis.
Forgetting to paginate. A single request returns roughly 20 mentions. If your brand gets 200 mentions a day, a single page captures only 10% of the conversation. Always loop through next_cursor until it is empty when doing analysis or export. See Pagination for patterns and code examples.
Not distinguishing between /mentions and /search-tweets results. People mention brands in two ways: by tagging (@nike) and by name without tagging (“love my new Nikes”). The /mentions endpoint only captures the first type. For full coverage, run a parallel /search-tweets query with the brand name as a keyword.
Polling too aggressively for real-time alerts. Polling every second for a brand that gets 10 mentions per day wastes requests. Match your polling interval to your mention volume: every 15 seconds for high-traffic brands, every minute or two for smaller accounts. Keep in mind the rate limit of 20 requests per second.
Not persisting last_seen_id across script restarts. If your monitoring script crashes and restarts without remembering its checkpoint, it either reprocesses old mentions (duplicate alerts) or skips the gap (missed mentions). Store the last ID in a file, Redis, or database.
Next Steps
- Search Tweets - for keyword-based monitoring that catches mentions without @-tags.
- Search Operators - combine operators with
/search-tweetsfor complex mention queries involving media filters, Boolean logic, and geo. - Real-Time Monitoring - the complete polling architecture with deduplication, backoff, and multi-source monitoring.
- Historical Data - pull mention data from months or years ago for longitudinal studies.
- API Reference - full specification for
/mentionsand all Sorsa API endpoints.