TL;DR — the operator surface in 30 seconds
- The operators — author (
from:,to:), dates (since:,until:), engagement (min_faves:, etc), filters (filter:verified, etc), geo (near:,within:), boolean (AND / OR / NOT). Same set across UI + APIs. - The API — twitterapi.io's
/twitter/tweet/advanced_searchtakes the full query string, returns JSON, paginates via cursor. $0.00015 per returned tweet per twitterapi.io/pricing. - The cost ratio — same query via X official is $0.005 per post per docs.x.com/x-api/getting-started/pricing. That's ~33× per call; for a 500-result search, $0.075 vs $2.50.
What "Twitter advanced search" means in practice
The phrase "Twitter advanced search" covers three related things: (1) the form at twitter.com/search-advanced where you fill in fields and the UI builds the query for you, (2) the operator syntax that gets built (from:nasa lang:en min_faves:100 since:2024-01-01 and similar), and (3) the API endpoint that runs the same query programmatically.
For developers building monitoring tools, brand-mention dashboards, historical-archive products, or analytics applications, the form is too slow and the API is the real path. Same operator vocabulary; structured JSON output instead of an endless-scroll page.
This page is the operator reference + the API equivalent for every one. Use it as the cheat sheet next to your editor, or feed it to an LLM as context for a search-builder agent.
Operator reference — 30+ operators with API equivalent
Each row is one operator. The Example column is copy-paste-runnable in both the UI and the API. The API call column shows the equivalent in twitterapi.io's /twitter/tweet/advanced_search endpoint (the operator goes into the query parameter verbatim).
| Operator | Example | What it does | API equivalent (twitterapi.io) |
|---|---|---|---|
| from:user | from:nasa | Posts authored by the user | query='from:nasa' |
| to:user | to:nasa | Posts replying to the user | query='to:nasa' |
| @user | @nasa | Posts mentioning the user | query='@nasa' |
| list:owner/slug | list:elonmusk/cosmic-club | Posts from accounts in the named list | query='list:elonmusk/cosmic-club' |
| since:YYYY-MM-DD | since:2024-01-01 | Posts on or after the date (UTC) | query='since:2024-01-01' |
| until:YYYY-MM-DD | until:2024-12-31 | Posts strictly before the date (UTC, exclusive) | query='until:2024-12-31' |
| within_time:Nh | within_time:24h | Posts from the last N hours (h/m/d) | query='within_time:24h' |
| "exact phrase" | "machine learning" | Posts containing the exact phrase | query='"machine learning"' |
| word AND word | nasa AND launch | Posts containing both terms (default = AND) | query='nasa launch' |
| word OR word | nasa OR spacex | Posts containing either term | query='nasa OR spacex' |
| -word | nasa -shuttle | Excludes posts containing the term | query='nasa -shuttle' |
| (group) | (nasa OR spacex) launch | Groups operators for boolean precedence | query='(nasa OR spacex) launch' |
| #hashtag | #machinelearning | Posts using the hashtag | query='#machinelearning' |
| $cashtag | $TSLA | Posts using the stock cashtag | query='$TSLA' |
| min_faves:N | min_faves:100 | Posts with at least N likes | query='min_faves:100' |
| min_retweets:N | min_retweets:50 | Posts with at least N retweets | query='min_retweets:50' |
| min_replies:N | min_replies:25 | Posts with at least N replies | query='min_replies:25' |
| lang:xx | lang:en | Posts in the language (ISO 639-1 code) | query='lang:en' |
| filter:verified | ai filter:verified | Only verified-author posts | query='ai filter:verified' |
| filter:replies | from:nasa filter:replies | Only reply posts | query='from:nasa filter:replies' |
| filter:media | cats filter:media | Only posts with media (images / video) | query='cats filter:media' |
| filter:images | cats filter:images | Only posts with images attached | query='cats filter:images' |
| filter:videos | cats filter:videos | Only posts with video attached | query='cats filter:videos' |
| filter:links | news filter:links | Only posts containing a URL | query='news filter:links' |
| filter:safe | nasa filter:safe | Excludes sensitive content (per X policy) | query='nasa filter:safe' |
| -filter:replies | nasa -filter:replies | Excludes reply posts | query='nasa -filter:replies' |
| -filter:retweets | nasa -filter:retweets | Excludes retweets | query='nasa -filter:retweets' |
| is:retweet | ai is:retweet | Only retweets | query='ai is:retweet' |
| near:"location" | near:"San Francisco" | Posts geocoded near the location | query='near:"San Francisco"' |
| within:Nmi | near:"NYC" within:10mi | Posts within N miles / km of the location | query='near:"NYC" within:10mi' |
| place:placeID | place:96683cc9126741d1 | Posts at the X place identifier | query='place:96683cc9126741d1' |
| conversation_id:N | conversation_id:1234567890 | Posts in the named thread | query='conversation_id:1234567890' |
| url:host | url:nasa.gov | Posts containing a URL on the host | query='url:nasa.gov' |
Source for the operator set: cross-checked against the X developer docs at docs.x.com/x-api/posts/search/integrate/build-a-query and igorbrigadir's reference cheat sheet on GitHub. Operator behavior is identical across the X search APIs and twitterapi.io.
Three runnable API examples
Set TWITTERAPI_IO_KEY in your env and copy any of these into a Python file. Each is copy-paste-runnable and returns structured JSON.
1. High-engagement AI posts from Elon Musk in 2024
Filters by author, date range, keyword, and minimum likes. Returns up to 100K results via cursor pagination.
import os, requests
HEADERS = {"X-API-Key": os.environ["TWITTERAPI_IO_KEY"]}
BASE = "https://api.twitterapi.io"
def search(query, max_pages=10):
tweets, cursor = [], None
for _ in range(max_pages):
params = {"query": query}
if cursor: params["cursor"] = cursor
r = requests.get(
f"{BASE}/twitter/tweet/advanced_search",
headers=HEADERS, params=params, timeout=15,
)
r.raise_for_status()
resp = r.json()
tweets.extend(resp.get("tweets", []))
cursor = resp.get("next_cursor")
if not cursor: break
return tweets
results = search(
'from:elonmusk (AI OR "machine learning") '
'since:2024-01-01 until:2025-01-01 min_faves:10000'
)
print(f"found {len(results)} high-engagement AI posts")
for t in results[:5]:
print(f" {t['public_metrics']['like_count']:,} likes — {t['text'][:80]}")2. Verified-account replies on a topic with engagement floor
Surfaces high-signal commentary from verified accounts on any topic. Useful for sentiment research and influencer mapping.
import requests, os
HEADERS = {"X-API-Key": os.environ["TWITTERAPI_IO_KEY"]}
r = requests.get(
"https://api.twitterapi.io/twitter/tweet/advanced_search",
headers=HEADERS,
params={
"query": '"AI safety" filter:verified filter:replies '
'min_replies:100 lang:en'
},
)
for t in r.json().get("tweets", [])[:10]:
print(f"@{t['author']['userName']}: {t['text'][:100]}")
print(f" -> {t['public_metrics']['reply_count']} replies\n")3. Geo-filtered posts about food within 10 miles of NYC
Combines geo and topic filters. Useful for local-business and regional-news research.
import requests, os
HEADERS = {"X-API-Key": os.environ["TWITTERAPI_IO_KEY"]}
r = requests.get(
"https://api.twitterapi.io/twitter/tweet/advanced_search",
headers=HEADERS,
params={
"query": '(restaurant OR food OR "best meal") '
'near:"New York" within:10mi lang:en min_faves:5'
},
)
results = r.json().get("tweets", [])
print(f"found {len(results)} NYC food posts")
for t in results[:5]:
print(f" @{t['author']['userName']} ({t['public_metrics']['like_count']} likes): "
f"{t['text'][:100]}")Per-call cost from twitterapi.io/pricing: $0.00015 per returned tweet. A 500-result search costs $0.075; a 5,000-result archive pull costs $0.75. No monthly minimum, no Developer Console onboarding — just an API key.
How twitterapi.io compares to the other paths
Five real ways to run an advanced search query today, with the honest trade-offs each one carries.
| Capability | twitterapi.io advanced_search | twitter.com UI | help.x.com (X official docs) | Tweetbinder | Bellingcat guide |
|---|---|---|---|---|---|
| Full operator support | Yes — every operator above + cursor pagination | Yes via UI (no programmatic surface) | Reference only (docs, not a tool) | Subset — UI exposes the common ones | Subset — investigative-journalism focus |
| API access | REST + Webhook | n/a | n/a | Higher-tier paid plans only | n/a |
| Date-range filter | since: / until: + within_time: | Yes via UI form | Documents the operators | Date-picker in UI | Documents the operators |
| Pagination | Cursor — 100K+ results | ~20-50 results before scroll-cap behavior | n/a | n/a — per-report cap | n/a |
| Cost model | $0.00015 per returned tweet (twitterapi.io/pricing) | Free for personal use | Free — reference docs | Subscription tiers (paid plans) | Free — community guide |
| Output format | JSON (full tweet object) | Rendered HTML in your browser | n/a | CSV export from UI | n/a — written guidance |
| Best for | Devs building monitoring / dashboards / archive products | Casual lookups, one-off research | Learning the operator vocabulary | Hashtag / campaign reports | Investigative journalism workflows |
Two honest observations from this matrix: (1) none of the SERP top results offers a developer API for the operator surface — the twitter.com UI and Bellingcat's guide both stop at "here's how to use the form"; (2) the cost ratio between twitterapi.io and X official (33×) is the deciding factor for any product that runs more than a few queries per day.
Who's actually using this endpoint
Among professional developers building on Twitter (X) API alternatives, advanced search is the de-facto top endpoint. Our own usage data shows over 3,000 paying customers monthly query the /twitter/tweet/advanced_search endpoint, with the endpoint processing over 40 million advanced search queries per month across that customer base — making it the single most-used endpoint on the twitterapi.io platform.
The customer mix skews toward research teams, journalism shops, brand-monitoring SaaS, academic groups, and analytics products — workloads where "I need the operator surface, programmatically, at sub-cent cost" is the unblocking constraint.
Source: twitterapi.io aggregated 30-day usage data. Specific counts banded per published methodology; comparable scale numbers updated quarterly.
Common search workloads — which operators fit
"your brand" min_faves:10 -is:retweet, poll hourly. Add lang:en if you want only English mentions.from:competitor since:DATE daily. Sort by engagement to surface their hits."topic" (great OR amazing OR terrible OR worst) min_faves:5 lang:en, feed to your sentiment classifier.from:user since:YEAR until:YEAR, paginate through. Cost: ~$0.15 per 1K archived tweets at twitterapi.io rates."topic" filter:verified min_replies:50 lang:en, aggregate by author."keyword" near:CITY within:10mi, poll on cron.Related developer references
Twitter (X) API — cluster hub
The pillar reference for every twitterapi.io endpoint and the decision-tree for picking one.
Search tweets by date via API
Deep-dive on since: / until: semantics + the until-is-exclusive gotcha.
Twitter archive — tweet finder via API
Building your own archive search on top of the operators here.
Twitter history API — export timeline
Bulk-pulling a user's full archive with the operators.
Rate limit exceeded on Twitter (X) — fixes
When your advanced-search loop hits the limit, what to do.
twitterapi.io pricing
$0.00015 per returned tweet, no monthly minimum, transparent per-call.
Run advanced search programmatically
Email signup, API key in seconds, $0.00015 per returned tweet, full archive depth. No X account or Developer Console needed.
Read the API docs