Complaint Radar calls GET /twitter for brand and complaint terms, then optionally calls GET /twitter/replies/post for selected posts. Give it a brand name and it returns a short morning report of public Twitter complaints about it, sorted by theme and by how much attention each post got.
The problem
Customers often complain in public before they open a ticket. Reading every mention by hand takes time, and most mentions are not complaints at all. Teams need a quick daily view: what are people unhappy about, is it growing, and which posts are getting the most attention.
What the app does
- Takes a brand name, other names for it, and the brand's own support account to leave out.
- Searches recent public X posts that pair the brand with complaint words such as "not working", "refund" or "can't log in".
- Removes reposts, duplicate posts and the brand's own posts.
- Sorts each post into a theme: outage, account, billing, bug, support, feature request or other.
- Writes a Markdown report: posts per theme, volume per day, the top posts by engagement, and the loudest posts per theme.
- Saves a JSON snapshot with every post and every API call, plus the total cost of the run.
How it works
- Build the search. The script turns your input into one X search query, for example
(PlayStation OR PSN) ("not working" OR refund OR outage ...) -from:AskPlayStation. The query supports X search operators such asOR, quotes,-wordandfrom:. - Search one day at a time. For each day it calls
GET /twitterwithsort=Latestand a start and end date. If a page is full, it asks for the next page. - Optional replies. For the top complaint posts it calls
GET /twitter/replies/postto show what other people answered. - Sort locally. Simple keyword rules assign a theme. Engagement score is likes + 2 x replies + reposts + quotes + bookmarks.
- Write the report and add up the cost from the
X-Desearch-Cost-Usdresponse header.
API details
Verified against the live OpenAPI specification on 2026-11-25. These are schema fields, not a captured run.
The complaint collector sends query, sort=Latest, count, start_date, and end_date to the search route, adding lang only when configured. Its optional reply lookup sends post_id=r["id"] and count=20. Theme assignment and the engagement formula run locally; the API does not return a complaint category.
These required fields from TwitterScraperTweet are the inputs to that engagement formula, trimmed from the search response schema:
Current API limit: GET /twitter has no pagination. Supplying cursor returns 422 and is not charged. The older collector adds max_id to the query when a page is full; that is not a supported pagination contract today. The optional post replies are a best-effort sample for large threads, so the complaint report cannot claim every response under a busy post.
API reference: GET /twitter, GET /twitter/replies/post. Related walkthrough: Social media monitoring with Desearch.
The code
The core call is one HTTP request:
The repo folder has one script, complaintradar.py (about 380 lines: query builder, day-by-day paging, themes, report writer), and offline tests in test_complaintradar.py.
Endpoints
GET /twitterGET /twitter/replies/post
Example output
From a run for PlayStation on 2026-10-08, covering 3 days (2026-10-06 to 2026-10-08 UTC). 123 posts after removing duplicates.
| Theme | Posts | Share |
|---|---|---|
| bug | 59 | 48% |
| billing | 27 | 22% |
| outage | 18 | 15% |
| support | 4 | 3% |
| account | 1 | 1% |
| other | 14 | 11% |
The full report also lists posts per day, the 10 complaint posts with the most engagement, and the loudest posts in each theme, each with a link to the post.
Run it yourself
The public examples folder linked above includes the script and a README. Install its requirements, set DESEARCH_API_KEY from console.desearch.ai, and use the run command in that README.
Useful flags: --days (how many days back), --keywords (your own complaint words), --exclude (words to filter out), --max-spend (stop at a dollar limit, default $0.10).
What it costs
The example run above made 10 API calls (7 searches returning 127 posts and 3 reply lookups) and cost $0.028, read from the X-Desearch-Cost-Usd header on 2026-10-08. A full page of 20 posts cost $0.003. See pricing.
Ideas to extend it
- Run it every morning with cron and send the report to a team chat.
- Track two or three brands side by side to compare complaint themes.
- Replace the keyword themes with an LLM classifier for more nuance.
- Alert when a theme jumps above its usual daily count.
