READ API LIVEBuild on /v1 for search, profiles, timelines, audience graph, and tweet context.READ DOCS

Guide · Twitter Search API

Search current public X/Twitter posts with operators you can reproduce.

xfetch turns a recent-search query into normalized JSON for apps, research, and AI pipelines. Start with a fixed no-signup Demo, then use your API key for custom queries and pagination.

Run live JSON Demo

Reproducible public sample

ai agents min_faves:50 lang:en -filter:replies
Returned limit
5
API key
Not required
Freshness evidence
Live status

Direct answer

What is a Twitter Search API?

A Twitter Search API lets software retrieve public posts matching a keyword query and operators such as author, language, date, engagement, link, hashtag, cashtag, phrase, or reply filters. xfetch exposes recent search through /v1/search/recent for tweet objects and/v1/search/recent/enriched when you also need a deduplicated author set.

Reproducible evidence

Run the same fixed query now

This public route executes the query shown below. The response is current JSON, not a hand-written example. It is rate-limited and may briefly serve a successful cached response.

GEThttps://xfetch.io/api/demo?run=search
no signup
Reproduce
curl 'https://xfetch.io/api/demo?run=search'

# Fixed underlying query
ai agents min_faves:50 lang:en -filter:replies
Response shape
{
  "data": [ { "id", "text", "author_id", "created_at" } … ],
  "meta": {
    "pagination": { "next_token":  "opaque…" },
    "credits": { "charged":  6 }
  }
}

Query language

Operators supported by recent search

IntentOperatorExample
Exact phrase"…""AI agents"
Alternatives / groupingOR, ()(bitcoin OR ethereum)
Authorfrom:from:openai
Languagelang:lang:en
Date windowsince:, until:since:2026-07-01
Engagementmin_faves:, min_retweets:min_faves:50
Entity#, $#ai, $BTC
Content / exclusionfilter:links, --filter:replies

Combine topic terms with engagement, language, and reply filters to narrow a high-volume recency stream into a more useful research sample.

Pagination

Pass next_token unchanged

  1. Run the first request with query and optional limit.
  2. Read meta.pagination.next_token from the response.
  3. Pass it unchanged as next_token on the next request.
  4. Stop when the token is absent. Never parse or infer its contents.

Customer API request

GET /v1/search/recent?query=ai%20agents&limit=20&next_token=opaque…Authorization: Bearer <api_key>

Predictable credits

Basic search or enriched search?

The numbers below are calculated from the same endpoint-pricing code used by the product. New accounts start with 1,000 credits.

EndpointReturns5 posts20 posts
/v1/search/recentTweet objects6 credits21 credits
/v1/search/recent/enrichedTweets + deduplicated authors11 credits41 credits

Charges use the number of primary posts actually returned: basic is 1 base + 1 per post; enriched is 1 base + 2 per post. Failed validation, authentication, insufficient-credit, rate-limit, service-side, and internal failures are not charged. See the workload calculator for a larger estimate.

FAQ

Twitter Search API questions

What is a Twitter Search API?
A Twitter Search API lets software retrieve public posts that match keywords and operators. xfetch recent search returns normalized JSON over a read-only REST API, with an opaque pagination token when another page is available.
Can I test xfetch Twitter search without signing up?
Yes. The fixed public Search Demo runs a real operator query and returns current JSON without an API key. It is rate-limited and intentionally uses a fixed query; sign in to run your own searches.
How does recent-search pagination work?
Read meta.pagination.next_token from the response and pass it unchanged as next_token on the next request. Treat the token as opaque and stop when the field is absent.
How many credits does Twitter search cost?
Basic recent search costs 1 base credit plus 1 credit per returned post. Enriched search costs 1 base credit plus 2 credits per returned post because it also returns a deduplicated author set. Failed calls are not charged.
When should I use enriched search?
Use enriched search when an analysis or AI pipeline needs author profiles next to matched posts. Use basic recent search when tweet objects alone are enough and the lower per-item cost matters.

Sources & scope

Check the contract behind this guide

Last updated . This page documents xfetch’s read-only product behavior; pagination tokens are opaque and no completeness or platform-wide freshness SLA is implied.

Start in 60 seconds
with Google.

Sign in, mint an API key, and call the workflow your product needs. 1,000 credits free to start. Failed calls, rate limits, and service-side errors are never charged.