Brand and product conversations
(openai OR "chatgpt") lang:en -filter:repliesFind posts naming a brand or product. Use alternatives for different names and exclude replies when you want standalone discussions.
X/Twitter data · Search API
Find public X/Twitter posts about your brand, product or market. Filter by keywords, hashtags and accounts, then use the JSON results in your app or AI pipeline.
See a real response before signing up
ai agents min_faves:50 lang:en -filter:repliesStart with your question
A Twitter Search API turns a query into post records your software can read. Start with one of these examples and replace the topic or account with your own.
(openai OR "chatgpt") lang:en -filter:repliesFind posts naming a brand or product. Use alternatives for different names and exclude replies when you want standalone discussions.
(#bitcoin OR $BTC) min_faves:100 lang:en -filter:repliesFollow a hashtag or cashtag with an engagement filter. Use the matches as a research sample for your market dashboard.
from:openai filter:links -filter:repliesFind an account's posts that include links. Send the text, timestamps and post IDs into your research or AI pipeline.
Your first search
Create an xfetch API key and set it as XFETCH_API_KEY in your environment. Replace query below with your search. This example requests up to 20 posts; the returned count can be smaller.
curl --get 'https://api.xfetch.io/v1/search/recent' \ -H "Authorization: Bearer $XFETCH_API_KEY" \ --data-urlencode 'query="AI agents" lang:en -filter:replies' \ --data 'limit=20'
import os
import requests
response = requests.get(
"https://api.xfetch.io/v1/search/recent",
headers={"Authorization": "Bearer " + os.environ["XFETCH_API_KEY"]},
params={"query":"\"AI agents\" lang:en -filter:replies","limit":20},
timeout=30,
)
response.raise_for_status()
result = response.json()
for post in result["data"]:
print(post["id"], post["text"])Let your HTTP client encode the query so spaces, # and $reach the API correctly. The Python example uses the requests package. For all request parameters, see the recent-search API reference.
This saved example shows the response structure, not current search results. Basic search returns posts in data[]. Each record includes an ID, text, author ID, timestamp and available engagement metrics.
{
"data": [
{
"id": "1234567890123456789",
"text": "xfetch ships /v1 today.",
"author_id": "783214",
"created_at": "2026-05-23T12:00:00.000Z",
"lang": "en",
"conversation_id": "1234567890123456789",
"possibly_sensitive": false,
"like_count": 5,
"retweet_count": 1,
"reply_count": 0,
"quote_count": 0,
"bookmark_count": 0,
"is_quote_status": false,
"entities": {
"hashtags": [],
"urls": [],
"mentions": []
}
}
],
"meta": {
"request_id": "req_01HXFETCHEXAMPLE",
"credits": {
"charged": 2,
"remaining": 998
},
"pagination": {
"next_token": "tok_2"
}
}
}Collect matching posts and author profiles, follow pages, remove duplicates, and download a readable report with JSON/CSV files.
Run the topic search template →Refine your results
| Find | Operator | Example |
|---|---|---|
| An exact phrase | "…" | "AI agents" |
| Either topic | OR, () | (bitcoin OR ethereum) |
| Posts from an account | from: | from:openai |
| A language | lang: | lang:en |
| A date range | since:, until: | since:2026-09-01 until:2026-09-05 |
| Posts with engagement | min_faves:, min_retweets: | min_faves:50 |
| A hashtag or cashtag | #, $ | #ai, $BTC |
| Links; exclude replies or terms | filter:links, - | filter:links -filter:replies |
These are xfetch search-query examples. A date filter narrows results within available recent coverage; it does not turn this endpoint into a full archive. For an existing official API integration, see the separate X API compatibility guide.
Continue your search
next_tokenquery and limit.meta.pagination.next_token from the response.next_token unchanged. Keep the endpoint, query, limit and sort order the same.Keep the context your application needs
data[].id · data[].text · data[].author_id · data[].created_atUse created_at to check the result window. Request enriched search when you also need the authors' public profile fields.Choose the data you need
Choose basic search for post records. Choose enriched search for posts plus a deduplicated author set, such as bios and public follower counts. New accounts receive 1,000 credits to try their own queries.
| Search mode | Returns | Credit rule | 5 posts | 20 posts |
|---|---|---|---|---|
Basic search/v1/search/recent | Post records in data[] | 1 base + 1 per item | 6 credits | 21 credits |
Enriched search/v1/search/recent/enriched | data.tweets + data.authors | 1 base + 2 per item | 11 credits | 41 credits |
A priced item is a returned post in both modes. Join enriched results using tweet.author_id = author.id; handle a missing author when a profile is unavailable. Successful pages use the returned count, including the base charge for an empty page. Failed requests are not charged. Check credit packs and estimate your budget with the pricing calculator.
Inspect the data first
The public Search Demo runs the fixed query shown at the top of this page. It is rate-limited and may briefly reuse a recent successful response. Use the live status page to inspect sample timestamps and recent check results.
Before you integrate
Build on the result
Recent search is a pull workflow for keywords and topics. For a known account's new-post alerts, use the Twitter webhook and account monitor.
Maintained by xfetch. Last updated .
Get 1,000 free starting credits. Google sign-in opens the search playground with an editable example ready to run.