Twitter / X · Guide

How to run a Twitter / X search

TL;DR
To run a Twitter / X search, sign up for a free Captapi key, then send one GET request to /v1/twitter/search with your input. You get clean JSON back in seconds for ~14 credits (0.7/result) per call — no OAuth, scraping or platform SDKs. Search Twitter / X programmatically and get structured, ranked results.

How to run a Twitter / X search (step by step)

  1. 1

    Get a free API key

    Create a free Captapi account (100 credits, no card) and generate an API key from the dashboard.

  2. 2

    Call the Twitter/X Search API

    Send an authenticated GET request to /v1/twitter/search with your input. No OAuth, no scraping setup.

  3. 3

    Read the JSON response

    Parse the clean JSON response. Pass cache=true for a free 24h cache hit; default is always fresh.

Code example

curl "https://api.captapi.com/v1/twitter/search?q=artificial%20intelligence" \
  -H "Authorization: Bearer capt_live_..."
# or: -H "x-api-key: capt_live_..."

What the response looks like

{
  "success": true,
  "data": {
    "query": "artificial intelligence",
    "totalReturned": 5,
    "results": [
      {
        "platform": "twitter",
        "url": "https://x.com/blatam_/status/2077911343433121881",
        "id": "2077911343433121881",
        "text": "Artificial Intelligence is a vast field encompassing Machine Learning and Deep Learning. Deep Learning further breaks down into various model categories, driving innovation across industries. #ArtificialIntelligence #MachineLearning https://t.co/LiHD2ey6Th",
        "lang": "en",
        "publishedAt": "Fri Jul 17 00:20:44 +0000 2026",
        "author": {
          "username": "blatam_",
          "displayName": "Blatam",
          "url": "https://x.com/blatam_",
          "followers": 9757,
          "verified": null,
          "profileImage": "https://pbs.twimg.com/profile_images/1591619270315835392/AmQ2CCIu_normal.jpg"
        },
        "engagement": {
          "views": 214,
          "likes": 1,
          "replies": 0,
          "retweets": 0,
          "quotes": 0,
          "bookmarks": 0
        },
        "isReply": false,
        "isRetweet": false,
        "hashtags": [
          "ArtificialIntelligence",
          "MachineLearning"
        ],
        "media": [
          "https://pbs.twimg.com/amplify_video_thumb/2077911330095353856/img/zbXY6CblL626j2-b.jpg"
        ]
      },
      {
        "platform": "twitter",
        "url": "https://x.com/meisshaily/status/2077981464726245381",
        "id": "2077981464726245381",
        "text": "Artificial General Intelligence (#AGI) is predicted to surpass human #intelligence and trigger rapid technological progress beyond our control.  — @meisshaily \n\nhttps://t.co/tkqTBL8SIq\n\n#ArtificialIntelligence #AI #TechNews #TEchNology #Tech",
        "lang": "en",
        "publishedAt": "Fri Jul 17 04:59:22 +0000 2026",
        "author": {
          "username": "meisshaily",
          "displayName": "Shailendraa Kumar",
          "url": "https://x.com/meisshaily",
          "followers": 76728,
          "verified": true,
          "profileImage": "https://pbs.twimg.com/profile_images/1640506780823490560/vpKI_AMn_normal.jpg"
        },
        "engagement": {
          "views": 252,
          "likes": 1,
          "replies": 1,
          "retweets": 1,
          "quotes": 0,
          "bookmarks": 0
        },
        "isReply": false,
        "isRetweet": false,
        "hashtags": [
          "AGI",
          "intelligence",
          "ArtificialIntelligence",
          "AI",
          "TechNews"
        ],
        "media": []
      },
      {
        "platform": "twitter",
        "url": "https://x.com/BLS_gov/status/2077898575229374631",
        "id": "2077898575229374631",
        "text": "Artificial intelligence, information technology, and employment, 2024–34 #BLSData https://t.co/PwIRncj01X https://t.co/LhnW3ASFM4",
        "lang": "en",
        "publishedAt": "Thu Jul 16 23:30:00 +0000 2026",
        "author": {
          "username": "BLS_gov",
          "displayName": "BLS-Labor Statistics",
          "url": "https://x.com/BLS_gov",
          "followers": 107813,
          "verified": true,
          "profileImage": "https://pbs.twimg.com/profile_images/1542848480024166400/o6d_LR9a_normal.jpg"
        },
        "engagement": {
          "views": 3156,
          "likes": 7,
          "replies": 0,
          "retweets": 3,
          "quotes": 1,
          "bookmarks": 2
        },
        "isReply": false,
        "isRetweet": false,
        "hashtags": [
          "BLSData"
        ],
        "media": [
          "https://pbs.twimg.com/media/HNWPNE5XIAAQYJR.jpg"
        ]
      },
      {
        "platform": "twitter",
        "url": "https://x.com/heyalexmoore/status/2077039378602627525",
        "id": "2077039378602627525",
        "text": "All Paid Courses (Free for First 4500 People)\n\n 𝗣𝗮𝗶𝗱 𝗖𝗼𝘂𝗿𝘀𝗲 𝗙𝗥𝗘𝗘 (PART - 1)\n 1. Artificial Intelligence\n 2. Machine Learning\n 3. Prompt Engineering\n 4. Claude,Chatgpt,Grok\n5. Data Analytics\n6. AWS Certified\n 7. Data Science\n8. BIG DATA\n9. Python\n 10. Ethical Hacking https://t.co/OqFWODxsAo",
        "lang": "en",
        "publishedAt": "Tue Jul 14 14:35:52 +0000 2026",
        "author": {
          "username": "heyalexmoore",
          "displayName": "Alex Moore",
          "url": "https://x.com/heyalexmoore",
          "followers": 181689,
          "verified": true,
          "profileImage": "https://pbs.twimg.com/profile_images/2002782930415026177/AQXbO75J_normal.jpg"
        },
        "engagement": {
          "views": 283359,
          "likes": 1897,
          "replies": 1856,
          "retweets": 873,
          "quotes": 10,
          "bookmarks": 664
        },
        "isReply": false,
        "isRetweet": false,
        "hashtags": [],
        "media": [
          "https://pbs.twimg.com/media/HNMgTsRa4AA-Pte.jpg"
        ]
      },
      {
        "platform": "twitter",
        "url": "https://x.com/GavinSBaker/status/2078110934740980193",
        "id": "2078110934740980193",
        "text": "Kimi K3 may be an important inflection point for AI. Potentially negative for Anthropic and OpenAI while being net positive for essentially every other company in the world. I mean that very literally. Although the real “Sputnik moment” would be an open-source frontier model that https://t.co/tdAkU4oRgo",
        "lang": "en",
        "publishedAt": "Fri Jul 17 13:33:50 +0000 2026",
        "author": {
          "username": "GavinSBaker",
          "displayName": "Gavin Baker",
          "url": "https://x.com/GavinSBaker",
          "followers": 281946,
          "verified": true,
          "profileImage": "https://pbs.twimg.com/profile_images/1396219525754937345/5L4n5L3O_normal.jpg"
        },
        "engagement": {
          "views": 1775228,
          "likes": 6718,
          "replies": 455,
          "retweets": 1008,
          "quotes": 270,
          "bookmarks": 4601
        },
        "isReply": false,
        "isRetweet": false,
        "hashtags": [],
        "media": [
          "https://pbs.twimg.com/media/HNbu4bhWoAATDPF.jpg",
          "https://pbs.twimg.com/media/HNbu4bjXkAADZnh.jpg"
        ]
      }
    ]
  }
}

