<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Desearch</title>
    <description>The latest articles on DEV Community by Desearch (@desearch_api).</description>
    <link>https://dev.to/desearch_api</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4258429%2F059b227a-9c78-4fbf-88c7-fbad5e0ee396.png</url>
      <title>DEV Community: Desearch</title>
      <link>https://dev.to/desearch_api</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/desearch_api"/>
    <language>en</language>
    <item>
      <title>What an AI-native web search API is</title>
      <dc:creator>Desearch</dc:creator>
      <pubDate>Mon, 23 Nov 2026 10:43:52 +0000</pubDate>
      <link>https://dev.to/desearch_api/what-an-ai-native-web-search-api-is-2b1d</link>
      <guid>https://dev.to/desearch_api/what-an-ai-native-web-search-api-is-2b1d</guid>
      <description>&lt;p&gt;&lt;a href="https://www.desearch.ai/blog/what-is-an-ai-native-web-search-api" rel="noopener noreferrer"&gt;Originally published on Desearch&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;An AI-native web search API is a search API built for a model or an agent to read the results, not a person scanning a results page. It takes the question your app is working on, searches the web, and returns sources as structured data: URLs, titles, the passages that match, dates, and, when you ask for one, a short answer with citations that point back to those sources.&lt;/p&gt;

&lt;p&gt;This post explains what that means in practice, how it differs from a classic keyword search API, and what to check before you put one behind an agent.&lt;/p&gt;

&lt;h2&gt;
  
  
  Classic search API vs AI-native search API
&lt;/h2&gt;

&lt;p&gt;A classic search API answers a keyword query with a ranked list: a title, a URL and a snippet for each result. That is the shape of a results page, turned into JSON. It works well when your own code decides what to do next: filter the links, rerank them, fetch the pages, or show them in your product.&lt;/p&gt;

&lt;p&gt;An AI-native search API goes further for the model. It returns the text a model needs to reason with, and it can return an answer that is already tied to its sources. In short: a classic search API returns ranked titles, URLs and snippets; an AI-native search API returns the source passages and a cited answer a model can use directly.&lt;/p&gt;

&lt;p&gt;For how the two compare on cost and latency, see &lt;a href="https://www.desearch.ai/blog/ai-search-vs-web-search-apis-key-differences" rel="noopener noreferrer"&gt;Traditional vs AI-Native Search API: Cost, Latency&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Desearch offers both shapes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The &lt;a href="https://www.desearch.ai/web-search-api" rel="noopener noreferrer"&gt;Web Search API&lt;/a&gt; (&lt;code&gt;GET /web&lt;/code&gt;) returns SERP-style results: up to 20 ranked results per call, each with a title, URL and snippet.&lt;/li&gt;
&lt;li&gt;Search (&lt;code&gt;POST /search&lt;/code&gt;) returns ranked pages from the Desearch index, each with the passage that best matches the query, and can add a short summary with numbered citations.&lt;/li&gt;
&lt;li&gt;The &lt;a href="https://www.desearch.ai/search-api" rel="noopener noreferrer"&gt;AI Search API&lt;/a&gt; (&lt;code&gt;POST /desearch/ai/search&lt;/code&gt;) takes a natural-language prompt and searches X posts and the web in one call, with an optional written answer.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What makes a search API AI-native
&lt;/h2&gt;

&lt;p&gt;The label is not about a single feature. It is about who reads the response. Five traits matter most when the reader is a model.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. It returns structured JSON a tool can pass on
&lt;/h3&gt;

&lt;p&gt;An agent calls search as a tool, and the tool result goes straight into the model's context. The response needs a stable shape: named fields, not HTML. With &lt;code&gt;POST /search&lt;/code&gt;, each item in &lt;code&gt;results&lt;/code&gt; has a &lt;code&gt;url&lt;/code&gt;, a &lt;code&gt;title&lt;/code&gt;, &lt;code&gt;highlights&lt;/code&gt; and a &lt;code&gt;published_date&lt;/code&gt;. The guide's advice to tool authors is direct: treat &lt;code&gt;results[]&lt;/code&gt; (and &lt;code&gt;summary&lt;/code&gt; when requested) as the tool result.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. It returns the passage, not only the link
&lt;/h3&gt;

&lt;p&gt;A model cannot read a link. It needs the text. &lt;code&gt;POST /search&lt;/code&gt; includes, for each result, the passage that best matches the query (&lt;code&gt;highlights&lt;/code&gt;, on by default). When the passage is not enough, set &lt;code&gt;page_text: true&lt;/code&gt; to include the full page text with each result. For a URL you already have, the Extract API returns the page body.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. It can return an answer tied to its sources
&lt;/h3&gt;

&lt;p&gt;Set &lt;code&gt;summary: true&lt;/code&gt; on &lt;code&gt;POST /search&lt;/code&gt; and the response also has a short answer in &lt;code&gt;summary.text&lt;/code&gt;. Each &lt;code&gt;[n]&lt;/code&gt; in that text is the &lt;code&gt;index&lt;/code&gt; of an entry in &lt;code&gt;summary.citations&lt;/code&gt;, which gives the &lt;code&gt;url&lt;/code&gt; and &lt;code&gt;title&lt;/code&gt; of the cited page. Every cited page is also in &lt;code&gt;results&lt;/code&gt;, so your code can match each sentence to its passage before anything reaches the user.&lt;/p&gt;

&lt;p&gt;The summary is optional. If it could not be written, &lt;code&gt;summary&lt;/code&gt; is &lt;code&gt;null&lt;/code&gt;, &lt;code&gt;meta.notices&lt;/code&gt; contains &lt;code&gt;"Summary unavailable."&lt;/code&gt;, and the results are still returned.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. It lets the request control the sources
&lt;/h3&gt;

