Endpoints
    POST/desearch/ai/search

    AI Contextual Search

    The Desearch API allows you to perform AI-powered searches, gathering relevant information from web pages (`web`) and X posts (`twitter`). Web results arrive in `search` and X results in `tweets`. 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 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://www.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.ai

    Implementation guidance

    Use AI Contextual Search when your application needs search-grounded AI resultswithout 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.

    Body Parameters

    promptstringrequired

    Search query prompt

    toolsarrayrequired

    Tools 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_datestring

    The start date for the search query. Format: YYYY-MM-DDTHH:MM:SSZ (UTC)

    end_datestring

    The end date for the search query. Format: YYYY-MM-DDTHH:MM:SSZ (UTC)

    date_filterstring

    Deprecated relative window. When set (and no start_date/end_date), it is translated to start_date/end_date. Prefer start_date/end_date.

    streamingboolean

    Whether to stream results

    Default: false

    result_typestring

    The result type to be used for the search

    Default: LINKS_WITH_FINAL_SUMMARY

    modestring

    Speed/quality mode for the search (fast, balanced, deep). fast is web-only: X (Twitter) search supports balanced and deep.

    system_messagestring

    The system message to be used for the search

    Default:

    scoring_system_messagestring

    System message for scoring the response

    countstring

    The number of results to return per source. Min 10. Max 200.

    Default: 10

    include_domainsarray of strings

    Restrict Web Search results to these domains.

    One item per line, or a JSON array. Sent as an array.

    exclude_domainsarray of strings

    Drop Web Search results from these domains.

    One item per line, or a JSON array. Sent as an array.

    highlightsboolean

    Include highlights (token-efficient key excerpts from each page) on Web Search results.

    Default: true

    page_textboolean

    Include the full page text on each Web Search result. Responses get significantly larger.

    Default: false

    Responses

    200A JSON object mapping tool names to their search results.
    301Moved Permanently
    304Not Modified
    400Invalid JSON body
    401Unauthorized
    422Validation Error
    429Too Many Requests
    500Internal Server Error
    503Search unavailable

    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.

    {
      "search": [
        {
          "title": "What is Bittensor?",
          "link": "https://www.thebigwhale.io/tokens/bittensor",
          "snippet": "Bittensor (TAO) is a decentralized machine learning network.",
          "highlights": ["Bittensor transforms machine intelligence into a tradable commodity."]
        }
      ],
      "completion": "Bittensor is a decentralized, open-source machine learning network."
    }

    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.

    Authorization

    Your API key is sent in the Authorization header.

    Request
    curl -X POST "https://api.desearch.ai/desearch/ai/search" \
      -H "Authorization: YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
      "prompt": "Bittensor",
      "tools": [
        "web",
        "twitter"
      ],
      "streaming": false
    }'
    ResponseSchema
    {
      "completion": "\n\n**Overview of Bittensor**\n\nBittensor is a decentralized, open-source machine learning network that transforms AI models into tradable commodities. It enables a peer-to-peer marketplace where AI models are shared, trained, and ranked by their informational significance. The network incentivizes collaboration and innovation among developers through its native token, TAO, which is used for rewards, staking, governance, and payments within the ecosystem [1](https://www.thebigwhale.io/tokens/bittensor), [2](https://www.osl.com/hk-en/academy/article/bittensor-explained-how-tao-and_subnets_power_decentralized_ai).\n\n**Functionality and Use Cases**\n\nBittensor operates by allowing clients to request predictions or services that are routed to miners or nodes hosting machine-learning models. This decentralized structure facilitates various applications, including real-time AI coordination and on-chain AI agents that manage tasks like trading and inventory [3](https://www.reddit.com/r/Crypto_com/comments/1fu7ejj/learn_about_bittensor_tao_in_under_3_minutes), [4](https://x.com/bounty_incrypt/status/1932779454117400732). Recent developments include the introduction of Affine, a subnet designed to orchestrate and connect various Bittensor subnets, enhancing the network's scalability and efficiency [5](https://x.com/taocan_bot/status/1933068119188385839).\n\n**Recent Developments and Market Activity**\n\nIn the past 24 hours, Bittensor has seen significant discussions around its market performance, with analysts suggesting that the TAO token is currently oversold despite growth in network activity and institutional interest. Predictions for the TAO price over the next year vary with market conditions [6](https://x.com/HOSS_ibc/status/1932946234920349827). Additionally, new web environments are being launched to test web agents, further enhancing Bittensor's capabilities [7](https://x.com/AutoppiaAI/status/1932913082545942629).\n\n**Conclusion**\n\nBittensor is at the forefront of decentralized AI innovation, offering a unique marketplace for AI models that encourages collaboration and efficiency. With its TAO token driving the ecosystem, recent developments and market analyses indicate a growing interest and potential for significant price movements. The introduction of new subnets and applications showcases Bittensor's commitment to enhancing its network and expanding use cases in real-time AI operations.",
      "search": [
        {
          "link": "https://www.thebigwhale.io/tokens/bittensor",
          "snippet": "Bittensor (TAO) is a decentralized, open-source, and permissionless machine learning network that transforms machine intelligence into a tradable commodity. It creates a peer-to-peer marketplace where AI models are shared, trained, and ranked by value, incentivizing collaboration and innovation in AI development. The TAO token is used for rewards, staking, governance, and payments within the network, fostering a decentralized economy for AI development.",
          "title": "What is Bittensor?"
        },
        {
          "link": "https://tao.news/",
          "snippet": "Unleashing the Power of Decentralized Intelligence LEARN MORE What is Bittensor? Bittensor News The world is waking up to the power of Bittensor. Read syndicated publications from recognised news outlets & journalists. Operation: Community Pool ? Official Bittensor Update (2023-11-09T19:58:37.810000+00:00) Introducing SN13: […]",
          "title": "Home - $TAO News | Latest Bittensor Updates"
        },
        {
          "link": "https://www.coinbase.com/price/bittensor",
          "snippet": "Get the latest price, news, live charts, and market trends about Bittensor.",
          "title": "Bittensor Price, TAO Price, Live Charts, and Marketcap: tao, tao crypto, tao coin"
        },
        {
          "link": "https://tokenterminal.com/explorer/projects/bittensor",
          "snippet": "Dive into Bittensor's key fundamental metrics and uncover trends to make better investing and operational decisions.",
          "title": "Bittensor overview | Token Terminal"
        },
        {
          "link": "https://www.coingecko.com/en/coins/bittensor",
          "snippet": "Track the latest Bittensor price, market cap, trading volume, news and more with CoinGecko's live TAO price chart and popular cryptocurrency price tracker.",
          "title": "Bittensor Price: TAO Live Price Chart, Market Cap & News Today | CoinGecko"
        },
        {
          "link": "https://www.osl.com/hk-en/academy/article/bittensor-explained-how-tao-and-subnets-power-decentralized-ai",
          "snippet": "Bittensor is a decentralized AI network where TAO tokens reward miners and validators across subnets focused on specific AI tasks.",
          "title": "Bittensor Explained: How TAO and Subnets Power Decentralized AI"
        },
        {
          "link": "https://docs.bittensor.com/learn/introduction",
          "snippet": "This page will orient the reader with the major concepts and components of Bittensor, and provide the roadmap to developing in the ecosystem.",
          "title": "Introduction to Bittensor | Bittensor"
        }
      ],
      "text": "",
      "tweets": [
        {
          "bookmark_count": 2,
          "conversation_id": "1932946234920349827",
          "created_at": "2025-06-11T23:41:09.000Z",
          "display_text_range": [
            0,
            269
          ],
          "entities": {
            "hashtags": [],
            "media": [
              {
                "display_url": "pic.x.com/L1icjTabYS",
                "expanded_url": "https://x.com/HOSS_ibc/status/1932946234920349827/photo/1",
                "ext_media_availability": {
                  "status": "Available"
                },
                "features": {
                  "large": {
                    "faces": [
                      {
                        "h": 77,
                        "w": 77,
                        "x": 1877,
                        "y": 521
                      },
                      {
                        "h": 93,
                        "w": 93,
                        "x": 971,
                        "y": 571
                      }
                    ]
                  },
                  "medium": {
                    "faces": [
                      {
                        "h": 45,
                        "w": 45,
                        "x": 1100,
                        "y": 305
                      },
                      {
                        "h": 55,
                        "w": 55,
                        "x": 569,
                        "y": 335
                      }
                    ]
                  },
                  "orig": {
                    "faces": [
                      {
                        "h": 137,
                        "w": 137,
                        "x": 3301,
                        "y": 917
                      },
                      {
                        "h": 165,
                        "w": 165,
                        "x": 1708,
                        "y": 1005
                      }
                    ]
                  },
                  "small": {
                    "faces": [
                      {
                        "h": 25,
                        "w": 25,
                        "x": 623,
                        "y": 173
                      },
                      {
                        "h": 31,
                        "w": 31,
                        "x": 322,
                        "y": 189
                      }
                    ]
                  }
                },
                "id_str": "1932944082281574400",
                "indices": [
                  270,
                  293
                ],
                "media_key": "3_1932944082281574400",
                "media_url_https": "https://pbs.twimg.com/media/GtMyZtMWMAAPfq9.jpg",
                "original_info": {
                  "focus_rects": [
                    {
                      "h": 1800,
                      "w": 3214,
                      "x": 0,
                      "y": 0
                    },
                    {
                      "h": 1800,
                      "w": 1800,
                      "x": 0,
                      "y": 0
                    },
                    {
                      "h": 1800,
                      "w": 1579,
                      "x": 0,
                      "y": 0
                    },
                    {
                      "h": 1800,
                      "w": 900,
                      "x": 0,
                      "y": 0
                    },
                    {
                      "h": 1800,
                      "w": 3600,
                      "x": 0,
                      "y": 0
                    }
                  ],
                  "height": 1800,
                  "width": 3600
                },
                "sizes": {
                  "large": {
                    "h": 1024,
                    "resize": "fit",
                    "w": 2048
                  },
                  "medium": {
                    "h": 600,
                    "resize": "fit",
                    "w": 1200
                  },
                  "small": {
                    "h": 340,
                    "resize": "fit",
                    "w": 680
                  },
                  "thumb": {
                    "h": 150,
                    "resize": "crop",
                    "w": 150
                  }
                },
                "type": "photo",
                "url": "https://t.co/L1icjTabYS"
              }
            ],
            "symbols": [
              {
                "indices": [
                  10,
                  14
                ],
                "text": "TAO"
              }
            ],
            "timestamps": [],
            "urls": [],
            "user_mentions": []
          },
          "extended_entities": {
            "media": [
              {
                "display_url": "pic.x.com/L1icjTabYS",
                "expanded_url": "https://x.com/HOSS_ibc/status/1932946234920349827/photo/1",
                "ext_media_availability": {
                  "status": "Available"
                },
                "features": {
                  "large": {
                    "faces": [
                      {
                        "h": 77,
                        "w": 77,
                        "x": 1877,
                        "y": 521
                      },
                      {
                        "h": 93,
                        "w": 93,
                        "x": 971,
                        "y": 571
                      }
                    ]
                  },
                  "medium": {
                    "faces": [
                      {
                        "h": 45,
                        "w": 45,
                        "x": 1100,
                        "y": 305
                      },
                      {
                        "h": 55,
                        "w": 55,
                        "x": 569,
                        "y": 335
                      }
                    ]
                  },
                  "orig": {
                    "faces": [
                      {
                        "h": 137,
                        "w": 137,
                        "x": 3301,
                        "y": 917
                      },
                      {
                        "h": 165,
                        "w": 165,
                        "x": 1708,
                        "y": 1005
                      }
                    ]
                  },
                  "small": {
                    "faces": [
                      {
                        "h": 25,
                        "w": 25,
                        "x": 623,
                        "y": 173
                      },
                      {
                        "h": 31,
                        "w": 31,
                        "x": 322,
                        "y": 189
                      }
                    ]
                  }
                },
                "id_str": "1932944082281574400",
                "indices": [
                  270,
                  293
                ],
                "media_key": "3_1932944082281574400",
                "media_url_https": "https://pbs.twimg.com/media/GtMyZtMWMAAPfq9.jpg",
                "original_info": {
                  "focus_rects": [
                    {
                      "h": 1800,
                      "w": 3214,
                      "x": 0,
                      "y": 0
                    },
                    {
                      "h": 1800,
                      "w": 1800,
                      "x": 0,
                      "y": 0
                    },
                    {
                      "h": 1800,
                      "w": 1579,
                      "x": 0,
                      "y": 0
                    },
                    {
                      "h": 1800,
                      "w": 900,
                      "x": 0,
                      "y": 0
                    },
                    {
                      "h": 1800,
                      "w": 3600,
                      "x": 0,
                      "y": 0
                    }
                  ],
                  "height": 1800,
                  "width": 3600
                },
                "sizes": {
                  "large": {
                    "h": 1024,
                    "resize": "fit",
                    "w": 2048
                  },
                  "medium": {
                    "h": 600,
                    "resize": "fit",
                    "w": 1200
                  },
                  "small": {
                    "h": 340,
                    "resize": "fit",
                    "w": 680
                  },
                  "thumb": {
                    "h": 150,
                    "resize": "crop",
                    "w": 150
                  }
                },
                "type": "photo",
                "url": "https://t.co/L1icjTabYS"
              }
            ]
          },
          "id": "1932946234920349827",
          "is_quote_tweet": false,
          "is_retweet": false,
          "lang": "en",
          "like_count": 31,
          "media": [
            {
              "media_url": "https://pbs.twimg.com/media/GtMyZtMWMAAPfq9.jpg",
              "type": "photo"
            }
          ],
          "quote_count": 3,
          "reply_count": 16,
          "retweet_count": 3,
          "text": "Bittensor $TAO seems oversold here.\n\nGrowth up but price is down\n\nFactors  \n\nTechnical: Trading above 200-day MA.  \n\nFundamental: Halving, subnet growth, institutional interest (e.g., Grayscale’s Bittensor Trust).  \n\nSentiment: Strong staking (72%) and developer activity.",
          "url": "https://x.com/HOSS_ibc/status/1932946234920349827",
          "user": {
            "can_dm": true,
            "can_media_tag": false,
            "created_at": "Sun Jul 18 05:20:07 +0000 2021",
            "description": "Entrepreneur, Angel Investor & Product Advisor | 4+ years full-time in Crypto | 16+ years building businesses | Passionate about DeFi, Art  & impactful content",
            "entities": {
              "description": {
                "urls": []
              },
              "url": {
                "urls": [
                  {
                    "display_url": "metimmerse.io/hoss",
                    "expanded_url": "https://metimmerse.io/hoss",
                    "indices": [
                      0,
                      23
                    ],
                    "url": "https://t.co/kAQCAPyc7F"
                  }
                ]
              }
            },
            "favourites_count": 163851,
            "followers_count": 63156,
            "id": "1416628772565143561",
            "is_blue_verified": true,
            "listed_count": 460,
            "location": "Tweets aren't financial advice",
            "media_count": 8421,
            "name": "Hoss",
            "pinned_tweet_ids": [
              "1932920070222889063"
            ],
            "profile_banner_url": "https://pbs.twimg.com/profile_banners/1416628772565143561/1749700252",
            "profile_image_url": "https://pbs.twimg.com/profile_images/1915178001026723840/s0MX6RPL_normal.jpg",
            "statuses_count": 77157,
            "url": "https://x.com/HOSS_ibc",
            "username": "HOSS_ibc",
            "verified": false
          }
        }
      ]
    }

    Possible status codes:

    200401422429500