Billing metadata (credits charged, cache hit/miss) is returned in the X-Captapi-Credits and X-Captapi-Cache response headers.

Request parameters

NameTypeRequiredDescription
qstring YesKeywords or search query (min 2 characters).
limitintegerNoMax items to return (default 20, max 200). Billed per result.
cachebooleanNoSet true to serve from the 24h response cache. Default false — always fetch fresh data.

Frequently asked questions

What does the Twitter/X Search API do?

The Twitter/X Search API lets you search and return matching results from a public Twitter / X query using one GET request to /v1/twitter/search. It returns clean JSON — no OAuth or infrastructure setup required.

How many credits does the Twitter/X Search API cost?

At the default limit this endpoint costs 14 credits (0.7 per result). Billing scales with how many results you request. Pass cache=true to serve from the 24h shared cache (0 credits on hit); default is always fresh. Failed or empty results are never charged.

Do I need a Twitter / X API key or OAuth?

No. A single Captapi key works across every platform Captapi supports — YouTube, TikTok, Instagram, Facebook, Twitter/X, Reddit, Threads, Bluesky, Pinterest, LinkedIn, Rumble, Spotify, Kwai, and more. We handle proxies, rate limits, retries, and authentication for you.

Is the Twitter/X Search API suitable for production use?

Yes. It is a stable REST endpoint with predictable JSON and automatic retries. Pass cache=true to serve from the 24h shared cache (0 credits on hit); default is always fresh. Use it for analytics, monitoring, and content automation.

Ready to run a Twitter / X search?

Start free with 100 credits — no credit card required.

Get your free API key