Skip to content

USE CASE

Twitter API for Social Listening

Updated July 2026

What is a social listening API and how do you build one on X?

A social listening API is a search endpoint that returns every public post matching a query, so you can measure a whole category conversation rather than only the posts that tag you. On X you run boolean, date-bounded queries against one REST search endpoint, split into lanes for the category, the named brands and your own mentions, then divide your counts by the set total to get share of voice. TwitterAPIs serves it at $0.0008 per call with no developer account, no monthly plan, and one flat ceiling of 600 requests a minute per key.

How the numbers on this page were produced

Written by Emma, TwitterAPIs developer relations

Every cost below is call arithmetic against one contractual number, the flat $0.0008 per read call on our published pricing. Cadence times query count times days gives calls, and calls times the rate gives the bill. Nothing here is a plan price or a modelled per-mention rate, because we do not charge one. On yield, per our own billed-call measurement, 7.62 tweets came back on an average keyword-search call across 396,817 read calls between August 13 and 17 2026, so a panel should budget against calls rather than against the 20-tweet page ceiling.

Listening is a category question, not a brand question

Brand monitoring answers what people are saying about us. Social listening answers what is happening in our market, and the difference is not a matter of degree. The listening corpus includes every conversation where nobody names a vendor at all: somebody describing the problem, asking the room for a recommendation, or complaining about a workaround they built themselves. Those are the tweets you can still influence.

In practice that means a listening panel is several queries rather than one, and the category lane is almost always the largest and the least watched. A brand-only setup will report a quiet week while the category argues about you by description rather than by name.

The five lanes below are the shape that has held up: one for the category, one for the named competitive set, one for direct mentions, one that goes deeper on whatever is spiking, and one that resolves authors so volume is not confused with reach. If you only want the second and third of those, a narrower watcher on your own name and handle is the cheaper build.

The five lanes of a listening panel

LaneWhat it capturesEndpointTypical cadence
Category conversationEvery tweet about the problem your product solves, whoever is named in itGET /twitter/tweet/advanced_searchHourly
Named brandsYour handle and your rivals, so a share figure has something to divide byGET /twitter/tweet/advanced_searchEvery 15 minutes
Owned mentionsTweets that tag you directly, including ones the category query missesGET /twitter/user/mentionsEvery 5 minutes
Thread depthReplies and quotes under whatever is spiking, where the real argument sitsGET /twitter/tweet/replies, GET /twitter/tweet/quotesOn spike
Voice qualityAuthor resolution so a handful of loud accounts cannot pass as a trendGET /twitter/user/infoOn new author

Every lane authenticates with the same Bearer key and bills at the same flat $0.0008, so the panel shape is an engineering decision rather than a pricing one.

Compute share of voice across a competitive set

The sample below pulls the identical bounded window for every brand in the set, counts mentions and engagement, and returns both shares side by side. The window is passed once and reused for every brand, which is the part most implementations get wrong.

import requests

API = "https://api.twitterapis.com/twitter/tweet/advanced_search"
HEADERS = {"Authorization": "Bearer YOUR_API_KEY"}

def pull(query, since, until, max_pages=40):
    """One brand, one bounded window. The window is a parameter so every
    brand in the set is measured over exactly the same period."""
    seen, cursor = {}, None
    bounded = f"{query} since:{since} until:{until} -filter:retweets lang:en"
    for _ in range(max_pages):
        params = {"query": bounded, "product": "Latest"}
        if cursor:
            params["cursor"] = cursor
        res = requests.get(API, params=params, headers=HEADERS, timeout=30).json()
        for tweet in res.get("tweets") or []:
            seen[tweet["id"]] = tweet
        if not res.get("has_next_page"):
            break
        cursor = res.get("next_cursor")
    return list(seen.values())

def share_of_voice(brands, since, until):
    rows = {}
    for name, query in brands.items():
        tweets = pull(query, since, until)
        rows[name] = {
            "mentions": len(tweets),
            "engagement": sum(
                (t.get("likeCount") or 0) + (t.get("retweetCount") or 0)
                for t in tweets
            ),
        }
    total_m = sum(r["mentions"] for r in rows.values()) or 1
    total_e = sum(r["engagement"] for r in rows.values()) or 1
    for name, r in rows.items():
        r["mention_share"] = round(100 * r["mentions"] / total_m, 1)
        r["engagement_share"] = round(100 * r["engagement"] / total_e, 1)
    return rows