&lt;p&gt;An agent should not have to trust every site on the web. &lt;code&gt;POST /search&lt;/code&gt; lets each request set:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;include_domains&lt;/code&gt;: only pages on these domains or their subdomains (at most 100).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;exclude_domains&lt;/code&gt;: never pages on these domains (at most 1,200).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;start_date&lt;/code&gt; and &lt;code&gt;end_date&lt;/code&gt;: only pages published in this range (&lt;code&gt;YYYY-MM-DD&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;mode&lt;/code&gt;: &lt;code&gt;balanced&lt;/code&gt; (the default) favors relevance, &lt;code&gt;fast&lt;/code&gt; returns results sooner.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  5. It fits how agents connect and spend
&lt;/h3&gt;

&lt;p&gt;Agents call tools, and every call has a cost. Two details help here. First, Desearch is also available as a hosted MCP server at &lt;code&gt;https://mcp.desearch.ai/mcp&lt;/code&gt;, so an MCP client can add it by URL. Listing the tools works without a key; calling a tool needs your API key in the &lt;code&gt;Authorization&lt;/code&gt; header. Second, billable responses report their own cost: JSON object bodies may include &lt;code&gt;cost_usd&lt;/code&gt;, &lt;code&gt;usage_count&lt;/code&gt;, &lt;code&gt;service&lt;/code&gt; and &lt;code&gt;currency&lt;/code&gt;, and the same values come back in the &lt;code&gt;X-Desearch-Cost-Usd&lt;/code&gt;, &lt;code&gt;X-Desearch-Usage-Count&lt;/code&gt;, &lt;code&gt;X-Desearch-Service&lt;/code&gt; and &lt;code&gt;X-Desearch-Currency&lt;/code&gt; headers. An agent loop can read them after each call and keep a running total.&lt;/p&gt;

&lt;h2&gt;
  
  
  A first AI-native search request
&lt;/h2&gt;

&lt;p&gt;Only &lt;code&gt;query&lt;/code&gt; is required. This request asks for ten results and a cited summary:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl --request POST &lt;span class="s1"&gt;'https://api.desearch.ai/search'&lt;/span&gt; \
  --header &lt;span class="s2"&gt;"Authorization: $DESEARCH_API_KEY"&lt;/span&gt; \
  --header &lt;span class="s1"&gt;'Content-Type: application/json'&lt;/span&gt; \
  --data &lt;span class="s1"&gt;'{
    "query": "latest Bittensor subnet 22 updates",
    "count": 10,
    "summary": true
  }'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The response has ranked &lt;code&gt;results&lt;/code&gt; and a &lt;code&gt;summary&lt;/code&gt; with &lt;code&gt;text&lt;/code&gt; and numbered &lt;code&gt;citations&lt;/code&gt; (&lt;code&gt;index&lt;/code&gt;, &lt;code&gt;url&lt;/code&gt;, &lt;code&gt;title&lt;/code&gt;). The fields an agent usually reads:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;What it holds&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;results[].url&lt;/code&gt; / &lt;code&gt;title&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;The page to cite&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;results[].highlights&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Passages that best match the query&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;results[].published_date&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;YYYY-MM-DD&lt;/code&gt; when known; can be &lt;code&gt;null&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;summary.text&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Short answer; &lt;code&gt;[n]&lt;/code&gt; marks the citation with that index&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;summary.citations[]&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;index&lt;/code&gt;, &lt;code&gt;url&lt;/code&gt; and &lt;code&gt;title&lt;/code&gt; of each cited page&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;meta.notices&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Notes on the answer&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Treat a &lt;code&gt;null&lt;/code&gt; date as unknown, not as recent.&lt;/p&gt;

&lt;h2&gt;
  
  
  When you need X posts as well as web pages
&lt;/h2&gt;

&lt;p&gt;Some questions are about what people are saying right now, not only what pages say. The AI Search API (&lt;code&gt;POST /desearch/ai/search&lt;/code&gt;) takes a &lt;code&gt;prompt&lt;/code&gt; and the sources to search in &lt;code&gt;tools&lt;/code&gt;: &lt;code&gt;web&lt;/code&gt;, &lt;code&gt;twitter&lt;/code&gt;, or both:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl --request POST &lt;span class="s1"&gt;'https://api.desearch.ai/desearch/ai/search'&lt;/span&gt; \
  --header &lt;span class="s2"&gt;"Authorization: $DESEARCH_API_KEY"&lt;/span&gt; \
  --header &lt;span class="s1"&gt;'Content-Type: application/json'&lt;/span&gt; \
  --data &lt;span class="s1"&gt;'{
    "prompt": "latest research on AI search benchmarks",
    "tools": ["web", "twitter"],
    "streaming": false,
    "count": 10
  }'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Web results come back in &lt;code&gt;search&lt;/code&gt;, each with a &lt;code&gt;link&lt;/code&gt;, &lt;code&gt;title&lt;/code&gt;, &lt;code&gt;snippet&lt;/code&gt; and &lt;code&gt;highlights&lt;/code&gt;. X posts come back in &lt;code&gt;tweets&lt;/code&gt;. By default the response also has &lt;code&gt;completion&lt;/code&gt;, a summary over the results. An empty &lt;code&gt;search&lt;/code&gt; or &lt;code&gt;tweets&lt;/code&gt; array, or a &lt;code&gt;tool_no_results&lt;/code&gt; warning, means that source found nothing; it does not mean the other source failed. Build your agent to treat that as a valid outcome.&lt;/p&gt;

&lt;h2&gt;
  
  
  Which one to use
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Your code decides what to read:&lt;/strong&gt; use ranked links from &lt;code&gt;GET /web&lt;/code&gt;, then fetch the pages you pick with the Extract API.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Your model needs web passages and a cited answer:&lt;/strong&gt; use &lt;code&gt;POST /search&lt;/code&gt; with &lt;code&gt;summary: true&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The question needs X posts too:&lt;/strong&gt; use &lt;code&gt;POST /desearch/ai/search&lt;/code&gt; with &lt;code&gt;tools: ["web", "twitter"]&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Your agent runs in an MCP client:&lt;/strong&gt; connect the hosted MCP server and use your client's live tool list.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What to check before you rely on one
&lt;/h2&gt;

