DeepSeek Search and Fetch API Guide: Web Search for Agents at $0.75 per 1,000 Requests
By Arash Latifi
DeepSeek shipped two raw JSON APIs — Search and Fetch. Endpoints, query operators, error codes, rate limits, and a setup checklist.
TL;DR — DeepSeek opened up two APIs:
POST /v1/tools/search(web search on their in-house engine) andPOST /v1/tools/fetch(one URL, Markdown out). Both $0.75 per 1,000 successful requests, QPS 5, same bearer auth as the regular API. A cheap building block for agents and RAG.
Why this matters
Until now, giving an agent web access meant expensive search APIs or hand-rolled scraping. Alongside the DeepSeek-V4.1-Flash-1017 release (October 17, 2026), DeepSeek announced Search & Fetch are "now open to everyone" — previously they were only reachable via server-side tools inside DeepSeek Harness, Claude Code, and Codex.
Key point: these are raw JSON APIs, not a model wrapper. You call them from curl or any language directly, no LLM in the middle. If you've integrated any HTTP API before, this takes minutes.
Search API: querying with operators
Endpoint: POST https://api.deepseek.com/v1/tools/search
curl https://api.deepseek.com/v1/tools/search \
-H "Authorization: Bearer $DEEPSEEK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "DeepSeek V4 release",
"count": 5,
"need_content": true
}'
Main request fields:
query— required, max 128 Unicode characters.count— 1 to 50 results (default 10). Does not affect price; billing is per request.need_content—truereturns full page content; defaultfalseleavescontentempty.localization— optional IP address to localize results.
Operators that work directly in query:
| Operator | Example | Effect |
| --- | --- | --- |
| site: / -site: | site:github.com OR site:huggingface.co | Restrict/exclude domains |
| - and -"..." | -advertisement -"release notes" | Exclude term or exact phrase |
| "..." | "exact phrase" | Match exact phrase |
| lang: | lang:en,zh | Restrict to languages |
| after: / before: | after:2026-01-01 | Restrict by publish date |
Quality signal: each result carries a rerank_score (0–3, ≥1.5 counts as high quality) and an authority tier (0–4, ≥3 means highly authoritative). If you're filtering for RAG, these two numbers are your best lever.
Fetch API: one URL, Markdown out
Endpoint: POST https://api.deepseek.com/v1/tools/fetch — the request body is just a url field (max 8,192 chars, HTTP/HTTPS, no username/password):
The response is minimal:
No more HTML-to-Markdown cleanup in your pipeline — the server does it. One less stage for agent workflows.
Errors and limits worth knowing
HTTP error codes from the official docs:
| Code | Meaning | | --- | --- | | 402 | Insufficient account balance | | 403 | Fetch request rejected by security policy | | 404 | No usable page content (unavailable URL, blocked by site policy, unsupported content type, or nothing extractable as Markdown) | | 429 | QPS limit exceeded | | 504 | Upstream error |
Limits: Search and Fetch each get an independent account-level QPS of 5 (traffic to one doesn't consume the other's quota). Fetch additionally has a per-domain QPS limit — if you fetch 50 pages from one site, expect 429s; space out requests or spread across domains.
Pricing and a free window
Both endpoints cost $0.75 per 1,000 successful requests — and "successful" means HTTP 200 with a real result: Search must return a non-empty results array, Fetch must return page content. Failed requests, empty results, and timeouts are not billed. Per-request billing is far cleaner than paying per token for documents.
Free window: when you use the DeepSeek API inside DeepSeek Harness, Claude Code, or Codex, server-side tool calls already hit these APIs and are currently free. Per-request billing starts November 1, 2026 at 00:00 Beijing time (Oct 31, 16:00 UTC).
Setup checklist
- [ ] Get a DeepSeek API key into an environment variable (no hardcoding)
- [ ] Write a wrapper that handles 429 with backoff (QPS 5 is easy to hit)
- [ ] Only set
need_content: truewhen you actually need full page text - [ ] Filter Search results by
rerank_score>= 1.5 andauthority>= 3 - [ ] Throttle bulk Fetches from a single domain (per-domain limit)
- [ ] Log successful request counts — billing is per request and should be auditable
- [ ] If you're before Oct 31, use the free server-side tool window for testing
Q: How is this different from web search inside DeepSeek's chat?
These are raw model-independent APIs for your own apps — agents, RAG, pipelines. Search inside DeepSeek's chat/app serves that platform's users. Here you get JSON directly and decide what to do with it.
Q: The content field in Search results is empty — why?
Either need_content was false (the default) or the content was unavailable. For full text, send need_content: true, or take the result URL and fetch it via the Fetch API.
Q: Does a 404 from Fetch mean the link is broken?
Not necessarily. Per the docs, 404 means no usable content — the page may be up but blocked, have an unsupported content type, or contain nothing extractable as Markdown (e.g., a JS-heavy single-page app).
Sources
- https://api-docs.deepseek.com/guides/search/
- https://api-docs.deepseek.com/news/news261017/
- https://news.ycombinator.com/item?id=50138531
- https://huggingface.co/deepseek-ai/DeepSeek-V4.1-Flash-1017