/twitterThe X Search API enables users to retrieve relevant links and tweets based on specified search queries without utilizing AI-driven models. It analyzes links from X posts that align with the provided search criteria. Billed per post returned: each unique post id in the response is one unit, with a minimum of 10 posts per successful search, never more than `count` or 10, whichever is larger. Posts that contain none of the query's words (in the post text, its author, links, hashtags, mentions or quoted post) are left out, so a search can return fewer than `count` posts. Retweets and posts that link an X Article are not checked this way, because the words can be in the cut part of a retweet or in the article. A search with no matching posts returns 200 with an empty list and is charged the 10-post minimum. A failed search (503), a 422 and a blocked query are not charged. Date, engagement and the other filters apply to every `OR` term: the query is sent to X wrapped in parentheses. When you mix `OR` terms with other words, wrap the `OR` terms in parentheses yourself, for example `(#AI OR #LLM) agents`. This route has no pagination: a `cursor` parameter returns 422 and is not charged. Billing metadata: successful billable responses include the `X-Desearch-Cost-Usd`, `X-Desearch-Usage-Count`, `X-Desearch-Service`, and `X-Desearch-Currency` headers. JSON object responses also include optional `cost_usd`, `usage_count`, `service`, and `currency` fields. Current prices are at https://desearch.ai/pricing. JSON arrays, text, and streaming responses keep their body shape and expose billing metadata only through headers.
Base URL
https://api.desearch.aiUse X Search API when your application needs fresh X data without maintaining its own crawler, social-data pipeline, or retrieval infrastructure. For pricing and agent setup over REST or MCP, see the X (Twitter) search API page. The endpoint returns structured data that can be consumed by agents, research tools, dashboards, and retrieval-augmented generation workflows. Keep the request focused on the minimum fields your workflow needs so responses remain fast and easy to validate.
Send requests to GET /twitter with your Desearch API key in the authorization header. Treat the key as a server-side secret, validate all required parameters before sending the request, and handle non-2xx responses explicitly. Production integrations should use sensible timeouts, retry only transient failures with backoff, and record the response status and request identifier for troubleshooting.
Test the example request below before integrating it into a larger workflow. Confirm that the returned fields, links, and timestamps meet your freshness requirements, then add schema validation at the application boundary. For agentic systems, preserve source URLs with the generated answer so users can inspect evidence and your application can avoid presenting unsupported claims.
querystringrequiredAdvanced search query. Filters apply to every `OR` term: the query is sent wrapped in parentheses. To mix `OR` terms with other words, wrap the `OR` terms in parentheses, for example `(#AI OR #LLM) agents`. X accepts at most 512 characters, counting the parentheses, filters and date bounds; a longer query returns 422 and is not charged.
sortstringSort by Top or Latest
Default: Top
userstringUser to search for
start_datestringEarliest post time, inclusive. Either a date, `YYYY-MM-DD`, meaning that day from 00:00:00 UTC, or an ISO 8601 date-time with a time zone, for example `2026-11-10T08:30:00Z` or `2026-11-10T12:30:00+04:00`, kept to the second. Omit it for no start. Any other value, including an empty or padded one or a date-time without a zone, or a start after `end_date`, returns 422 and is not charged.
end_datestringLatest post time, inclusive. Either a date, `YYYY-MM-DD`, meaning through 23:59:59 UTC of that day, or an ISO 8601 date-time with a time zone, for example `2026-11-10T12:00:00Z` (no posts after 12:00:00 UTC). Omit it for no end. Any other value, including an empty or padded one or a date-time without a zone, returns 422 and is not charged.
langstringLanguage code (e.g., en, es, fr)
verifiedboolean`true`: only posts whose author shows a check mark in the response, `user.is_blue_verified: true` or `user.verified: true`. Posts whose author shows neither are left out and not charged. `user.is_blue_verified` is the blue check. `user.verified` is X's legacy verified flag, which is `false` for almost every account today, so a `verified=true` result usually has `user.verified: false` and `user.is_blue_verified: true`. Use `blue_verified=true` to ask for blue checks only. `false`: X's own filter for accounts without a check.
blue_verifiedboolean`true`: only posts whose author has a blue check (`user.is_blue_verified: true`); others are left out and not charged. `false`: X's own filter for accounts without a blue check.
is_quotebooleanInclude only tweets with quotes
is_videobooleanInclude only tweets with videos
is_imagebooleanInclude only tweets with images
min_retweetsstringMinimum number of retweets
min_repliesstringMinimum number of replies
min_likesstringMinimum number of likes
countintegerNumber of tweets to retrieve. Billed per unique post returned, at least 10 per successful search, never more than this or 10, whichever is larger.
Default: 20
Your API key is sent in the Authorization header.