ToolNavs Find Useful AI Tools
Submit Sign in
Back to AI Q&A
How to Use DeepSeek's Search and Fetch APIs: Search First, Then Fetch — Billed per Successful Request

How to Use DeepSeek's Search and Fetch APIs: Search First, Then Fetch — Billed per Successful Request

AI Q&A • Admin • • 9 views

DeepSeek's Search API and Fetch API are a pair of tools: the Search API finds web pages for a keyword and returns titles, links, summaries, dates, and quality scores; the Fetch API retrieves a single web page and turns it into Markdown for the model or the retrieval flow. Both interfaces use the same key as the DeepSeek chat API and work with raw JSON requests, without going through the chat model. Billing is per successful request: $0.75 per 1,000 successful requests, with Search and Fetch counted separately.

The standard flow: search first, then fetch

First, call the Search endpoint: the query field holds 1 to 128 characters and supports operators such as site:, minus-site:, quoted phrases, language, and date; write short keywords in the query and put the user's full question in the ori_question field, also capped at 128 characters. Second, pick high-quality hits from the returned results array: rerank_score tops out at 3, with 1.5 or above counting as high quality, and authority tops out at 4, with 3 or above counting as highly authoritative. Third, call the Fetch endpoint for the chosen pages, pass a single URL, and get the title and Markdown body; you can also turn on need_content in Search to get the content directly, saving one call. Fetching is subject to the target site's access policies — if a page cannot be fetched, switch source first rather than retrying the same address repeatedly.

Rate limits and error handling

Each account is capped at 5 QPS for Search and 5 QPS for Fetch, and exceeding the cap returns 429. On 408, 429, or 5xx errors, wait a while and retry; on 402, top up first; other 4xx errors require changing the request first, not retrying unchanged. Requests with no results or failed requests are not billed; only requests that successfully return results are charged. From 00:00 Beijing time on 1 November 2026, server-side tool calls made through DeepSeek Harness, Claude Code, or Codex are also billed per call — the previously free period has ended, and flows with high call volumes should check usage in the console first.

When this API pair is not the right fit

When only a model answer is needed without live web facts, calling the chat model directly is cheaper. When only one fixed page's content is needed and the page structure is stable, downloading it and converting it to Markdown yourself works too, without paying per fetch. This API pair genuinely saves effort where agents and retrieval applications need the full “find first, then read, then cite” chain.

Recommended Tools

More