Twitter/X Search API
Search public tweets on X by keyword — text, author, likes, reposts, hashtags, and media for each matching post. Flat 2 credits per call.
GET request to /v1/twitter/search that responds with clean JSON and costs 2 credits. Pass cache=true for a free 24h cache hit; default is always fresh. Start with 100 free credits — no credit card.What is the Twitter/X Search API?
Pass a keyword or phrase and the Twitter/X Search API returns matching public tweets as clean JSON. Each result includes the tweet URL and id, full text, language, publish time, the author (username, display name, followers, verified, avatar), engagement (views, likes, replies, retweets, quotes, bookmarks), reply/retweet flags, hashtags, and media URLs when present. Use it for topic monitoring, brand listening, or content discovery on X. Flat 2 credits per call. Pass cache=true to serve from the 24h shared cache (0 credits on hit); default is always fresh.
What you get
- Public tweets matching your keyword
- Tweet URL, text, language, and publish time
- Author profile — handle, name, followers, verified, avatar
- Views, likes, replies, retweets, quotes, bookmarks, hashtags, and media
Try it
Fill in the parameters below and copy a ready-to-run request, or open the live Playground to run it against your account (no API key paste).
Parameters
curl "https://api.captapi.com/v1/twitter/search?q=nasa" \
-H "Authorization: Bearer capt_live_..."
# or: -H "x-api-key: capt_live_..."Edit the parameters and the code updates instantly. Switch languages and hit copy.
Example response
{
"success": true,
"data": {
"query": "nasa",
"totalReturned": 5,
"results": [
{
"platform": "twitter",
"url": "https://x.com/NASA/status/2040468080686424396",
"id": "2040468080686424396",
"text": "This view just hits different 🌍\n \n@Astro_Christina and @astro_reid take a moment to look back at Earth as they continue deep into space toward the Moon. https://t.co/NMDeLj256K",
"lang": "en",
"publishedAt": "Sat Apr 04 16:34:35 +0000 2026",
"author": {
"username": "NASA",
"displayName": "NASA",
"url": "https://x.com/NASA",
"followers": 92225387,
"verified": true,
"profileImage": "https://pbs.twimg.com/profile_images/1321163587679784960/0ZxKlEKB_normal.jpg"
},
"engagement": {
"views": 26608930,
"likes": 196244,
"replies": 3349,
"retweets": 29241,
"quotes": 2911,
"bookmarks": 11267
},
"isReply": false,
"isRetweet": false,
"media": [
"https://pbs.twimg.com/media/HFEy5njWsAArPaK.jpg",
"https://pbs.twimg.com/media/HFEy56IXwAAnG2M.jpg"
]
},
{
"platform": "twitter",
"url": "https://x.com/NASASolarSystem/status/2081803694480261151",
"id": "2081803694480261151",
"text": "On Aug. 12, a total solar eclipse will cross Greenland, Iceland, and Spain — and NASA science will be there! ☀️🌑🔭\n\nWe're flying high-altitude jets and launching scientific balloons to study the Sun and the eclipse's effects on us: https://t.co/zPn8UavJ3m\n\n📸: NASA/Ernie Wright https://t.co/wVJzVGJ3Ao",
"lang": "en",
"publishedAt": "Mon Jul 27 18:07:33 +0000 2026",
"author": {
"username": "NASASolarSystem",
"displayName": "NASA Solar System",
"url": "https://x.com/NASASolarSystem",
"followers": 2966292,
"verified": true,
"profileImage": "https://pbs.twimg.com/profile_images/1852211324224442369/9KHp7JLo_normal.jpg"
},
"engagement": {
"views": 371846,
"likes": 1674,
"replies": 62,
"retweets": 406,
"quotes": 20,
"bookmarks": 176
},
"isReply": false,
"isRetweet": false,
"media": [
"https://pbs.twimg.com/amplify_video_thumb/2081803656530190336/img/zUx_qij2E2oP-MsL.jpg"
]
},
{
"platform": "twitter",
"url": "https://x.com/NASA/status/2054251010625765655",
"id": "2054251010625765655",
"text": "Perseverance in the Wild Martian West 🤠\n\nOur Perseverance Mars rover snapped some photos beyond the western rim of Jezero Crater—the farthest west the rover has ever gone on the Red Planet. See what we found there: https://t.co/nIkwxstE26 https://t.co/6gJ9xgnVy5",
"lang": "en",
"publishedAt": "Tue May 12 17:23:01 +0000 2026",
"author": {
"username": "NASA",
"displayName": "NASA",
"url": "https://x.com/NASA",
"followers": 92225387,
"verified": true,
"profileImage": "https://pbs.twimg.com/profile_images/1321163587679784960/0ZxKlEKB_normal.jpg"
},
"engagement": {
"views": 1182851,
"likes": 20257,
"replies": 962,
"retweets": 3777,
"quotes": 123,
"bookmarks": 693
},
"isReply": false,
"isRetweet": false,
"media": [
"https://pbs.twimg.com/tweet_video_thumb/HIIqYwtWsAAcoyZ.jpg"
]
},
{
"platform": "twitter",
"url": "https://x.com/NASA/status/2082511887757881648",
"id": "2082511887757881648",
"text": "There's a solar eclipse happening on Wednesday, Aug. 12 — and if you're not in the path of totality, you can watch along with us online! Get the details: https://t.co/aAYzLGEqPU https://t.co/7yrWQpTkld",
"lang": "en",
"publishedAt": "Wed Jul 29 17:01:39 +0000 2026",
"author": {
"username": "NASA",
"displayName": "NASA",
"url": "https://x.com/NASA",
"followers": 92225387,
"verified": true,
"profileImage": "https://pbs.twimg.com/profile_images/1321163587679784960/0ZxKlEKB_normal.jpg"
},
"engagement": {
"views": 93400,
"likes": 549,
"replies": 87,
"retweets": 146,
"quotes": 13,
"bookmarks": 61
},
"isReply": false,
"isRetweet": false,
"media": [
"https://pbs.twimg.com/media/HOaRhlyWEAA1C8Q.jpg"
]
},
{
"platform": "twitter",
"url": "https://x.com/SpaceNews92/status/2082081188114808938",
"id": "2082081188114808938",
"text": "The Saturn V's mighty F-1 engine could only fire once... but SpaceX's Raptor can shut down, restart in space, then restart AGAIN before landing. How did rocket engines evolve that much?\n#spacex #starship #saturnV #nasa https://t.co/dRBxTiL5JA",
"lang": "en",
"publishedAt": "Tue Jul 28 12:30:13 +0000 2026",
"author": {
"username": "SpaceNews92",
"displayName": "Rocketry",
"url": "https://x.com/SpaceNews92",
"followers": 5245,
"verified": true,
"profileImage": "https://pbs.twimg.com/profile_images/1978478483543044096/-hWF_un1_normal.jpg"
},
"engagement": {
"views": 31847,
"likes": 903,
"replies": 28,
"retweets": 72,
"quotes": 1,
"bookmarks": 166
},
"isReply": false,
"isRetweet": false,
"hashtags": [
"spacex",
"starship",
"saturnV",
"nasa"
],
"media": [
"https://pbs.twimg.com/amplify_video_thumb/2082079317249724416/img/UdzqLA-kveH5BQdg.jpg"
]
}
]
}
}Billing metadata is returned in response headers: X-Captapi-Credits (credits charged), X-Captapi-Cache (hit or miss), and X-Captapi-Source. Failed requests (4xx/5xx) are never charged. See the full list of error codes in the error reference.
Response structure
A successful call returns success, cached, creditsUsed, and a data object with the following fields:
Top-level fields
queryThe search query you sent.totalReturnedNumber of items returned in this response.
Results
Each item in results contains:
platformPlatform identifier (e.g. youtube, instagram).urlCanonical URL of the item.idStable platform ID for the item.textText content.langLanguage code of the content.publishedAtPublish date (ISO 8601).authorObject with username, displayName, url, followers, verified, profileImage.engagementObject with views, likes, replies, retweets, quotes, bookmarks.isReplyWhether the tweet is a reply.isRetweetWhether the tweet is a retweet.mediaMedia attached to the item.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| q | string | Yes | Keyword or phrase to search public tweets on X (min 2 characters). |
| limit | integer | No | Max items to return (default 20, max 200). Billed per result. |
| cache | boolean | No | Set true to serve from the 24h response cache. Default false — always fetch fresh data. |
Authentication: send your key as Authorization: Bearer capt_live_.... A typical call costs 2 credits. Pass cache=true for a free 24h cache hit; default is always fresh.
How it works
- 1. Sign up — get 100 free credits, no card required.
- 2. Create a key from your dashboard.
- 3. Send one request to
/v1/twitter/searchand parse the JSON response.
Use cases
Trend Discovery
Find trending content by keyword or hashtag.
Content Sourcing
Build feeds and playlists programmatically.
Monitoring
Track topics, brands, and competitors.
Research
Sample large sets of content for analysis.
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?+
Each successful call costs 2 credits. 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.
More Twitter / X APIs
Ready to use the Twitter/X Search API?
Sign up, grab your key, and make your first call in 60 seconds.