Free tool · no login · runs in your browser
Twitter Advanced Search Builder
Fill in what you're looking for and get the exact X search query, ready to paste into X or to run through an API. Got a query already? Paste it into the explainer below the builder and every operator is spelled out.
Start from a common search
Your query
Searching on X needs a logged-in account. The same query string works unchanged in the API below.
Run it as code
import os, requests
params = {"query": "from:NASA", "queryType": "Latest"}
tweets = []
while True:
r = requests.get(
"https://api.twitterapi.io/twitter/tweet/advanced_search",
headers={"X-API-Key": os.environ["TWITTERAPI_IO_KEY"]},
params=params, timeout=30,
)
r.raise_for_status()
page = r.json()
tweets += page.get("tweets", [])
if not page.get("has_next_page") or len(tweets) >= 1000:
break
params["cursor"] = page["next_cursor"]
print(len(tweets), "posts")Explain a query
Paste any X search string — from a colleague, a saved search or an old script — to see what each part does.
Twitter advanced search operators
Every operator the builder writes, plus the ones worth typing by hand. They go straight into the X search box, into the advanced-search URL and into the query parameter of our advanced search API unchanged. The set is cross-checked against the community-maintained igorbrigadir/twitter-advanced-search reference; X doesn't publish an official list for web search. For a deeper, code-per-operator lookup see the search operators API reference.
Words
| Operator | Example | What it does |
|---|---|---|
| word word | nasa launch | Both words (AND is the default) |
| "exact phrase" | "machine learning" | The exact phrase, in order |
| a OR b | nasa OR spacex | Either word |
| -word | nasa -shuttle | Leaves out posts with the word |
| ( ) | (nasa OR spacex) launch | Groups terms so OR stays inside the group |
| #hashtag / $cashtag | #webdev $TSLA | Hashtag or stock cashtag |
| url: | url:github.com | Posts linking to a domain |
Accounts
| Operator | Example | What it does |
|---|---|---|
| from: | from:nasa | Written by the account |
| to: | to:nasa | Replies to the account |
| @ | @nasa -from:nasa | Mentions the account (minus its own posts) |
| list: | list:esa/astronauts | Posts by members of a public list |
| filter:blue_verified | ai filter:blue_verified | Only accounts with a paid blue check |
Time
| Operator | Example | What it does |
|---|---|---|
| since: | since:2026-01-01 | On or after the date (UTC, inclusive) |
| until: | until:2026-02-01 | Before the date (UTC, exclusive) |
| within_time: | within_time:24h | The last N seconds, minutes, hours or days |
| since_id: / max_id: | since_id:2105447600747446271 | Bounds by post ID — see the timestamp tool |
Engagement
| Operator | Example | What it does |
|---|---|---|
| min_faves: | min_faves:100 | At least N likes |
| min_retweets: | min_retweets:50 | At least N reposts |
| min_replies: | min_replies:25 | At least N replies |
| -min_faves: | -min_faves:500 | At most N likes (negated minimum) |
Post type
| Operator | Example | What it does |
|---|---|---|
| filter:replies | from:nasa filter:replies | Only replies (-filter:replies removes them) |
| filter:media / images / videos | cats filter:images | Posts with media of that kind |
| filter:links | news filter:links | Posts containing a URL (media counts) |
| include:nativeretweets | from:nasa include:nativeretweets | Adds button retweets, left out by default |
| filter:nativeretweets | from:nasa filter:nativeretweets | Only button retweets (about 7-10 days kept) |
| filter:quote | from:nasa filter:quote | Only quote posts |
| conversation_id: | conversation_id:1234567890 | Posts in one thread |
| filter:safe | nasa filter:safe | Leaves out posts marked sensitive |
Language & place
| Operator | Example | What it does |
|---|---|---|
| lang: | lang:ja | Posts X detects as that language |
| near: + within: | near:"New York" within:10mi | Geotagged posts near a place |
What we checked against live results
Operator lists online are often years old, so we ran two of the builder's presets through our own /twitter/tweet/advanced_search endpoint and read every post on the first page:
from:NASA filter:images min_faves:1000 since:2026-10-01 until:2026-11-01 -filter:replies— 20 of 20 posts had an image, at least 1,000 likes, were not replies and were dated 1-31 October 2026 UTC (none on 1 November, confirming thatuntil:is exclusive).openai filter:blue_verified lang:en -filter:replies— 20 of 20 authors had a blue check and no post was a reply.
Two operators behave differently from what older guides say: is:retweet belongs to X's paid v2 API, not to web search (use filter:nativeretweets), and filter:verified refers to legacy verification, so filter:blue_verified is the one that matches today's blue checks.
Five things that trip people up
- The end date is exclusive.
until:2026-11-01stops at 23:59:59 UTC on 31 October. Searching one day needs two different dates. The search-by-date guide walks through time zones. - Retweets are hidden by default, and button retweets drop out of search after about 7-10 days.
- Top and Latest return different sets. Top is ranked and heavily trimmed; use Latest (the builder's default,
f=livein the URL) when you need everything that matches. - Words match more than the text. A plain keyword also matches the author's name, handle and expanded links, which is why
nasareturns posts that never say "nasa". - Search on X needs a login, and long result lists have to be scrolled by hand. If search itself returns nothing, check the search-not-working fixes.
Run advanced search from code
The X search page is fine for a look; for monitoring, research exports or a dashboard you need the results as data. Our /twitter/tweet/advanced_search endpoint takes the same query string and returns JSON with each post's text, author, counts and media, about 20 posts per page with a cursor for the next. Based on anonymized, aggregated API usage on TwitterAPI.io, it is the most-used endpoint on the platform. Three examples (set TWITTERAPI_IO_KEY first):
1. An account's high-engagement posts on a topic over a year
import os, requests
def search(query, max_pages=10):
tweets, params = [], {"query": query, "queryType": "Latest"}
for _ in range(max_pages):
r = requests.get(
"https://api.twitterapi.io/twitter/tweet/advanced_search",
headers={"X-API-Key": os.environ["TWITTERAPI_IO_KEY"]},
params=params, timeout=30,
)
r.raise_for_status()
page = r.json()
tweets += page.get("tweets", [])
if not page.get("has_next_page"):
break
params["cursor"] = page["next_cursor"]
return tweets
posts = search('from:elonmusk (AI OR "machine learning") since:2025-01-01 until:2026-01-01 min_faves:10000')
for t in posts[:5]:
print(f"{t['likeCount']:,} likes {t['text'][:80]}")2. Blue-check commentary on a topic, replies included
posts = search('"AI safety" filter:blue_verified filter:replies min_replies:20 lang:en', max_pages=3)
for t in posts[:10]:
print(f"@{t['author']['userName']}: {t['text'][:100]} ({t['replyCount']} replies)")3. Brand mentions from the last 24 hours, for an hourly job
posts = search('"your brand" -from:yourbrand within_time:24h -filter:nativeretweets', max_pages=5)
print(len(posts), "mentions in the last 24h")Cost for the same pull: $0.15 per 1,000 posts returned on TwitterAPI.io (pricing) versus $0.005 per post read on X's pay-per-use API (docs.x.com pricing, which notes prices may change) — $1.50 against $50 for 10,000 posts, about 33× less. The cost line under the builder's code does this sum for your own volume.
X search page, X API or TwitterAPI.io
| Compared on | x.com search | X API (pay-per-use) | TwitterAPI.io |
|---|---|---|---|
| Query syntax | Web operators | v2 operators (is:retweet, has:media…) | Web operators, as built above |
| Needs | A logged-in X account | Developer account + app keys | An API key (Google sign-in) |
| Output | A page to scroll | JSON | JSON, cursor pagination |
| Cost per 10,000 posts | Free, scrolled by hand | $50 | $1.50 |
| Best for | One-off lookups | Teams already on X's platform | Monitoring, research, dashboards |
Queries for common jobs
- Brand monitoring —
"your brand" -from:yourbrand min_faves:5 -filter:nativeretweets· poll hourly; add lang:en for English only open in builder - Competitor activity —
from:competitor -filter:replies since:2026-10-01· sort by likes to see what landed open in builder - Sentiment research —
"topic" (love OR great OR hate OR worst) min_faves:5 lang:en· feed the text to a classifier open in builder - Archive pull —
from:account since:2025-01-01 until:2026-01-01· paginate; about $0.15 per 1,000 posts open in builder - Expert voices —
"topic" filter:blue_verified min_replies:50 lang:en· group by author open in builder - Customer support —
@yourbrand (help OR broken OR refund) -from:yourbrand· route to your support queue open in builder
Questions
Where is advanced search on X (Twitter)?
On the web it lives at x.com/search-advanced, and it only works while you are logged in. The form builds the same operator string this tool builds; this page adds operators the official form doesn't offer (engagement minimums, retweet and verification filters, relative time) and explains queries you paste in.
Why does my date search miss the last day?
until: is exclusive. since:2026-10-01 until:2026-10-31 stops at the end of 30 October. To include all of October, use until:2026-11-01. Both dates are read as UTC midnight unless you add a time, e.g. since:2026-10-01_09:00:00_UTC.
Why are retweets missing from my results?
X search leaves out button retweets by default. Add include:nativeretweets to keep them, or filter:nativeretweets to see only them. Search only keeps native retweets for roughly the last 7-10 days.
Can I run Twitter advanced search through an API?
Yes. TwitterAPI.io's /twitter/tweet/advanced_search endpoint takes the same query string in its query parameter, returns JSON with the full post object, and pages through results with a cursor. It costs $0.15 per 1,000 posts returned, with no X developer account needed.
Does near: find every post from a city?
No. near: and within: only match posts that carry location data, which most posts don't. For local monitoring, combining a place name as a keyword with lang: usually returns far more than a geo filter.
Related
- Search tweets by date — dates, times and time zones step by step.
- Twitter timestamp tool — turn a date window into since_id / max_id bounds.
- Advanced search API guide — pagination, rate limits and errors.
- Twitter archive tweet finder — search an account's full history.
- Twitter (X) API overview — every endpoint and when to use it.
Need the results as data?
Run any query from this page over a REST API. Google sign-in, free starter credits.