Advanced Search

GET

Search for tweets using advanced query parameters

GET /api/v1/twitter/tweets/advanced_search

Authorization

X-API-Key
string
required

Parameters

NameTypeRequiredDescription
querystring
required
Twitter search query
modestring
optional
Search mode (Latest = 1, Top = 0)
Default: Latest
Allowed values: LatestTop
cursorstring
optional
Pagination cursor for fetching next page of results

Query Syntax

Common Search Operators
from:username
Tweets from a specific user
to:username
Tweets replying to a specific user
"exact phrase"
Tweets containing the exact phrase
word1 OR word2
Tweets containing either word
-word
Tweets excluding the word
#hashtag
Tweets containing a specific hashtag
since:YYYY-MM-DD
Tweets after a specific date
until:YYYY-MM-DD
Tweets before a specific date
filter:media
Tweets containing media
filter:links
Tweets containing links

Example Request

curl -X GET \
"https://api.xscraper.xyz/api/v1/twitter/tweets/advanced_search?query=from:elonmusk&mode=1" \
-H "X-API-Key: "

Response

Search Results
application/json
{
  "data": {
    "tweets": [
      {
        "id": "1722715025402413077",
        "text": "This is a sample tweet",
        "username": "elonmusk",
        "name": "Elon Musk",
        "userId": "44196397",
        "likes": 50000,
        "replies": 5000,
        "retweets": 10000,
        "views": 2000000,
        "timeParsed": "2025-04-18T15:30:00.000Z",
        "hashtags": ["sample", "tweet"],
        "mentions": [],
        "photos": [],
        "videos": [],
        "urls": [],
        "isReply": false,
        "isRetweet": false,
        "isQuoted": false
      }
    ],
    "next": "cursor_token_for_next_page",
    "previous": null
  },
  "meta": {
    "statusCode": 200,
    "timestamp": "2025-04-19T15:49:28.824Z"
  }
}

Error Responses

401 Unauthorized
{
  "statusCode": 401,
  "timestamp": "2025-04-19T15:49:28.824Z",
  "path": "/api/v1/twitter/tweets/advanced_search",
  "method": "GET",
  "message": "Invalid or expired API key"
}
429 Too Many Requests
{
  "statusCode": 429,
  "timestamp": "2025-04-19T15:49:28.824Z",
  "path": "/api/v1/twitter/tweets/advanced_search",
  "method": "GET",
  "message": "Rate limit exceeded. Please try again later."
}