GetXAPI
Tweets

Advanced Search V2

Search tweets with advanced operators using GetXAPI Advanced Search V2. $0.0015 per successful call, ~20 tweets per page. Failed requests are never billed.

GET/twitter/tweet/advanced_search_v2

This endpoint costs $0.0015 per successful API call and returns ~20 tweets per page. Failed requests are not billed.

Advanced Search V2 takes the same parameters and returns the same response as Advanced Search, so switching is a one-line path change.

Query Parameters

ParameterTypeRequiredDescription
qstringYesSearch query (supports advanced operators)
productenumNoLatest (default) or Top
cursorstringNoPagination cursor

Limits and Behaviour

  • Returns up to 20 tweets per page; use cursor to page further.
  • Paginate with next_cursor from the previous response and stop when has_more is false.
  • Each successful page is a separate billable call at $0.0015. Requests that fail (any 4xx or 5xx) are logged in your dashboard at $0.
  • If the endpoint is briefly at capacity it answers 503 with a Retry-After header. Retry with backoff (5s, 15s, 30s, 60s).
  • q must be URL-encoded: min_faves:1000 becomes min_faves%3A1000 and spaces become +.
  • Supports the full web advanced search operator set. Syntax walkthrough with tested examples: Twitter advanced search operators guide.

Query Examples

  • from:elonmusk, tweets from elonmusk
  • "AI" OR "crypto" from:elonmusk, tweets containing AI or crypto
  • from:elonmusk since:2024-01-01, tweets since Jan 1, 2024
  • #crypto min_faves:100, tweets with at least 100 likes

Each post has the same fields as Tweet Detail.

Response (200)

{
  "query": "from:0xsweep",
  "tweet_count": 20,
  "has_more": true,
  "next_cursor": "DAABCgABG...",
  "tweets": [
    {
      "type": "tweet",
      "id": "2015410770834591992",
      "url": "https://x.com/0xsweep/status/2015410770834591992",
      "twitterUrl": "https://twitter.com/0xsweep/status/2015410770834591992",
      "text": "Thread on the latest memecoin trends...",
      "source": null,
      "retweetCount": 12,
      "replyCount": 5,
      "likeCount": 89,
      "quoteCount": 3,
      "viewCount": 4500,
      "createdAt": "Sun Jan 25 13:05:46 +0000 2026",
      "lang": "en",
      "bookmarkCount": 10,
      "isReply": false,
      "inReplyToId": null,
      "conversationId": "2015410770834591992",
      "media": [],
      "entities": {
        "hashtags": [],
        "symbols": [],
        "timestamps": [],
        "urls": [],
        "user_mentions": []
      },
      "inReplyToUserId": null,
      "inReplyToUsername": null,
      "author": {
        "type": "user",
        "userName": "0xsweep",
        "url": "https://x.com/0xsweep",
        "id": "1234567890",
        "name": "Sweep",
        "isVerified": false,
        "isBlueVerified": true,
        "profilePicture": "https://pbs.twimg.com/profile_images/...",
        "coverPicture": "https://pbs.twimg.com/profile_banners/...",
        "description": "Crypto researcher",
        "location": "",
        "followers": 15000,
        "following": 500,
        "tweets": 9214,
        "listed": 87,
        "createdAt": "Mon Jan 01 00:00:00 +0000 2022"
      },
      "quoted_tweet": null
    }
  ]
}

Errors

StatusMeaning
400Missing or empty q, or an invalid product value
401Missing, malformed, or revoked API key in the Authorization header
402Credit balance exhausted. Top up, then retry
503Temporarily at capacity. Not billed; retry after the Retry-After seconds

503 - Temporarily unavailable

{
  "error": "Search temporarily unavailable, please retry.",
  "hint": "Retry with backoff (5s, 15s, 30s, 60s). Failed requests are not billed."
}

An empty tweets array with has_more: false is a successful response, not an error: it means the query is valid but matched nothing.

Example

curl -H "Authorization: Bearer API_KEY" "https://api.getxapi.com/twitter/tweet/advanced_search_v2?q=from:0xsweep&product=Latest"
const response = await fetch(
  "https://api.getxapi.com/twitter/tweet/advanced_search_v2?q=from:0xsweep&product=Latest",
  { headers: { Authorization: "Bearer API_KEY" } }
);
const data = await response.json();
console.log(data.tweets);
import requests

response = requests.get(
    "https://api.getxapi.com/twitter/tweet/advanced_search_v2",
    params={"q": "from:0xsweep", "product": "Latest"},
    headers={"Authorization": "Bearer API_KEY"})
print(response.json()["tweets"])

On this page