/twitter/repliesThe tweets and replies by user API allows users to search for relevant links or tweets based on X search queries without leveraging AI-powered models. This API analyze links from X posts that match the given prompt. Billed per post returned, with a minimum of 10 posts (never more than `count`). A search with no posts returns 200 with an empty list and is not charged. Replies come newest first. When more may exist, the response has an `x-desearch-next-cursor` header: send it back as `cursor` for the next page. 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 Fetch User's Tweets and Replies when your application needs fresh X data without maintaining its own crawler, social-data pipeline, or retrieval infrastructure. Choose the account-oriented reply route when the starting point is an X username and you want that user's tweets and replies, obtained through X search without AI analysis; use replies to a post when the starting point is one particular post. The required user parameter names the account to search, while optional query supplies an advanced search expression to narrow its returned posts; leaving that expression out uses the documented empty-string default. Set count to the requested page size as an integer from 1 to 100, with 10 used by default; this bound describes one request and should be kept separate from the number of pages your application retrieves. Results are ordered newest first, so a first page represents the most recent matches returned by this search, and pagination continues by passing the server's cursor rather than by inventing page numbers or incrementing a post identifier. For the opening request, omit cursor; when another page exists, take the opaque value from the x-desearch-next-cursor response header and supply it unchanged on the next call to this same route and target. Preserve all the other request parameters when following that value, including the account, requested count and search expression: the token belongs to that request, not to an arbitrary new search you happen to run later. A cursor remains valid for 24 hours, and an expired value, a malformed token or one copied from a different request is rejected with an uncharged HTTP 422 response instead of being treated as a fresh first page. The final page has no next-cursor header; across pages the API does not repeat a reply, although when more than 100 replies share one second, those beyond the first 100 in that second may be skipped. For request accounting, this operation bills per post returned, with a minimum of 10 and never more than the requested count; a successful HTTP 200 response containing an empty list is explicitly uncharged, and current rates are linked from pricing. Read the response's billing headers to reconcile an account lookup: X-Desearch-Cost-Usd contains its USD cost, X-Desearch-Usage-Count the billable units, X-Desearch-Service the priced service name and X-Desearch-Currency the currency. An object response may additionally carry cost_usd, usage_count, service and currency, but an array keeps its array shape and exposes this accounting through headers only; the documented success schema permits an array of TwitterScraperTweet items or an object. Within a tweet item, id and text are required strings and created_at is a required string timestamp field; keep those post-level fields distinct from the optional nested author object when identifying which account wrote a returned item. The required engagement counters are reply_count, retweet_count, like_count, quote_count and bookmark_count, each an integer; view_count has a different contract because it is optional and can be null, so a missing view count is not a reported zero. For conversation context, in_reply_to_screen_name identifies the username being answered, in_reply_to_user_id the corresponding user ID and in_reply_to_status_id the post being answered; all three can be absent or null on the shared tweet model. The optional conversation_id describes the conversation thread, whereas quoted_status_id identifies a quoted post; a quote relationship and a reply relationship therefore have separate fields, and neither optional identifier should be assumed present for every item from the account search. A nested quote uses the same tweet schema, and replies can hold an array of tweet objects, with null allowed for both; these schema possibilities describe available context without making every returned account item a fully populated conversation tree. The schema also makes is_quote_tweet, is_retweet and lang nullable, so consumers displaying a label or filtering by language should handle an unknown value as well as a supplied boolean or language code. For links and attachments, the post's url and media are optional, entities groups hashtags, URLs and mentions, and extended_entities carries media entities; the text display range is separately represented by an optional array of integer indices. When a nested user is available, only its id and username are required by the user schema; profile description, location, website, follower counts and verification indicators are nullable fields, so a reply viewer must allow incomplete author details. Some fields describe richer post presentations: card may supply a link preview, video player or live broadcast and is null when none exists, while article applies only to article posts and content_disclosure is null when X returns no author disclosure. Do not rely on the shared model's nested retweet payload for this operation: its field description specifically limits availability to the user-posts endpoint, even though the common tweet schema also appears on this reply response. For failures, distinguish HTTP 401 authorization errors from HTTP 429 rate-limit responses and HTTP 500 internal errors; HTTP 503 identifies a failed or timed-out crawl through upstream_failed or upstream_timeout, with both cost and usage headers set to zero. These response and paging rules apply to account tweets and replies; the X API overview links the broader product, while the post-replies reference is the sibling to use for a conversation anchored to a numeric post ID. 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/replies 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.
userstringrequiredThe username of the user to search for.
countintegerThe number of tweets to fetch.
Default: 10
querystringAdvanced search query
Default:
cursorstringOpaque pagination cursor. Omit it for the first page. For the next page, send the `x-desearch-next-cursor` response header of the previous page back unchanged, with the same other parameters. A cursor is valid for 24 hours. Any other value, including an expired cursor or one from another request, returns 422 and is not charged. Pages never repeat a reply. If more than 100 replies were posted in the same second, the ones past the first 100 may be skipped.
Your API key is sent in the Authorization header.