SET = {
    "us":      '"acme cloud" OR @acmecloud',
    "rival_a": '"beta stack" -"beta stack overflow"',   # exclude the collision
    "rival_b": '"gamma db"',
}

for brand, row in share_of_voice(SET, "2026-08-17", "2026-08-24").items():
    print(f"{brand:<8} {row['mentions']:>5} mentions  "
          f"{row['mention_share']:>5}% voice  {row['engagement_share']:>5}% engagement")

Note the exclusion on the second rival. A brand whose name collides with a common phrase will inflate the set total, which shrinks your share without anything looking broken. Read a sample of each rival query by hand before you publish a share number.

Four share-of-voice metrics, and what each one hides

MetricFormulaReads neededWhat it hides
Mention shareYour mentions divided by all brand mentions in the setOne search call per brand per intervalA rival with a generic name inflates on false matches, so exclude aggressively
Engagement shareYour likes plus reposts divided by the same total across the setSame calls, engagement counts already in the payloadOne viral post distorts a week, so report median beside mean
Reach-weighted shareMentions weighted by each author's follower countAdds one user/info call per unseen authorFollower count is not impressions, so treat it as a proxy and say so
Positive shareYour positively scored mentions over all positive mentions in the setSame calls plus a local scoring passNeeds a sentiment step, and inherits every one of its failure modes

Report at least two of these together. Mention share alone rewards noise, and engagement share alone rewards one lucky post.

What a listening panel actually costs

PanelCallsCostShape
Single-brand listening, 4 queries hourly96 calls a day, about 2,920 a monthAbout $2.34 a monthOne brand, its category, and two rivals
Competitive panel, 12 queries every 15 minutes1,152 calls a day, about 35,000 a monthAbout $28 a monthFull share-of-voice set at quarter-hour resolution
Agency multi-client, 50 queries hourly1,200 calls a day, about 36,500 a monthAbout $29 a monthTen clients, five queries each
Launch week war room, 20 queries every 5 minutes5,760 calls a dayAbout $4.61 a dayBurst cadence, switched back down afterwards

Each row is cadence times queries times days times $0.0008. Model your own on the cost calculator.

What a listening panel cannot see

Protected accounts. Posts from private accounts are not public data and appear in no listening product, ours included. On a niche category this can be a meaningful slice of the practitioners talking.

Anything deleted before your poll. A post removed inside your polling interval never enters the corpus. Shorter intervals narrow the gap and never close it, which is worth remembering when the deleted posts are the ones that mattered.

Conversation your query did not describe. This is the largest blind spot by far and the only one you control. A category is described in words you did not think of, so re-read a raw sample monthly and harvest the vocabulary your query is missing rather than trusting a term list written once.

Other networks. This is an X API. If your category argues on several networks, this panel is one input rather than the whole picture, and a share-of-voice number computed here should be labelled as X-only rather than as social.

Impressions. Follower counts are a reach proxy, not a measurement of who saw a post. Weight by them if it helps, and never publish the result as if it were an impression count.

API, listening suite, or the official X API

OptionPriceControlCoverageLock-in
TwitterAPIs$$0.0008 per call, no monthly floorYou own the queries, the scoring and the storageX only, in depth, including replies and quotesNone, it is a REST endpoint and your own database
Listening SaaS suitesCommonly $300 to $2,000 a month plus per-mention feesTheir query language, their sentiment model, their dashboardMany networks at once, usually shallower on eachHistory lives in their account and leaves with your contract
Official X APIFrom about $0.005 per post readFull control, but you build everything anywayX only, gated by tierDeveloper account, app review, per-endpoint windows

A suite is the right answer when you need many networks and nobody to maintain it. An API is the right answer when you need X in depth, want to own the history, or are paying per mention for volume you could pull for a few dollars.

By the numbers