&lt;p&gt;Whichever API you choose, test it against the questions your users ask, not generic ones. Check that every cited sentence maps to a returned source, that the passages actually say what the answer says, that dates are present when freshness matters, and that empty results are handled without breaking the agent. A citation tells you where a sentence came from; it does not prove the sentence is true.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;Create an API key in Desearch Console, store it as &lt;code&gt;DESEARCH_API_KEY&lt;/code&gt; on your server, and run the &lt;code&gt;POST /search&lt;/code&gt; request above. The full parameter lists and response schemas are in the API reference.&lt;/p&gt;

</description>
      <category>agents</category>
      <category>ai</category>
      <category>api</category>
      <category>search</category>
    </item>
    <item>
      <title>Search results with sources you can check</title>
      <dc:creator>Desearch</dc:creator>
      <pubDate>Mon, 23 Nov 2026 10:43:38 +0000</pubDate>
      <link>https://dev.to/desearch_api/search-results-with-sources-you-can-check-1dn6</link>
      <guid>https://dev.to/desearch_api/search-results-with-sources-you-can-check-1dn6</guid>
      <description>&lt;p&gt;&lt;a href="https://www.desearch.ai/blog/search-results-with-sources-you-can-check" rel="noopener noreferrer"&gt;Originally published on Desearch&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;An answer is only as useful as your ability to check it. When an AI app tells a user that something is true, the user should be able to see where that came from: which page, which passage, and when it was published.&lt;/p&gt;

&lt;p&gt;So, can a search API return relevant web sources? Yes, if the response is built for it. The Desearch Search API (&lt;code&gt;POST /search&lt;/code&gt;) returns ranked pages, each with its URL, title and the passage that best matches the query, and it can add a short answer whose numbered citations point back to those pages. This post shows how to request those sources, how to check each one, and how to limit which sites can appear.&lt;/p&gt;

&lt;h2&gt;
  
  
  What makes a source checkable
&lt;/h2&gt;

&lt;p&gt;A link alone is not enough. To check a claim quickly, a reader or an agent needs four things for each source:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The URL&lt;/strong&gt;, to open the page.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The title&lt;/strong&gt;, to see what the page is.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The passage&lt;/strong&gt; that matched, to see the exact text behind the claim.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The date&lt;/strong&gt;, to judge whether the information is current.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;POST /search&lt;/code&gt; returns all four for each result: &lt;code&gt;url&lt;/code&gt;, &lt;code&gt;title&lt;/code&gt;, &lt;code&gt;highlights&lt;/code&gt; and &lt;code&gt;published_date&lt;/code&gt;. The date is given as &lt;code&gt;YYYY-MM-DD&lt;/code&gt; when it is known and can be &lt;code&gt;null&lt;/code&gt;, so treat a missing date as unknown, not as recent.&lt;/p&gt;

&lt;h2&gt;
  
  
  Request sources with POST /search
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;POST /search&lt;/code&gt; searches the web from the Desearch index. Only &lt;code&gt;query&lt;/code&gt; is required. Add &lt;code&gt;summary: true&lt;/code&gt; to also get a short answer written from the results.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl --request POST &lt;span class="s1"&gt;'https://api.desearch.ai/search'&lt;/span&gt; \
  --header &lt;span class="s2"&gt;"Authorization: $DESEARCH_API_KEY"&lt;/span&gt; \
  --header &lt;span class="s1"&gt;'Content-Type: application/json'&lt;/span&gt; \
  --data &lt;span class="s1"&gt;'{
    "query": "Who won the 2024 Nobel Prize in Physics?",
    "count": 10,
    "summary": true
  }'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The sources and the cited answer in the response, from the Search API guide (the &lt;code&gt;meta&lt;/code&gt; and billing fields are left out here):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"results"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nl"&gt;"url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"https://www.nobelprize.org/prizes/physics/2024/summary/"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nl"&gt;"title"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"The Nobel Prize in Physics 2024"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nl"&gt;"published_date"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"2024-10-08"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nl"&gt;"highlights"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="s2"&gt;"The Nobel Prize in Physics 2024 was awarded jointly to John J. Hopfield and Geoffrey Hinton."&lt;/span&gt;
      &lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"summary"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;"text"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"John J. Hopfield and Geoffrey Hinton won the 2024 Nobel Prize in Physics [1]."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"citations"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nl"&gt;"index"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nl"&gt;"url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"https://www.nobelprize.org/prizes/physics/2024/summary/"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nl"&gt;"title"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"The Nobel Prize in Physics 2024"&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  How to check a cited answer
&lt;/h2&gt;

&lt;p&gt;The summary marks each cited sentence with &lt;code&gt;[n]&lt;/code&gt;. That number is the &lt;code&gt;index&lt;/code&gt; of an entry in &lt;code&gt;summary.citations&lt;/code&gt;, which gives the &lt;code&gt;url&lt;/code&gt; and &lt;code&gt;title&lt;/code&gt; of the cited page. Every cited page is also in &lt;code&gt;results&lt;/code&gt;, so you can find its passage and date there.&lt;/p&gt;

&lt;p&gt;A simple check for each sentence in the answer:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Find the marker.&lt;/strong&gt; Read the &lt;code&gt;[n]&lt;/code&gt; at the end of the sentence.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Match the citation.&lt;/strong&gt; Look up the entry in &lt;code&gt;summary.citations&lt;/code&gt; with that &lt;code&gt;index&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Find the result.&lt;/strong&gt; Find the item in &lt;code&gt;results&lt;/code&gt; with the same &lt;code&gt;url&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Compare the text.&lt;/strong&gt; Read its &lt;code&gt;highlights&lt;/code&gt;. In the example above, the passage says the prize "was awarded jointly to John J. Hopfield and Geoffrey Hinton", which is what the sentence states.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check the date.&lt;/strong&gt; Use &lt;code&gt;published_date&lt;/code&gt; to decide whether the page is recent enough for the question.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Open the page&lt;/strong&gt; when the passage is not enough, or when the claim matters.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Steps 1 to 3 can run in code before anything reaches the user. A sentence with no marker, or with a marker that has no matching citation, is a sentence to drop or to show without a source.&lt;/p&gt;

