Skip to content

USE CASE

Twitter API for Lead Generation

Updated July 2026

How do you generate leads from Twitter (X) with an API?

Lead generation on X returns buyers by searching the language they use rather than your own product name. Run a search endpoint against five or six intent patterns, direct requests for a recommendation, competitor complaints, problem statements, switching signals and hiring posts, then resolve each author to qualify on role, recency and account quality before routing the survivors to outreach. TwitterAPIs serves every one of those reads at $0.0008 per call, so six queries polled hourly is about $3.50 a month with no developer account required.

How the numbers on this page were produced

Written by Emma, TwitterAPIs developer relations

Costs are call arithmetic against the flat $0.0008 per read call on our published pricing: queries times polls per day times $0.0008. The signal strength ranking in the first table is a working judgement from the shape of each pattern rather than a measured conversion rate, and it is labelled that way rather than dressed up as data we do not have. 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 an intent query returns a short page and still costs one call.

Six intent patterns, and what each one is worth

The mistake that makes X prospecting fail is searching for your own product name. People with a problem do not know your name yet, which is precisely why they are a lead. Search the language of the problem and the language of leaving a competitor instead.

PatternSounds likeSignal strengthEndpoint
Direct requestanyone know a good X for YHighest. They asked out loud, in public, right nowGET /twitter/tweet/advanced_search
Competitor complaintrival tool just raised prices againHigh. An existing budget and a live reason to move itGET /twitter/tweet/advanced_search
Problem statementspent all morning fixing our reporting againMedium. The pain is real, the shopping has not startedGET /twitter/tweet/advanced_search
Switching signalmigrating off rival next quarterHigh. A decision already made, vendor still openGET /twitter/tweet/advanced_search
Rival reply threadsThe pile-on under a competitor outage postHigh. Concentrated unhappiness with names attachedGET /twitter/tweet/replies
Hiring signalwe are hiring a data engineerMedium. Team growth often precedes tooling spendGET /twitter/tweet/advanced_search

Run all six as separate queries rather than one large boolean, so you keep the pattern label on every result. The label is what lets you route a direct request to outreach today and a hiring signal to nurture.

Writing an intent query that is not mostly noise

An intent query has three parts: the ask, the category, and the exclusions that keep vendors and bots out of your results. Missing the third part is what makes people conclude X prospecting does not work.

(recommend OR recommendations OR "looking for" OR suggestions) ("data warehouse" OR "etl tool" OR "reverse etl") -filter:retweets -filter:links lang:en -from:your_own_handle -"we build" -"check out our"
  • The ask is the request language itself. Keep it broad, because people phrase a request in many ways and this half is where recall lives.
  • The category is the subject. Keep it tight and quoted, since this half is where precision lives.
  • -filter:links is the highest-value exclusion after retweets. Most promotional posts carry a link, and most genuine questions do not.
  • Vendor exclusions remove your own team and the competitors marketing into the same keywords. Without them a prospecting feed fills with other vendors and reads as a dead channel.

A query written both directions matters more than it sounds. A pattern that only matches "looking for a data warehouse" misses "data warehouse recommendations?" entirely, and the second phrasing is at least as common. Put the ask and the category in separate groups rather than in a fixed order, which is what the example above does. The full operator reference is on the Twitter search API page.

Mine intent, qualify, and score

This runs the labelled patterns, resolves each author once, applies the qualification checks and returns a ranked queue. It keeps the pattern label on every row so downstream routing can treat a direct request differently from a hiring signal.

import re, requests
from datetime import datetime, timezone

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

CATEGORY = '("data warehouse" OR "etl tool" OR "reverse etl")'
NOISE = '-filter:retweets -filter:links lang:en -"check out our"'

PATTERNS = {
    "direct_request": f'(recommend OR recommendations OR "looking for") {CATEGORY} {NOISE}',
    "rival_complaint": f'("rival tool") (slow OR expensive OR broken OR "switching from") -from:rivaltool {NOISE}',
    "switching":       f'("migrating off" OR "moving away from") ("rival tool") {NOISE}',
    "problem":         f'("spent all day" OR "still broken" OR "wasting hours") {CATEGORY} {NOISE}',
}

