Skip to content

Twitter search API

Search tweets by keyword, narrow them by date, and read the replies, mentions and retweeters around any tweet. Tweets come back as JSON with text, author, counts and link.

Search tweets now, no signupThen call the same data from code.

The job

Tweet search is the base of social listening on X: find who mentions a brand, what people say about a competitor, and which tweets a launch got. The calls cover search, one tweet's detail, replies, retweeters and an account's mentions.

It is read-only. Posting and liking are separate tools that run from an account you connect.

Put X's advanced search operators in the query, such as quoted phrases, from: and since: or until: dates, and the Twitter advanced search API behaves like X's own search box. It is a plain REST call, so a Python, JavaScript or Java example is the same request in a different HTTP client. See Twitter API in JavaScript and the X API in Python guide. For older tweets, set a date range; results are what X returns for that range at call time. If you used the 1.1 search, the premium search or the v2 search endpoints, this replaces them with one key and no X developer account.

How it works

  1. Search tweets

    Call x.search with a query and, if you want, a date range.

  2. Read one tweet

    Call x.tweet_detail with a tweet id or link.

  3. Read the conversation

    Call x.replies for replies and x.retweeters for who shared it.

  4. Watch mentions

    Call x.mentions with a username to see who mentions them.

Endpoints that do it

EndpointWhat it's forCredits
Search tweetsGET /v1/x/tweets/searchTweets matching a query.2 credits
Get a tweetGET /v1/x/tweets/{id}One tweet with its counts.2 credits
List repliesGET /v1/x/tweets/{id}/repliesReplies to a tweet.2 credits
List retweetersGET /v1/x/tweets/{id}/retweetersAccounts that retweeted a tweet.2 credits
List mentionsGET /v1/x/users/{handle}/mentionsTweets that mention an account.2 credits

Free tools for the same job

Try the job in a browser first. These tools call the same endpoints, and you don't need a key or any code.

Searching tweets

Search for a phrase and read each tweet's author, text and counts.

curl "https://api.chatterapi.com/v1/x/tweets/search?q=%22crm+recommendation%22" \
  -H "Authorization: Bearer $CHATTERAPI_KEY"
