DeepSeek Search & Fetch API
- ID: 48479cd7
- 原文链接: https://api-docs.deepseek.com/guides/search/
- 作者: DeepSeek
- 日期: 2026-10-17
- 分类: infra
- 来源类型: article
- 标签: deepseek, search-api, agent-tools, rag, pricing
- 质量评分: 4/5
- 抓取时间: 2026-10-18T15:42:42Z
中文导读
DeepSeek 开放自研搜索引擎支撑的两条 agent 工具链路:Search API(POST /v1/tools/search,query 1-128 字符,count 1-50,need_content 控制是否带正文,支持 site:/lang:/after:/before: 等运算符与 IP 本地化)与 Fetch API(抓单页、直接返回 Markdown 正文)。均为裸 JSON 接口、沿用 DeepSeek API key 鉴权;结果带 rerank_score(0-3,≥1.5 视为高质量)与 authority(0-4 分级)字段。计价按成功请求 $0.75/千次,空结果与失败不计费;经 DeepSeek Harness、Claude Code、Codex 的 server-side 工具调用当前免费,2026-11-01 00:00(北京时间)起开始计费。账户级 QPS 各 5,Fetch 另有域名级限速。
为什么值得关注
agent 外搜成本被压到 $0.75/千次:Fetch 直出 Markdown 可替掉自建正文抽取层,但 Harness/Claude Code/Codex 的免费窗 11 月 1 日硬截止,接前先测配额与失败路径
关键信息
- 端点: POST /v1/tools/search 与 POST /v1/tools/fetch(base https://api.deepseek.com),Bearer 鉴权沿用 DeepSeek API key
- Search: query 1-128 字符、count 1-50(默认 10)、need_content、IP 本地化;支持 site:/-site:/-/-"…"/"…"/lang:/after:/before: 运算符
- 结果字段: rerank_score 0-3(≥1.5 高质量)、summary 600-800 字符(给模型读)、authority 0-4(≥3 高权威)
- Fetch: 单 URL 进、返回 Markdown 正文,可替掉管道里 HTML 抽正文一层
- 计价: 每端点 $0.75/千次成功调用;空结果/失败/超时不计费;DeepSeek Harness、Claude Code、Codex 的 server-side 调用免费至 2026-11-01 00:00(北京时间)
- 限速: 账户级 QPS Search 5 / Fetch 5,互相独立;Fetch 另有域名级限速
English Source
Search API
POST https://api.deepseek.com/v1/tools/search - Bearer auth with the DeepSeek API key, JSON body, base URL https://api.deepseek.com.
Request fields: query (string, required, 1-128 Unicode characters, supports operators); count (integer, default 10, range 1-50); ori_question (optional, the user's original question that triggered the search, 1-128 chars); localization (optional IP address used to localize results); need_content (boolean, default false - whether to return page content in content).
Query operators: site: / -site: (restrict or exclude sites, multiple sites OR-joined), - (exclude terms), -"..." (exclude exact phrases), "..." (exact phrase), lang: (comma-separated language codes), after: / before: (date bounds, YYYY or YYYY-MM-DD).
Response items include: rerank_score (0-3 relevance combining relevance/authority/freshness; >=1.5 considered high-quality), title, url, snippet (~100-200 chars, for UI display), summary (~600-800 chars, intended to be read by a model), content (empty unless need_content), site_name, site_icon, date (RFC 3339 UTC or null), authority (0-4 tier, >=3 highly authoritative, -1 unknown).
Fetch API
POST https://api.deepseek.com/v1/tools/fetch - takes a single url field (HTTP/HTTPS, max 8192 chars, no username/password); returns { title, content } where content is the page as Markdown text. Subject to the target site's availability and access policies (HTTP 404 when no usable page content can be extracted; 403 for security-policy rejections).
Billing
Billed per successful request, not by tokens or result count: Search $0.75 per 1,000 successful requests; Fetch $0.75 per 1,000 successful requests. A request is billable only when it returns HTTP 200 and produces a result (Search: non-empty results array; Fetch: page content). Failed requests, empty search results, and timeouts are not billed; count does not affect the per-request price.
Per the docs: when you use the DeepSeek API through DeepSeek Harness, Claude Code, or Codex, server-side tool calls already hit the Search and Fetch APIs and are currently free of charge; per-request billing starts at 00:00 Beijing time on November 1, 2026.
Rate Limits
For each account, Search and Fetch are limited independently at 5 QPS each, separate from model concurrency limits; requests above the account-level limit receive HTTP 429. Fetch is additionally subject to a per-domain QPS limit. Errors follow the OpenAI-compatible error format (400 invalid request, 401 auth, 402 insufficient balance, 403 security policy, 404 unusable content, 408/504 timeouts, 429 QPS, 5xx internal).
Obsidian Notes
- Full docs page fetched via
opencli web readon the live page, 2026-10-18 evening run; billing and free-window text quoted verbatim from the page. - Chinese summary, English summary, and one-liner anchored to the fetched source text; appended via pipeline_utils (AAIF daily-intake evening).