X (Twitter) search syntax
On this page
A search query decides which posts your Tweet finder Ghost reads. Your goal decides which of them become Finds. Keep queries broad and let the goal do the judging.
Queries are keyword searches of up to 400 characters, and a Ghost takes up to 15 of them. Narrow results with the Ghost's filters, not with X's colon operators.
Operators
| Operator | What it matches | Example |
|---|---|---|
word word | Every word must appear, in any order. A space means AND. | watching now |
"exact phrase" | The exact phrase, word for word. | "happy hour drinks" |
"phrase with * wildcard" | Any one word in place of the *. Works only inside double quotes. | "this is the * time this week" |
OR | Either term, or both. Write it in capitals. | love OR hate |
-word | Leaves out posts that contain the word or quoted phrase. | beer -root |
( ) | Groups a list of OR options so it combines with the other terms. | "how to reach" (customers OR clients) |
#hashtag | Posts with the hashtag. | #haiku |
$cashtag | Posts with the cashtag. | $AAPL |
@username | Posts that mention the account. Use the exact username. | @apple |
Rules
- A query can be up to 400 characters long.
- A Ghost can have up to 15 queries.
- No colons (:). X operators such as from:, lang: or filter:images are rejected: set the matching filter instead.
- Do not write AND or NOT outside quotes, in any capitalization. A space already means AND, and - leaves a word out.
- The * wildcard works only inside double quotes.
- Use straight double quotes ("). Curly quotes (“ ” ‘ ’) and the + sign are rejected.
- Every opening quote and parenthesis needs a closing one.
- OR cannot start or end a query, and cannot sit next to another OR or a - exclusion.
Examples
| Query | What it finds |
|---|---|
("recommend me" OR "suggest me") (movie OR film) | Posts with "recommend me" or "suggest me", and also movie or film. |
indie hacker marketing -hiring | Posts with indie, hacker and marketing that do not mention hiring. |
"CRM alternative" OR "switching CRMs" | Posts with either phrase. |
Write queries that find enough
Posts on X are short and casual, and people rarely write the full phrase you have in mind. A long exact phrase or a long list of required words cuts volume and often returns nothing.
- Start from the words people use when they have the problem, not the words you use to sell.
"payroll was late"beats"payroll automation platform". - Quote only phrases that mean something different when split, such as
"payroll provider". - Wrap alternatives in parentheses so the
ORjoins what you intend. Writepayroll (software OR app), notpayroll software OR app. - Write several short queries instead of one long one. Each has its own weekly estimate, so you can see which ones earn their place.
- Describe what makes a post good or bad in the goal instead of adding more keywords.
For a payroll software company, payroll (late OR wrong OR missed) -hiring finds complaints about a payroll run and leaves out job ads. The goal then keeps only the posts from business owners.
Use filters instead of colon operators
Who posted, where, and what kind of post it is are filters, not part of the query.
| Instead of | Set this filter |
|---|---|
from: | From user |
lang: | Language(s) |
filter:replies | Is reply |
filter:links | Has links |
If a query returns nothing
Watch for the Query with potentially 0 results warning when you save. Shorten the query or split it into two. Text pasted from a document often carries curly quotes, which are rejected, so retype them as straight quotes.
Last updated
Was this helpful?
Related articles
X (Twitter) Ghosts
A Tweet finder Ghost searches public posts and replies on X and keeps the ones that match your goal, with no linked X account needed to scan.Search queries
Search queries decide which posts your Ghost reads. Keep them broad, check them with the weekly estimate, and narrow them with filters.Write your Ghost's goal
The goal tells your Ghost which posts become Finds. A good one answers three questions and says what to leave out.
Still need help? Open the app and choose Help, then Chat now.