Overview
X offers two search endpoints with different time ranges and access requirements:Recent Search
Search Posts from the last 7 days. Available to all developers.
Full-Archive Search
Search the complete archive back to 2006. Available to pay-per-use and Enterprise customers.
Use cases
- Brand monitoring — Track mentions of your brand or products
- Trend analysis — Analyze conversations around topics or events
- Research — Gather data for academic or market research
- Real-time listening — Build applications that react to new Posts
Endpoints
| Method | Endpoint | Description | Access |
|---|---|---|---|
| GET | /2/tweets/search/recent | Search Posts from last 7 days | All developers |
| GET | /2/tweets/search/all | Search complete Post archive | Pay-per-use, Enterprise |
Query operators
Build queries using operators that match on Post attributes:Keyword operators
Keyword operators
| Operator | Example | Description |
|---|---|---|
| Keyword | python | Match Posts containing the word |
| Phrase | "machine learning" | Match exact phrase |
| Hashtag | #AI | Match Posts with hashtag |
| Mention | @XDevelopers | Match Posts mentioning user |
User operators
User operators
| Operator | Example | Description |
|---|---|---|
from: | from:elonmusk | Posts by a user |
to: | to:XDevelopers | Replies to a user |
retweets_of: | retweets_of:X | Retweets of a user’s Posts |
Content operators
Content operators
| Operator | Example | Description |
|---|---|---|
has:images | cat has:images | Posts with images |
has:videos | has:videos | Posts with videos |
has:links | has:links | Posts with links |
has:mentions | has:mentions | Posts with mentions |
url: | url:github.com | Posts with specific URL |
Filter operators
Filter operators
| Operator | Example | Description |
|---|---|---|
lang: | lang:en | Posts in a language |
-is:retweet | -is:retweet | Exclude retweets |
-is:reply | -is:reply | Exclude replies |
is:verified | is:verified | Posts by verified users |
Full operator reference
See all available operators and their access requirements
Recent Search
Search Posts from the last 7 days. Available to all developers.Features
- Up to 100 Posts per request
- Pagination for large result sets
- All core query operators
- 512-character query length (4,096 for Enterprise)
Full-Archive Search
Search the complete Post archive dating back to March 2006.Full-archive search is available to pay-per-use and Enterprise customers.
Features
- Up to 500 Posts per request
- Access to complete Post history
- All query operators available
- 1,024-character query length (4,096 for Enterprise)
Getting started
Prerequisites
- An approved developer account
- A Project and App in the Developer Console
- Your App’s keys and tokens