&lt;p&gt;The summary is only returned when you set &lt;code&gt;summary: true&lt;/code&gt;. If it could not be written, &lt;code&gt;summary&lt;/code&gt; is &lt;code&gt;null&lt;/code&gt;, &lt;code&gt;meta.notices&lt;/code&gt; contains &lt;code&gt;"Summary unavailable."&lt;/code&gt;, and the results are still returned. Your app can then show the sources on their own.&lt;/p&gt;

&lt;h2&gt;
  
  
  Choose which sources can appear
&lt;/h2&gt;

&lt;p&gt;Relevance starts with the sites you allow. &lt;code&gt;POST /search&lt;/code&gt; lets you set this in the request:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;include_domains&lt;/code&gt;: only return pages on these domains or their subdomains (at most 100).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;exclude_domains&lt;/code&gt;: never return pages on these domains (at most 1,200).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;start_date&lt;/code&gt; and &lt;code&gt;end_date&lt;/code&gt;: only pages published in this range (&lt;code&gt;YYYY-MM-DD&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;mode&lt;/code&gt;: &lt;code&gt;balanced&lt;/code&gt; (the default) favors relevance, &lt;code&gt;fast&lt;/code&gt; returns results sooner.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example, a support assistant can limit results to a product's public documentation site and a few trusted references, so every source a user sees comes from that list.&lt;/p&gt;

&lt;h2&gt;
  
  
  Read the full page before you rely on it
&lt;/h2&gt;

&lt;p&gt;A passage shows why a page matched. It does not show the context around it. When you need that context, you have two options:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Set &lt;code&gt;page_text: true&lt;/code&gt; on &lt;code&gt;POST /search&lt;/code&gt; to include the full page text with each result.&lt;/li&gt;
&lt;li&gt;Send a source URL to the &lt;a href="https://www.desearch.ai/web-extract-api" rel="noopener noreferrer"&gt;Extract API&lt;/a&gt;, which returns the page as text, markdown or HTML:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GET https://api.desearch.ai/web/extract?url=https://example.com&amp;amp;format=text
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Reading the source page is how an agent catches a passage taken out of context, or a page that says more than the snippet shows.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sources from X and the web together
&lt;/h2&gt;

&lt;p&gt;When the question needs posts from X as well as web pages, use the &lt;a href="https://www.desearch.ai/search-api" rel="noopener noreferrer"&gt;AI Search API&lt;/a&gt; (&lt;code&gt;POST /desearch/ai/search&lt;/code&gt;) with &lt;code&gt;tools&lt;/code&gt; set to &lt;code&gt;web&lt;/code&gt;, &lt;code&gt;twitter&lt;/code&gt; or both. It returns the sources it found, each with a link, and by default a written summary of them. Our post &lt;a href="https://www.desearch.ai/blog/ai-search-api-links-vs-cited-answers" rel="noopener noreferrer"&gt;AI Search API with source links on every answer&lt;/a&gt; walks through that request and its response.&lt;/p&gt;

&lt;h2&gt;
  
  
  What a citation does and does not prove
&lt;/h2&gt;

&lt;p&gt;A citation tells you where a sentence came from. It does not prove the sentence is true, and it does not prove the page is right. Checking that a cited link is one of the returned sources is a check on the citation, not on the claim.&lt;/p&gt;

&lt;p&gt;That is why the passage, the date and the page itself matter. Show them to the user, keep the source URL next to the generated answer, and let the reader decide when the stakes are high.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;Create an API key in Desearch Console, store it as &lt;code&gt;DESEARCH_API_KEY&lt;/code&gt; on your server, and run the &lt;code&gt;POST /search&lt;/code&gt; request above with &lt;code&gt;summary: true&lt;/code&gt;. Then follow one &lt;code&gt;[n]&lt;/code&gt; marker back to its page. The full parameter lists and response schemas are in the API reference.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>api</category>
      <category>search</category>
    </item>
    <item>
      <title>How to choose a search API for LLM apps and internal chatbots</title>
      <dc:creator>Desearch</dc:creator>
      <pubDate>Mon, 23 Nov 2026 10:43:26 +0000</pubDate>
      <link>https://dev.to/desearch_api/how-to-choose-a-search-api-for-llm-apps-and-internal-chatbots-3e3n</link>
      <guid>https://dev.to/desearch_api/how-to-choose-a-search-api-for-llm-apps-and-internal-chatbots-3e3n</guid>
      <description>&lt;p&gt;&lt;a href="https://www.desearch.ai/blog/how-to-choose-a-search-api-for-llm-apps" rel="noopener noreferrer"&gt;Originally published on Desearch&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;A language model on its own answers from what it learned in training. When a user of your LLM app or internal chatbot asks about something recent, the model needs live web results, and a search API is one way to get them. The best search API for an LLM is the one whose answers your model can quote and your team can check: every result tied to a URL, the right amount of text per result, filters for date and domain, a clear cost on each call, and errors you can plan for.&lt;/p&gt;

&lt;p&gt;This checklist walks through what to test before you commit, using the Desearch Search API as the worked example.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Every result should come with a source you can cite
&lt;/h2&gt;

&lt;p&gt;An internal chatbot that answers without a link is hard to trust. Before anything else, check that each result in the response carries the page it came from.&lt;/p&gt;

&lt;p&gt;In the Desearch Search API (&lt;code&gt;POST /search&lt;/code&gt;), each item in &lt;code&gt;results&lt;/code&gt; has a &lt;code&gt;url&lt;/code&gt; and a &lt;code&gt;title&lt;/code&gt;. If you set &lt;code&gt;summary: true&lt;/code&gt;, the response also includes a short answer in &lt;code&gt;summary.text&lt;/code&gt;, where &lt;code&gt;[n]&lt;/code&gt; marks the citation with that &lt;code&gt;index&lt;/code&gt; in &lt;code&gt;summary.citations&lt;/code&gt;. Every cited page is also in &lt;code&gt;results&lt;/code&gt;, so your app can show the answer and the links side by side. The summary has no extra charge.&lt;/p&gt;

&lt;p&gt;Here is the first call from the docs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl --request POST &lt;span class="s1"&gt;'https://api.desearch.ai/search'&lt;/span&gt; \
  --header &lt;span class="s2"&gt;"Authorization: $DESEARCH_API_KEY"&lt;/span&gt; \
  --header &lt;span class="s1"&gt;'Content-Type: application/json'&lt;/span&gt; \
  --data &lt;span class="s1"&gt;'{
    "query": "Who won the 2024 Nobel Prize in Physics?",
    "count": 10,
    "summary": true
  }'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And the shape of what comes back:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"results"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nl"&gt;"url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"https://www.nobelprize.org/prizes/physics/2024/summary/"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nl"&gt;"title"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"The Nobel Prize in Physics 2024"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nl"&gt;"published_date"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"2024-10-08"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nl"&gt;"highlights"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="s2"&gt;"The Nobel Prize in Physics 2024 was awarded jointly to John J. Hopfield and Geoffrey Hinton."&lt;/span&gt;
      &lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"summary"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;"text"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"John J. Hopfield and Geoffrey Hinton won the 2024 Nobel Prize in Physics [1]."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"citations"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nl"&gt;"index"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nl"&gt;"url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"https://www.nobelprize.org/prizes/physics/2024/summary/"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nl"&gt;"title"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"The Nobel Prize in Physics 2024"&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"meta"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"notices"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"cost_usd"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.003&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"usage_count"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"service"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Search API"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"currency"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"USD"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  2. The response should fit your context window