response, first 2 rows
{
  "data": [
    {
      "id": "2099495333231288346",
      "text": "meta ads: how important is the “connect to your crm” recommendation?\n\nthis essentially will tell meta if the lead was good or bad (ie converted), any experience how how is actually helps?\n\nthis particular client doesn’t …",
      "url": "https://x.com/HesomParhizkar/status/2099495333231288346",
      "createdAt": "2026-09-14T13:47:48.000Z",
      "lang": "en",
      "likes": 2,
      "retweets": 0,
      "replies": 2,
      "quotes": 0,
      "views": 138,
      "bookmarks": 0,
      "isReply": false,
      "inReplyToId": null,
      "conversationId": "2099495333231288346",
      "isRetweet": false,
      "quotedTweetId": null,
      "type": "tweet",
      "isQuote": false,
      "isPinned": false,
      "source": null,
      "hasVideo": false,
      "urls": [],
      "mentions": [],
      "author": {
        "id": "35363135",
        "handle": "HesomParhizkar",
        "name": "Hesom",
        "bio": "Startup Founder/Executive, investor, nba fan",
        "followers": 584,
        "following": 2010,
        "tweets": null,
        "verified": false,
        "blueVerified": true,
        "canDm": true,
        "protected": null,
        "location": "Marietta, GA",
        "url": null,
        "avatarUrl": "https://pbs.twimg.com/profile_images/1871033188081942528/comvGkRg_normal.jpg",
        "createdAt": "2009-04-26T01:18:19.000Z",
        "profileUrl": "https://x.com/HesomParhizkar",
        "bannerUrl": "https://pbs.twimg.com/profile_banners/35363135/1787179410",
        "likesGiven": null,
        "mediaCount": null,
        "pinnedTweetIds": null
      },
      "media": [],
      "quotedTweet": null,
      "retweetedTweet": null
    },
    {
      "id": "2040879100261458222",
      "text": "Here's a live audit on what happens when buyers ask AI for a CRM recommendation. You can't miss it...",
      "url": "https://x.com/apoorvshrm/status/2040879100261458222",
      "createdAt": "2026-04-05T19:47:49.000Z",
      "lang": "en",
      "likes": 4,
      "retweets": 0,
      "replies": 1,
      "quotes": 0,
      "views": 145,
      "bookmarks": 0,
      "isReply": false,
      "inReplyToId": null,
      "conversationId": "2040879100261458222",
      "isRetweet": false,
      "quotedTweetId": "2040878095415304308",
      "type": "quote",
      "isQuote": true,
      "isPinned": false,
      "source": null,
      "hasVideo": false,
      "urls": [],
      "mentions": [],
      "author": {
        "id": "1459048370371137542",
        "handle": "apoorvshrm",
        "name": "Apoorv Sharma | SEO and GEO for B2B SaaS",
        "bio": "SEO + GEO for B2B SaaS. I help SaaS brands rank on Google and get recommended by Claude, Gemini, and Google AI.\nCo-Founder, DerivateX",
        "followers": 2316,
        "following": 519,
        "tweets": null,
        "verified": false,
        "blueVerified": true,
        "canDm": true,
        "protected": null,
        "location": "Bengaluru",
        "url": null,
        "avatarUrl": "https://pbs.twimg.com/profile_images/2069124654112149504/AWTErF4d_normal.jpg",
        "createdAt": "2021-11-12T06:40:23.000Z",
        "profileUrl": "https://x.com/apoorvshrm",
        "bannerUrl": "https://pbs.twimg.com/profile_banners/1459048370371137542/1770951885",
        "likesGiven": null,
        "mediaCount": null,
        "pinnedTweetIds": null
      },
      "media": [],
      "quotedTweet": {
        "id": "2040878095415304308",
        "text": "I just ran a live AI visibility audit on HubSpot.\n\nTyped the same prompt into ChatGPT, Perplexity, and Gemini.\n\nThe results were... WILD.\n\nHere's what I found 🧵",
        "url": "https://x.com/apoorvshrm/status/2040878095415304308",
        "createdAt": null,
        "lang": null,
        "likes": null,
        "retweets": null,
        "replies": null,
        "quotes": null,
        "views": null,
        "bookmarks": null,
        "isReply": false,
        "inReplyToId": null,
        "conversationId": null,
        "isRetweet": false,
        "quotedTweetId": null,
        "type": "tweet",
        "isQuote": false,
        "isPinned": false,
        "source": null,
        "hasVideo": false,
        "urls": [],
        "mentions": [],
        "author": {
          "id": "",
          "handle": "apoorvshrm",
          "name": "Apoorv Sharma | SEO and GEO for B2B SaaS",
          "bio": null,
          "followers": null,
          "following": null,
          "tweets": null,
          "verified": null,
          "blueVerified": null,
          "canDm": null,
          "protected": null,
          "location": null,
          "url": null,
          "avatarUrl": null,
          "createdAt": null,
          "profileUrl": "https://x.com/apoorvshrm",
          "bannerUrl": null,
          "likesGiven": null,
          "mediaCount": null,
          "pinnedTweetIds": null
        },
        "media": []
      },
      "retweetedTweet": null
    }
  ],
  "page": {
    "nextCursor": "ATcD…",
    "hasMore": true
  }
}

Recorded from a live call on . Long text is shortened and the cursor is cut. A live key is charged 2 credits for this call. A test key returns this same sample for 0 credits.

What it won't do

  • It is read-only. Posting and liking are separate tools.
  • Tweets from protected accounts are not returned.
  • X's rules apply to what you do with the data.

Questions

Is there a Twitter search API example for Python, JavaScript or Java?
Yes. The call is one authenticated GET, so any language works. The X API in Python guide and Twitter API in JavaScript show working code. In Java, send the same request with the built-in HTTP client and read the JSON.
Is this a Twitter keyword search tool I can use without code?
Yes. The free X tweet search takes a keyword or an advanced query and shows matching tweets in the browser.
Does it work as a full archive search API?
You can search older tweets by setting a date range in the query. What comes back is whatever X returns for that range, so check a sample for the period you need before you rely on it.
Can I search tweets by date?
Yes. See search tweets by date for the operators.
Can I search Reddit and X together?
Yes. The everywhere search takes one query and returns both. See search Reddit and X.
Can I get notified of new matches?
Run the search on a schedule from n8n, or use the free mentions monitor.

More ways to use the API

Build it with one API key

Try it free for 7 days with 1,000 credits.