# A brand account describing a problem is marketing, not a buyer.
BRANDY = re.compile(r"\b(official|we are|we're|inc\.?|ltd|hq|team)\b", re.I)

def search(query):
    res = requests.get(f"{BASE}/tweet/advanced_search",
                       params={"query": query, "product": "Latest"},
                       headers=HEADERS, timeout=30).json()
    return res.get("tweets") or []

_profiles = {}
def profile(user_name):
    if user_name not in _profiles:          # one lookup per author, not per tweet
        res = requests.get(f"{BASE}/user/info", params={"userName": user_name},
                           headers=HEADERS, timeout=30).json()
        _profiles[user_name] = res.get("data") or {}
    return _profiles[user_name]

def hours_old(created_at):
    posted = datetime.strptime(created_at, "%a %b %d %H:%M:%S %z %Y")
    return (datetime.now(timezone.utc) - posted).total_seconds() / 3600

def mine(role_terms, customers=frozenset(), max_age_h=48):
    queue = []
    for label, query in PATTERNS.items():
        for tweet in search(query):
            handle = tweet["author"]["userName"]
            if handle.lower() in customers:              # never pitch a customer
                continue
            age = hours_old(tweet["createdAt"])
            if age > max_age_h:                          # intent decays fast
                continue

            who = profile(handle)
            bio = (who.get("description") or "")
            if BRANDY.search(bio):
                continue
            if (who.get("statusesCount") or 0) < 30:     # dormant or fresh
                continue

            score = 0
            score += {"direct_request": 40, "rival_complaint": 35,
                      "switching": 35, "problem": 15}[label]
            score += 20 if age < 6 else (10 if age < 24 else 0)
            score += 20 if any(t in bio.lower() for t in role_terms) else 0
            score += 10 if (tweet.get("replyCount") or 0) == 0 else 0  # nobody replied yet

            queue.append({
                "score": score, "pattern": label, "handle": handle,
                "age_h": round(age, 1),
                "url": f"https://x.com/i/status/{tweet['id']}",
                "text": tweet["text"][:160],
            })

    return sorted(queue, key=lambda r: -r["score"])

for lead in mine(["engineer", "analytics", "data", "cto"])[:20]:
    print(lead["score"], lead["pattern"], lead["handle"], lead["url"])

The profile cache is what keeps this affordable: one busy handle matching three patterns costs one lookup rather than three. The zero-replies bonus is the part worth stealing, because a request nobody has answered yet is worth several that already collected four vendor replies.

Six qualification checks before anyone gets contacted

CheckWhere it comes fromWhy it earns its place
RecencycreatedAt on the tweetA buying-intent tweet decays fast. A week-old request has usually been answered by somebody else
Account is a person, not a branduser/info profile fieldsA company account posting about a problem is marketing. A named individual is a human with a budget
Role fitBio text on the profileThe cheapest qualification signal you have, and it is already in the payload
Account is real and activePost count and account ageFilters the fresh and dormant accounts that make an outreach list look larger than it is
Not already a customerYour own CRM, matched on handleThe check nobody builds until the first time somebody pitches an existing customer
Thread contexttweet/replies on the postIf four vendors already replied, you are late, and the reply is worth less than the research

Five of the six read fields that are already in the payload, so qualification costs one profile call per unseen author and nothing more.

What a prospecting loop costs a month

ComponentCallsCostShape
Six intent queries, hourly144 calls a day, about 4,380 a monthAbout $3.50 a monthThe standing prospecting loop
Qualify 1,000 candidates a monthAbout 1,000 profile callsAbout $0.80One profile lookup per unseen author
Thread context on the top 200About 200 callsAbout $0.16Only on candidates that already cleared scoring
Rival complaint mining, 3 rivals hourly72 calls a day, about 2,190 a monthAbout $1.75 a monthThe highest-conversion lane in most setups

The whole setup is roughly $6 a month. Tightening the intent loop from hourly to every 15 minutes takes the first row from about $3.50 to about $14, which is the only lever here that meaningfully moves the bill. Model it on the cost calculator.

What this will not do for you

It does not return email addresses. The API returns public posts and public profile fields. There is no contact detail in the payload, so the reply path is a public reply or a direct message, not an email sequence.