&lt;/h2&gt;

&lt;p&gt;Search results take up room in the prompt, and longer prompts usually cost more and leave less space for the rest of the conversation. A good search API lets you choose how much text you get back.&lt;/p&gt;

&lt;p&gt;The Search API returns &lt;code&gt;highlights&lt;/code&gt; by default: the passage of each page that best matches the query. That is often enough for a chatbot answer. When the model needs the whole page, set &lt;code&gt;page_text: true&lt;/code&gt; to include the full page text. You also pick the number of results with &lt;code&gt;count&lt;/code&gt;: 10 (the default), 15 or 20.&lt;/p&gt;

&lt;p&gt;If your app already knows which page it needs, for example a link the user pasted, you do not need a search at all. The &lt;a href="https://www.desearch.ai/web-extract-api" rel="noopener noreferrer"&gt;Desearch Extract API&lt;/a&gt; fetches a public URL and returns its content as text, markdown or HTML.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. You should control freshness
&lt;/h2&gt;

&lt;p&gt;Internal chatbots get asked "what changed this week?" more often than you might expect. Check whether the API can limit results by date, and whether it tells you the date of each page.&lt;/p&gt;

&lt;p&gt;The Search API takes &lt;code&gt;start_date&lt;/code&gt; and &lt;code&gt;end_date&lt;/code&gt; (&lt;code&gt;YYYY-MM-DD&lt;/code&gt;) to return only pages published in that range. Each result has &lt;code&gt;published_date&lt;/code&gt; when it is known. It can be &lt;code&gt;null&lt;/code&gt;, so your prompt should handle a result without a date instead of guessing one.&lt;/p&gt;

&lt;p&gt;There is also a &lt;code&gt;mode&lt;/code&gt; setting: &lt;code&gt;fast&lt;/code&gt; returns results sooner, and &lt;code&gt;balanced&lt;/code&gt; (the default) favors relevance. A chatbot that answers in a live chat window and a research job that runs overnight may want different settings.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Domain filters matter inside a company
&lt;/h2&gt;

&lt;p&gt;An internal chatbot often has rules about where answers may come from: your own public docs, a set of trusted publishers, or anything except a few sites.&lt;/p&gt;

&lt;p&gt;The Search API has &lt;code&gt;include_domains&lt;/code&gt; (only return pages on these domains or their subdomains, at most 100) and &lt;code&gt;exclude_domains&lt;/code&gt; (never return pages on these domains, at most 1,200). When both apply, exclusion wins over &lt;code&gt;include_domains&lt;/code&gt; and &lt;code&gt;site:&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;One honest limit to plan for: a web search API searches the public web. The Search API searches the web from the Desearch index. Your private wiki and tickets stay in your own retrieval system, and the chatbot combines both.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Some questions need more than web pages
&lt;/h2&gt;

&lt;p&gt;Questions about a launch, a market or a public figure often have their freshest answers in posts, not articles. If your users ask those, check whether the API covers them.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.desearch.ai/search-api" rel="noopener noreferrer"&gt;Desearch AI Search&lt;/a&gt; (&lt;code&gt;POST /desearch/ai/search&lt;/code&gt;) takes a natural-language prompt and searches X posts (&lt;code&gt;twitter&lt;/code&gt;) and the web (&lt;code&gt;web&lt;/code&gt;) in one call, with an optional summary. Use &lt;code&gt;POST /search&lt;/code&gt; when you need web results only.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. You should see the cost of every call
&lt;/h2&gt;

&lt;p&gt;Usage-based pricing is easy to reason about only if each response tells you what it cost. Billable Desearch responses expose the cost in headers: &lt;code&gt;X-Desearch-Cost-Usd&lt;/code&gt;, &lt;code&gt;X-Desearch-Usage-Count&lt;/code&gt;, &lt;code&gt;X-Desearch-Service&lt;/code&gt; and &lt;code&gt;X-Desearch-Currency&lt;/code&gt;. JSON object bodies may also include &lt;code&gt;cost_usd&lt;/code&gt;, &lt;code&gt;usage_count&lt;/code&gt;, &lt;code&gt;service&lt;/code&gt; and &lt;code&gt;currency&lt;/code&gt;. Log them per request and you can see what the search part of each chatbot answer costs; model tokens and your other services are billed separately. Rates are on the &lt;a href="https://www.desearch.ai/pricing" rel="noopener noreferrer"&gt;pricing page&lt;/a&gt;, and Console shows the rates for your account.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Errors should be documented, so you can plan for them
&lt;/h2&gt;

