Tweet Search
API for searching Twitter tweets
Tweet Search
Search for tweets on Twitter by finding relevant content with keywords.
Request
URL: /api/twitter/search
Method: GET
or POST
Request Parameters:
Parameter | Type | Required | Description |
---|---|---|---|
rawQuery | string | Yes | Search query string, can include keywords, usernames, hashtags, etc. |
Response
A successful response will return a list of tweets matching the search query, sorted by relevance, including tweet content, creation time, author information, etc.
Examples
Request Example
Response Example
Error Responses
Status Code | Description |
---|---|
400 | Request parameter error, e.g., missing required rawQuery parameter |
401 | Authentication failed, API key invalid or missing |
500 | Internal server error |
Search Tips
You can use the following syntax in your search query to optimize search results:
from:username
- Find tweets published by a specific user#hashtag
- Find tweets containing a specific hashtag"exact phrase"
- Find tweets containing an exact phrasesince:YYYY-MM-DD
- Find tweets after a specific dateuntil:YYYY-MM-DD
- Find tweets before a specific date
For example, the search query "artificial intelligence" from:elonmusk since:2023-01-01
will find tweets by Elon Musk published after January 1, 2023, containing the exact phrase "artificial intelligence".