Volume is smaller than you expect, and that is correct. A tight intent query in a niche category returns a handful of genuinely qualified people a day, not hundreds. A query returning hundreds is almost always matching vendors and noise, and the fix is a better exclusion list rather than a bigger list.

Speed matters more than coverage. A public request is usually answered within hours. Being second is worth much less than being first, which is why cadence is the lever worth spending on rather than query count.

Collection and outreach are different decisions. Reading public data is one question. What you may send, to whom, and with what disclosure is governed by the platform terms and by the law where you and the recipient are. Take advice on that before sending at volume rather than after.

By the numbers

Prospecting on X, by the numbers

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

  • TwitterAPIs bills every search and profile call at a flat $0.0008, with no plan tier and no per-lead fee. (TwitterAPIs pricing, 2026)

  • Six intent queries polled hourly is 144 calls a day, about $3.50 a month at the published rate. (TwitterAPIs pricing, 2026)

  • Tightening the same six queries from hourly to every 15 minutes is 576 calls a day, which moves the monthly figure from about $3.50 to about $14. (TwitterAPIs pricing, 2026)

  • A new account starts with $0.50 in credit and no card, enough to run a six-query intent loop hourly for several days before you spend anything. (TwitterAPIs pricing, 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, which bounds how tight a prospecting loop can run. (X API docs, 2026)

Lead generation, common questions

Search for the language buyers use rather than for your own product name. Run GET /twitter/tweet/advanced_search on five or six intent patterns: direct requests for a recommendation, complaints about a competitor, problem statements, switching signals, and hiring posts that imply growth. Resolve each author through GET /twitter/user/info to qualify on role and account quality, then score and route the survivors. Six queries polled hourly is 144 calls a day, about $3.50 a month at a flat $0.0008 a call.

Six checks, and five of them use data already in the payload. Check recency, because intent decays within days. Check that the author is a person rather than a brand account. Read the bio for role fit. Check post count and account age to drop dormant or fresh accounts. Match against your own CRM so nobody pitches an existing customer. Then pull the reply thread on the highest scorers, because if four vendors already answered, you are late.

Yes, and it is usually the highest-converting lane. Run advanced_search on the rival's name and handle with negative language and an exclusion for their own account, so you get customers rather than the company's own posts. Then pull GET /twitter/tweet/replies under any competitor post that is collecting unhappy responses, since a pile-on concentrates a lot of qualified unhappiness in one place with names attached.

No. TwitterAPIs authenticates with one Bearer token from signup, with no X developer application, no app review and no OAuth flow to implement. Signup includes $0.50 in credit with no card on file, which covers a six-query intent loop for several days before you spend anything.

In practice, two patterns beat the rest. The first is somebody asking the timeline for a recommendation, because they have announced both the need and the timing in public. The second is a complaint about a competitor, because it implies an existing budget and a live reason to move it. Problem statements and hiring posts are worth collecting but sit earlier in the cycle, so they belong in a nurture list rather than in a same-day outreach queue.

A standing loop of six intent queries polled hourly is 144 calls a day, roughly $3.50 a month. Qualifying a thousand candidates adds about a thousand profile calls, near $0.80. Adding rival complaint mining across three competitors at hourly cadence is another 72 calls a day, about $1.75 a month. The full setup lands around $6 a month, with no plan tier and no per-lead fee.

Fresher than most teams assume. A public request for a recommendation is usually answered within hours, so a lead found the next day is competing against replies that already landed. Poll intent queries at least hourly, and treat anything older than about 48 hours as nurture rather than outreach. Because billing is per call, tightening that loop is arithmetic rather than a plan upgrade: hourly to every 15 minutes on six queries takes the monthly cost from about $3.50 to about $14.

The API returns public posts and public profile fields only, the same data anyone browsing x.com can see, and it does not return email addresses or any private contact detail. What you may then do with that data is a separate question governed by the platform terms and by the privacy and marketing law where you and the recipient are, and those rules differ by region. Treat collection and outreach as two different decisions, and take advice on the second one before you send at volume.

Related use cases

The rival-complaint lane is the outreach half of competitor analysis, and the same category queries that surface buyers also power social listening. All fourteen workloads are indexed on the Twitter API use cases hub.

Find this week's buyers before your competitors reply

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