&lt;p&gt;A chatbot should degrade gracefully, not crash. Read the error list before you build:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;401&lt;/code&gt;: missing, invalid, revoked or wrong-environment API key.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;422&lt;/code&gt;: a bad parameter name, enum or request body.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;429&lt;/code&gt;: a rate or account limit. Add retry with backoff.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;500&lt;/code&gt;: retry later.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Partial results matter too. If the Search API could not write a summary, &lt;code&gt;summary&lt;/code&gt; is &lt;code&gt;null&lt;/code&gt;, &lt;code&gt;meta.notices&lt;/code&gt; contains "Summary unavailable.", and the results are still returned. Your app can then answer from the results alone.&lt;/p&gt;

&lt;h2&gt;
  
  
  8. It should plug into the way you build
&lt;/h2&gt;

&lt;p&gt;Check how the API reaches your code. Desearch offers plain REST, a Python SDK (&lt;code&gt;pip install desearch-py&lt;/code&gt;) and a JavaScript SDK (&lt;code&gt;npm install desearch-js&lt;/code&gt;, Node.js 20.18.1 or later). For agents and chat clients that speak the Model Context Protocol, there is a hosted MCP server at &lt;code&gt;https://mcp.desearch.ai/mcp&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Whatever the route, keep the key on the server: store it as &lt;code&gt;DESEARCH_API_KEY&lt;/code&gt; in an environment variable or a secret manager, and never ship it in a browser bundle.&lt;/p&gt;