Social listening on X, by the numbers

TwitterAPIs figures resolve to our published pricing. Every X figure is vendor-documented.

  • TwitterAPIs bills every listening query at a flat $0.0008 per call, with no monthly plan and no per-mention fee. (TwitterAPIs pricing, 2026)

  • A twelve-query competitive panel polled every 15 minutes is 1,152 calls a day, which is about $28 a month at the published rate. (TwitterAPIs pricing, 2026)

  • A new account starts with $0.50 in credit and no card, enough to run a four-query panel hourly for roughly six days before you spend anything. (TwitterAPIs pricing, 2026)

  • One flat ceiling of 600 requests a minute and 20 concurrent per key applies across every endpoint, with no per-endpoint window to plan around. (TwitterAPIs docs, 2026)

  • The official X API meters post reads from about $0.005 per resource, one item per request, under its pay-per-use model. (X Developer Platform, 2026)

  • The official X API enforces per-endpoint rate limits in fixed 15-minute windows, and pay-per-use is hard-capped at 3 million reads per monthly billing cycle. (X API docs, 2026)

Social listening, common questions

A social listening API returns the public posts matching a query so you can measure a whole category conversation rather than only the posts that tag you. On X that is GET /twitter/tweet/advanced_search with boolean operators, date bounds and language filters, returning structured JSON with the text, engagement counts, timestamp and author object on every record. TwitterAPIs bills it at a flat $0.0008 a call with no monthly plan, no developer account and one flat ceiling of 600 requests a minute per key.

Run the same query shape for every brand in the competitive set over the same bounded window, then divide your count by the total. The two things that break it are unequal windows and unequal query quality. Pin every brand to identical since and until bounds, because comparing a 72-hour pull against a 24-hour pull produces a number that is arithmetically perfect and completely wrong. Then check each rival query for false matches, since a brand with a common word for a name inflates the set total and silently shrinks your share.

Poll rather than stream. Run your queries in Latest mode on a short interval and de-duplicate on tweet id between passes. At 600 requests a minute per key you can hold a large panel at five-minute resolution comfortably. There is no separate streaming contract to buy, and burst cadence is a config change rather than a plan upgrade, so a launch week can run at five-minute resolution and drop back afterwards without touching a billing page.

Three operators do most of the work. Use quoted phrases for multi-word brands so the words must appear together. Use minus terms to exclude the collisions you can predict, which matters most for brands whose name is also a common word. Use -filter:retweets so one travelling post does not count as hundreds of separate voices. Then sample a hundred results by hand before you trust the count, because a query nobody has eyeballed is a number nobody should publish.

Brand monitoring watches your own name and answers what people are saying about us. Social listening watches the whole category and answers what is happening in our market, including every conversation where nobody mentions you at all. The second set is larger and usually more useful, because a buyer describing the problem you solve without naming any vendor is the conversation you can still win. Both run on the same search endpoint; the difference is the query and the size of the corpus.

Every call is a flat $0.0008. A single-brand panel of four queries polled hourly is 96 calls a day, about $2.34 a month. A twelve-query competitive panel at quarter-hour resolution is roughly $28 a month. An agency running fifty queries hourly across ten clients lands near $29 a month. Compare that with the packaged listening suites, which commonly run $300 to $2,000 a month before per-mention fees, and the tradeoff is engineering time against subscription cost.

No. The API returns public posts only, so protected accounts, direct messages and anything deleted before your poll ran are outside what any listening tool can see, ours included. That is a real coverage limit rather than a product gap, and it applies equally to every vendor in this category. Practically it means a listening panel is a sample of public conversation, and any share-of-voice figure you publish should say so.

Yes. advanced_search accepts since and until bounds, so you can rebuild a category conversation for a past quarter, a competitor launch or a market event, and establish a baseline before your panel went live. Historical windows bill at the same flat $0.0008 per call as live queries, with no archive tier to unlock and no separate contract.

Related use cases

Point the same panel at rivals and it becomes competitor analysis. Every workload is indexed on the Twitter API use cases hub.

Stand up a listening panel this week

$0.0008 per call, $0.50 in free credit, no card and no X developer account.