/desearch/ai/searchSearch X posts (`twitter`) and web pages (`web`) with an optional AI summary written over the results. Web results arrive in `search` and X results in `tweets`. For web search alone, use `POST /search`, which also returns a summary when you set `summary: true`. The YouTube, Hacker News, Reddit, Wikipedia and ArXiv tools are retired. They are still accepted in `tools`, but their `youtube_search`, `hacker_news_search` and `reddit_search` keys are never returned: `youtube` is dropped, and `reddit`, `hackernews`, `wikipedia` and `arxiv` run as a Web Search pinned to their domain through `include_domains`. To scope web results to a site, use `include_domains` or put `site:<domain>` in the prompt. Billing: `ONLY_LINKS` is billed for the items returned, each unique link (by URL) and each unique X post (by post id) once, with a minimum of 10 and never more than `count`. Summary result types are billed for `count`. A search with no link in any requested tool returns 404 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 AI Contextual Search when your application needs search-grounded AI results without maintaining its own crawler, social-data pipeline, or retrieval infrastructure. 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 POST /desearch/ai/search 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.
promptstringrequiredSearch query prompt
toolsarrayrequiredTools to search with: `web` (Web Search) and/or `twitter` (X Search). Retired tools are still accepted so older clients keep working, but none of them returns its own result key. `youtube` (`Youtube Search`) is dropped from the list. `reddit`, `hackernews`, `wikipedia` and `arxiv` (also `Reddit Search`, `Hacker News Search`, `Wikipedia Search`, `ArXiv Search`) become `web` with reddit.com, news.ycombinator.com, wikipedia.org or arxiv.org added to `include_domains`, which pins the whole Web Search in the request to those domains; their results arrive in `search`. A list left with no supported tool, such as `["youtube"]`, is a 422.
start_datestringThe start date for the search query. Format: YYYY-MM-DDTHH:MM:SSZ (UTC)
end_datestringThe end date for the search query. Format: YYYY-MM-DDTHH:MM:SSZ (UTC)
date_filterstringDeprecated relative window. When set (and no start_date/end_date), it is translated to start_date/end_date. Prefer start_date/end_date.
streamingbooleanWhether to stream results
Default: true (Server-Sent Events). The playground sends false so you get one JSON response.
result_typestringThe result type to be used for the search
Default: LINKS_WITH_FINAL_SUMMARY
modestringSpeed/quality mode for the search (fast, balanced, deep). fast is web-only: X (Twitter) search supports balanced and deep.
system_messagestringThe system message to be used for the search
Default:
scoring_system_messagestringSystem message for scoring the response
countintegerThe number of results to return per source. Min 10. Max 200.
Default: 10
include_domainsarray of stringsRestrict Web Search results to these domains.
One item per line, or a JSON array. Sent as an array.
exclude_domainsarray of stringsDrop Web Search results from these domains and their subdomains (`cdc.gov` also drops `www.cdc.gov` and `wwwnc.cdc.gov`, not `notcdc.gov`). Summary citations that link to them are removed. X posts are not filtered.
One item per line, or a JSON array. Sent as an array.
highlightsbooleanInclude highlights (token-efficient key excerpts from each page) on Web Search results.
Default: true
page_textbooleanInclude the full page text on each Web Search result. Responses get significantly larger.
Default: false
Annotated 200 (non-stream)
A typical JSON object includes search[] (title, link, snippet, highlights as a list) and optional completion when result_type is LINKS_WITH_FINAL_SUMMARY. Do not document published_date on these items.
Billing headers on every response: X-Desearch-Cost-Usd, X-Desearch-Usage-Count, X-Desearch-Service, X-Desearch-Currency. JSON object bodies may also include cost_usd, usage_count, service, and currency. Streaming responses expose billing through headers only.
For sources without a completion, use POST /desearch/ai/search/links/web or POST /desearch/ai/search/links/twitter. See the Search API guide.
Your API key is sent in the Authorization header.