&lt;h2&gt;
  
  
  The checklist
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Question&lt;/th&gt;
&lt;th&gt;What to look for in the Search API&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Can the model cite its sources?&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;url&lt;/code&gt; and &lt;code&gt;title&lt;/code&gt; on every result; &lt;code&gt;summary.citations&lt;/code&gt; with &lt;code&gt;index&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Does it fit the context window?&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;highlights&lt;/code&gt; by default, &lt;code&gt;page_text&lt;/code&gt; on request, &lt;code&gt;count&lt;/code&gt; of 10, 15 or 20&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Can you control freshness?&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;start_date&lt;/code&gt;, &lt;code&gt;end_date&lt;/code&gt;, &lt;code&gt;published_date&lt;/code&gt; (can be &lt;code&gt;null&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Can you limit where answers come from?&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;include_domains&lt;/code&gt;, &lt;code&gt;exclude_domains&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Do you need posts as well as pages?&lt;/td&gt;
&lt;td&gt;AI Search with &lt;code&gt;tools: ["web", "twitter"]&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Can you see the cost?&lt;/td&gt;
&lt;td&gt;Cost headers on billable responses; JSON object bodies may also include &lt;code&gt;cost_usd&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Are failures predictable?&lt;/td&gt;
&lt;td&gt;Documented &lt;code&gt;401&lt;/code&gt;, &lt;code&gt;422&lt;/code&gt;, &lt;code&gt;429&lt;/code&gt;, &lt;code&gt;500&lt;/code&gt;; &lt;code&gt;summary: null&lt;/code&gt; with a notice&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Does it fit your stack?&lt;/td&gt;
&lt;td&gt;REST, Python and JavaScript SDKs, hosted MCP&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The fastest way to decide is to run your own questions through it. Take the questions your users really ask, call the API with them, and read the results with the checklist above next to you. If you are also weighing providers against each other, our &lt;a href="https://www.desearch.ai/blog/best-web-search-apis-for-ai-agents" rel="noopener noreferrer"&gt;comparison of web search APIs for AI agents&lt;/a&gt; is a good next read.&lt;/p&gt;

&lt;p&gt;To try it, create an API key in &lt;a href="https://console.desearch.ai/" rel="noopener noreferrer"&gt;Desearch Console&lt;/a&gt; and start with the &lt;a href="https://www.desearch.ai/docs/guide/apis/search-api" rel="noopener noreferrer"&gt;Search API guide&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>api</category>
      <category>llm</category>
      <category>search</category>
    </item>
    <item>
      <title>Structured web search results as JSON for AI agents</title>
      <dc:creator>Desearch</dc:creator>
      <pubDate>Mon, 23 Nov 2026 10:43:00 +0000</pubDate>
      <link>https://dev.to/desearch_api/structured-web-search-results-as-json-for-ai-agents-3gh2</link>
      <guid>https://dev.to/desearch_api/structured-web-search-results-as-json-for-ai-agents-3gh2</guid>
      <description>&lt;p&gt;&lt;a href="https://www.desearch.ai/blog/structured-web-search-results-json-ai-agents" rel="noopener noreferrer"&gt;Originally published on Desearch&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;When an AI agent calls a search tool, its code has to read the results. A structured search results API makes that simple: it returns JSON, a list of items with the same fields every time, so code can read a title, follow a URL, quote a passage and keep the source next to the answer.&lt;/p&gt;

&lt;p&gt;Desearch has two endpoints that return web results as structured JSON:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;GET /web&lt;/code&gt;, the &lt;a href="https://www.desearch.ai/web-search-api" rel="noopener noreferrer"&gt;Web Search API&lt;/a&gt;: SERP-style ranked results for a keyword query, each with a title, link and snippet.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;POST /search&lt;/code&gt;, the Search API: ranked pages from the Desearch index, each with the passage that best matches the query, plus an optional short summary with numbered citations.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This post shows the request, the response shape and the fields an agent should read for each one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why agents need structured results
&lt;/h2&gt;

&lt;p&gt;An agent usually runs search as one tool call in a longer loop: decide, search, read, answer or act. Each step works better when the search result has a fixed shape.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Parsing.&lt;/strong&gt; Fixed keys mean no HTML scraping and no guessing where the URL is.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Grounding.&lt;/strong&gt; Every result carries its URL, so the agent can cite it or fetch the page.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Control.&lt;/strong&gt; Code can filter, rerank or drop results before the model sees them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cost tracking.&lt;/strong&gt; Desearch reports the cost of each request with the response, so usage can be logged per call.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Option 1: ranked links with GET /web
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;GET /web&lt;/code&gt; takes a &lt;code&gt;query&lt;/code&gt; and returns up to 20 ranked results per request.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl --request GET \
  --url &lt;span class="s1"&gt;'https://api.desearch.ai/web?query=latest+open+source+RAG+research'&lt;/span&gt; \
  --header &lt;span class="s2"&gt;"Authorization: $DESEARCH_API_KEY"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The response is a JSON object with a &lt;code&gt;data&lt;/code&gt; list. This shows its shape, with placeholder values in place of a real result:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"data"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nl"&gt;"link"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"https://example.com/page"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nl"&gt;"snippet"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"A short excerpt of the page ..."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nl"&gt;"title"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Page title"&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;What the agent does with it&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;data[].title&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Shows or ranks the result&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;data[].link&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Cites the source or fetches the page&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;data[].snippet&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Short excerpt for a first relevance check. It is an empty string when the page has no text summary&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Two parameters control the request:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;query&lt;/code&gt; (required). An empty or whitespace-only query returns 422 and is not charged.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;start&lt;/code&gt; (optional, default 0). How many results to skip, from 0 to 100. &lt;code&gt;start=10&lt;/code&gt; returns results beginning at the 11th.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A few behaviors are worth coding for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No results, including a &lt;code&gt;start&lt;/code&gt; past the last result, return 200 with &lt;code&gt;data: []&lt;/code&gt; and are not charged. A blocked query also returns 200 with no results and is not charged.&lt;/li&gt;
&lt;li&gt;A search failure or timeout returns 503 and is not charged.&lt;/li&gt;
&lt;li&gt;Billable responses carry the &lt;code&gt;X-Desearch-Cost-Usd&lt;/code&gt;, &lt;code&gt;X-Desearch-Usage-Count&lt;/code&gt;, &lt;code&gt;X-Desearch-Service&lt;/code&gt; and &lt;code&gt;X-Desearch-Currency&lt;/code&gt; headers.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here is a minimal Python call, from the Desearch Web Search API quickstart. It uses only the standard library:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;urllib&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;parse&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;urllib&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;
&lt;span class="n"&gt;url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"https://api.desearch.ai/web?"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;urllib&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;parse&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;urlencode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"query"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"bittensor subnet"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"start"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;req&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;urllib&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Request&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"Authorization"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"DESEARCH_API_KEY"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;urllib&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;urlopen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;60&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"X-Desearch-Cost-Usd"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;item&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;load&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"data"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"title"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"link"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use &lt;code&gt;GET /web&lt;/code&gt; when you want ranked links to filter, rerank, extract or show in your own product.&lt;/p&gt;

&lt;h2&gt;
  
  
  Option 2: pages with passages and a cited summary with POST /search
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;POST /search&lt;/code&gt; searches the web from the Desearch index. Each result comes with the passage that best matches the query, so the agent gets text to read, not only a link. Only &lt;code&gt;query&lt;/code&gt; is required.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl --request POST &lt;span class="s1"&gt;'https://api.desearch.ai/search'&lt;/span&gt; \
  --header &lt;span class="s2"&gt;"Authorization: $DESEARCH_API_KEY"&lt;/span&gt; \
  --header &lt;span class="s1"&gt;'Content-Type: application/json'&lt;/span&gt; \
  --data &lt;span class="s1"&gt;'{
    "query": "Who won the 2024 Nobel Prize in Physics?",
    "count": 10,
    "summary": true
  }'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The response, as shown in the Search API guide:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"results"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nl"&gt;"url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"https://www.nobelprize.org/prizes/physics/2024/summary/"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nl"&gt;"title"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"The Nobel Prize in Physics 2024"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nl"&gt;"published_date"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"2024-10-08"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nl"&gt;"highlights"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="s2"&gt;"The Nobel Prize in Physics 2024 was awarded jointly to John J. Hopfield and Geoffrey Hinton."&lt;/span&gt;
      &lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"summary"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;"text"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"John J. Hopfield and Geoffrey Hinton won the 2024 Nobel Prize in Physics [1]."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"citations"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nl"&gt;"index"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nl"&gt;"url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"https://www.nobelprize.org/prizes/physics/2024/summary/"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nl"&gt;"title"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"The Nobel Prize in Physics 2024"&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"meta"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"notices"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"cost_usd"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.003&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"usage_count"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"service"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Search API"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"currency"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"USD"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;What the agent does with it&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;results[].url&lt;/code&gt;, &lt;code&gt;results[].title&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;The page to cite&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;results[].highlights&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Passages that best match the query. Left out when &lt;code&gt;highlights&lt;/code&gt; is &lt;code&gt;false&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;results[].published_date&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Date (&lt;code&gt;YYYY-MM-DD&lt;/code&gt;) when known. Can be &lt;code&gt;null&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;summary.text&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Short answer. &lt;code&gt;[n]&lt;/code&gt; marks the citation with that &lt;code&gt;index&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;summary.citations[]&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;index&lt;/code&gt;, &lt;code&gt;url&lt;/code&gt; and &lt;code&gt;title&lt;/code&gt; of each cited page. Every cited page is also in &lt;code&gt;results&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;meta.notices&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Notes on the answer&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;cost_usd&lt;/code&gt;, &lt;code&gt;usage_count&lt;/code&gt;, &lt;code&gt;service&lt;/code&gt;, &lt;code&gt;currency&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;What the request cost, for your own usage log&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The request body gives the agent more control than a keyword query:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;count&lt;/code&gt;: 10 (default), 15 or 20 results.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;mode&lt;/code&gt;: &lt;code&gt;fast&lt;/code&gt; returns results sooner, &lt;code&gt;balanced&lt;/code&gt; (default) favors relevance.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;start_date&lt;/code&gt; and &lt;code&gt;end_date&lt;/code&gt;: only pages published in this range (&lt;code&gt;YYYY-MM-DD&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;include_domains&lt;/code&gt; (at most 100) and &lt;code&gt;exclude_domains&lt;/code&gt; (at most 1,200): limit results to the sites you trust, or keep some out.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;highlights&lt;/code&gt; (default &lt;code&gt;true&lt;/code&gt;): include the passage that best matches the query.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;page_text&lt;/code&gt; (default &lt;code&gt;false&lt;/code&gt;): include the full page text. The two flags are set separately, so a result can carry both, either or neither.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;summary&lt;/code&gt; (default &lt;code&gt;false&lt;/code&gt;): add the short answer with numbered citations.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The summary is only returned when the request sets &lt;code&gt;summary: true&lt;/code&gt;. If it could not be written, &lt;code&gt;summary&lt;/code&gt; is &lt;code&gt;null&lt;/code&gt;, &lt;code&gt;meta.notices&lt;/code&gt; contains &lt;code&gt;"Summary unavailable."&lt;/code&gt;, and the results are still returned. An agent should check for that case and fall back to the results.&lt;/p&gt;

