search* and get*ByKeywords methods across every platform accept a query parameter that supports Lucene-style full-text search. This guide covers every operator with practical examples.
Basic syntax
Plain text (OR by default)
Space-separated terms without quotes match posts containing any of the words. A bare space is treated asOR:
Because bare spaces default to OR, always use explicit
AND when you need all terms present.Exact phrases
Wrap terms in double quotes to match the exact phrase:Boolean operators
UseAND and OR to combine terms. Operators are case-insensitive (and, AND, And all work).
AND — both terms required
OR — either term matches
Grouping with parentheses
Combine operators with parentheses for complex queries:Common patterns
| Use case | Query |
|---|---|
| Brand monitoring | "your brand" OR @yourbrand |
| Competitor comparison | (CompanyA OR CompanyB) AND "product launch" |
| Sentiment on a topic | "electric vehicles" AND (love OR hate OR amazing OR terrible) |
| Industry trends | ("generative AI" OR "large language models") AND 2025 |
| Job market signals | (hiring OR "open role") AND "data scientist" |
| Academic research | "climate change" AND (study OR research OR paper) |
| Product feedback | "your product" AND (bug OR issue OR broken OR love OR amazing) |
SDK examples
- TypeScript
- Python
- MCP (Claude)
Advanced patterns
Advanced patterns
Multi-platform search
The same query syntax works across all platforms. Platform behavior is consistent, but content differs:| Platform | Search methods |
|---|---|
| Twitter/X | searchPosts, getUsersByKeywords |
searchPosts, getUsersByKeywords | |
searchPosts, searchComments, getUsersByKeywords, getSubredditsByKeywords | |
| TikTok | searchPosts, getUsersByKeywords |
Combining with dedicated parameters
Do not embed platform-specific operators in the query string. Use the dedicated parameters instead:| Instead of… | Use parameter |
|---|---|
from:elonmusk | authorUsername: "elonmusk" (TS) / author_username="elonmusk" (Python) |
lang:en | language: "en" (TS) / language="en" (Python) |
since:2025-01-01 | startDate: "2025-01-01" (TS) / start_date="2025-01-01" (Python) |
until:2025-06-01 | endDate: "2025-06-01" (TS) / end_date="2025-06-01" (Python) |
- TypeScript
- Python
Reddit-specific filters
Reddit search methods accept additional parameters for sorting and time filtering:- TypeScript
- Python
relevance, hot, top, new, comments.
Time filters: hour, day, week, month, year, all.Troubleshooting
Troubleshooting
Common mistakes
Forgetting quotes for exact phrases:machine learningmatches “machine” OR “learning” (two separate words)"machine learning"matches the exact phrase
AI blockchain cryptoreturns posts with ANY of these termsAI AND blockchain AND cryptoreturns posts with ALL three terms
- Keep grouping to one level of nesting for best results
(A OR B) AND (C OR D)works well- Deeply nested queries may produce unexpected results
- Broaden your date range or remove restrictive filters
- Try fewer AND conditions
- Check spelling of exact phrases
Next steps
Response Modes
Choose fast, paging, or CSV for your queries
Field Selection
Reduce response size by selecting specific fields
CSV Exports
Export large result sets to CSV
Best Practices
Optimize queries for performance