&lt;h2&gt;
  
  
  Handling the JSON in an agent
&lt;/h2&gt;

&lt;p&gt;A few habits make structured search results safe to pass to a model:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Validate at the boundary.&lt;/strong&gt; Check the response against the schema in the &lt;a href="https://www.desearch.ai/docs/api-reference/get-web" rel="noopener noreferrer"&gt;API reference&lt;/a&gt; before the model sees it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Handle empty results.&lt;/strong&gt; An empty &lt;code&gt;data&lt;/code&gt; or &lt;code&gt;results&lt;/code&gt; list is a normal 200 response, not an error. On &lt;code&gt;GET /web&lt;/code&gt; it can come from a search with no results, a &lt;code&gt;start&lt;/code&gt; past the last result, or a blocked query, and the response does not say which. Let the agent report that it found nothing or try another query.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keep the source with the claim.&lt;/strong&gt; Preserve source URLs with the generated answer so users can inspect the evidence.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Retry only transient failures.&lt;/strong&gt; Use timeouts, back off on retries and log the response status.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Log the cost fields.&lt;/strong&gt; They let you reconcile usage per tool call.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Which endpoint to use
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Ranked links for a keyword query:&lt;/strong&gt; &lt;code&gt;GET /web&lt;/code&gt; on the &lt;a href="https://www.desearch.ai/web-search-api" rel="noopener noreferrer"&gt;Web Search API&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pages with the best matching passage, and an optional cited answer:&lt;/strong&gt; &lt;code&gt;POST /search&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;X posts and web results together, with an optional written answer:&lt;/strong&gt; the &lt;a href="https://www.desearch.ai/search-api" rel="noopener noreferrer"&gt;AI Search API&lt;/a&gt; (&lt;code&gt;POST /desearch/ai/search&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To try them, create an API key in &lt;a href="https://console.desearch.ai" rel="noopener noreferrer"&gt;Desearch Console&lt;/a&gt;, store it as &lt;code&gt;DESEARCH_API_KEY&lt;/code&gt; on your server, and run one of the calls above. The full parameter lists and response schemas are in the &lt;a href="https://www.desearch.ai/docs/api-reference/get-web" rel="noopener noreferrer"&gt;API reference&lt;/a&gt; and the &lt;a href="https://www.desearch.ai/docs/guide/apis/search-api" rel="noopener noreferrer"&gt;Search API guide&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Frequently asked questions
&lt;/h2&gt;

&lt;h3&gt;
  
  
  What does a structured search results API return?
&lt;/h3&gt;

&lt;p&gt;JSON with the same fields for every result. Desearch &lt;code&gt;GET /web&lt;/code&gt; returns a &lt;code&gt;data&lt;/code&gt; list of up to 20 results per request, each with &lt;code&gt;title&lt;/code&gt;, &lt;code&gt;link&lt;/code&gt; and &lt;code&gt;snippet&lt;/code&gt;. &lt;code&gt;POST /search&lt;/code&gt; returns &lt;code&gt;results&lt;/code&gt;, each with &lt;code&gt;url&lt;/code&gt;, &lt;code&gt;title&lt;/code&gt;, &lt;code&gt;published_date&lt;/code&gt; (when known) and, unless the request sets &lt;code&gt;highlights: false&lt;/code&gt;, &lt;code&gt;highlights&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  What does an empty result list mean?
&lt;/h3&gt;

&lt;p&gt;That the request returned no results, not that it failed. On &lt;code&gt;GET /web&lt;/code&gt;, a 200 with &lt;code&gt;data: []&lt;/code&gt; comes back for a search with no results, a &lt;code&gt;start&lt;/code&gt; past the last result, or a blocked query, and that request is not charged.&lt;/p&gt;

&lt;h3&gt;
  
  
  How do I get a cited answer with the results?
&lt;/h3&gt;

&lt;p&gt;Set &lt;code&gt;summary: true&lt;/code&gt; on &lt;code&gt;POST /search&lt;/code&gt;. The response adds &lt;code&gt;summary.text&lt;/code&gt;, where &lt;code&gt;[n]&lt;/code&gt; marks a citation, and &lt;code&gt;summary.citations[]&lt;/code&gt; with the &lt;code&gt;index&lt;/code&gt;, &lt;code&gt;url&lt;/code&gt; and &lt;code&gt;title&lt;/code&gt; of each cited page.&lt;/p&gt;

&lt;h3&gt;
  
  
  What happens if the summary cannot be written?
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;summary&lt;/code&gt; is &lt;code&gt;null&lt;/code&gt;, &lt;code&gt;meta.notices&lt;/code&gt; contains &lt;code&gt;"Summary unavailable."&lt;/code&gt;, and the results are still returned, so the agent can fall back to them.&lt;/p&gt;

</description>
      <category>agents</category>
      <category>ai</category>
      <category>api</category>
      <category>json</category>
    </item>
  </channel>
</rss>
