The Search API and the Fetch API provision agents and RAG applications admission to live web content:
- Search API finds web pages for a query and returns organized results. It is powered by DeepSeek's in-house hunt engine.
- Fetch API retrieves a sole web leaf and returns its satisfied as Markdown.
Both are raw JSON APIs. They use the identical transporter authentication as the DeepSeek API.
The basis URL is https://api.deepseek.com:
| API | Endpoint |
|---|---|
| Search | POST https://api.deepseek.com/v1/tools/search |
| Fetch | POST https://api.deepseek.com/v1/tools/fetch |
See the Search API Reference and Fetch API Reference for the complete petition and reply schemas.
Authentication
Send your API key and the JSON satisfied category in the petition headers:
| Header | Required | Value |
|---|---|---|
| Authorization | Yes | Bearer <DeepSeek API Key> |
| Content-Type | Yes | application/json |
Search API
Request
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
}'
import requests
response = requests.post(
"https://api.deepseek.com/v1/tools/search",
headers={
"Authorization": "Bearer <DeepSeek API Key>",
},
json={
"query": "DeepSeek V4 release",
"count": 5,
"need_content": True,
},
)
response.raise_for_status()
for outcome in response.json()["results"]:
print(result["title"], result["url"])
print(result["summary"])
Request fields:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| query | string | Yes | - | The hunt query must merge 1 to 128 Unicode characters, cannot be all whitespace, and supports the query operators listed below. |
| count | integer | No | 10 | The figure of results to return, between 1 and 50. |
| ori_question | string | No | - | The user's first inquiry that triggered the search, between 1 and 128 characters, to enhance query understanding, alongside null treated as not provided. |
| localization | string | No | "" | An optional IP location used to localize hunt results. |
| need_content | boolean | No | false | Whether to come back leaf satisfied in content, which is continually an bare cord whenever false. |
Unknown sectors in the petition build are ignored.
Query Operators
The query is forwarded alongside its hunt syntax intact. The examples below merge operators alongside a hunt term; you can merge multiple operators in one query.
| Operator | Example | Description |
|---|---|---|
| site: | DeepSeek site:github.com | Restrict results to the stated site, and to mark multiple sites, distinct the site: clauses alongside spaces and associate them alongside OR, for example DeepSeek site:github.com OR site:huggingface.co. |
| -site: | DeepSeek -site:example.com | Exclude the stated site, and distinct multiple sites alongside spaces. |
| - | DeepSeek -advertisement | Exclude pages containing the term, and distinct multiple conditions alongside spaces. |
| -"..." | DeepSeek -"release notes" | Exclude pages containing the exact phrase, which can merge spaces, and distinct multiple phrases alongside spaces. |
| "..." | DeepSeek "exact phrase" | Match an exact phrase, and distinct multiple phrases alongside spaces. |
| lang: | DeepSeek lang:zh,en | Restrict results to the stated tongue codes, separating multiple codes alongside commas, for example lang:zh,en. |
| after: | DeepSeek after:2025 or DeepSeek after:2025-01-01 | Restrict results to pages published following a date. |
| before: | DeepSeek before:2026 or DeepSeek before:2026-06-01 | Restrict results to pages published before a date. |
For example:
{
"query": "DeepSeek site:github.com OR site:huggingface.co lang:en after:2025",
"count": 10
}
Response
A prosperous petition returns HTTP 200 alongside a results array. A normal hunt alongside no matches returns an bare array.
{
"results": [
{
"rerank_score": 2.4,
"title": "DeepSeek V4 example released",
"url": "https://example.com/deepseek-v4",
"snippet": "DeepSeek V4 is now available, alongside tool calling and long-context support.",
"summary": "DeepSeek has released the V4 model. The publish adds improved tool calling and long-context assistance for delegate workflows.",
"content": "DeepSeek V4 is now mostly available...",
"site_name": "Example News",
"site_icon": "https://example.com/favicon.ico",
"date": "2026-06-01T00:00:00+00:00",
"authority": 3
}
]
}
Each item in results contains:
| Field | Type | Description |
|---|---|---|
| rerank_score | number | A relevance mark from 0 to 3 that combines signals specified as relevance, authority, and freshness, alongside scores of 1.5 or complete considered high-quality results. |
| title | string | The heading of the result. |
| url | string | The URL of the result. |
| snippet | string | A abbreviated summary connected to the query, typically 100 to 200 characters, intended for display in a UI. |
| summary | string | A lengthy summary connected to the query, typically 600 to 800 characters, intended to be peruse by a model. |
| content | string | The leaf content, which is bare whenever need_content is false or whenever the satisfied is unavailable. |
| site_name | string or null | The name of the site, or null whenever unavailable. |
| site_icon | string or null | The URL of the location icon, or null whenever unavailable. |
| date | string or null | The publish period in UTC, formatted as RFC 3339, or null whenever unknown. |
| authority | integer | The authority tier of the page, 0 to 4 (-1 method unknown), alongside values of 3 or complete indicating extremely authoritative sources. |
Fetch API
Request
curl https://api.deepseek.com/v1/tools/fetch \
-H "Authorization: Bearer <DeepSeek API Key>" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/article"
}'
import requests
response = requests.post(
"https://api.deepseek.com/v1/tools/fetch",
headers={
"Authorization": "Bearer <DeepSeek API Key>",
},
json={"url": "https://example.com/article"},
)
response.raise_for_status()
page = response.json()
print(page["title"])
print(page["content"])
Request fields:
| Field | Type | Required | Description |
|---|---|---|---|
| url | string | Yes | The leaf URL to fetch, which must be at most 8192 characters, an HTTP or HTTPS URL alongside a host, and must not merge a username or password. |
Response
{
"title": "Example article",
"content": "# Example article\n\nArticle content."
}
| Field | Type | Description |
|---|---|---|
| title | string | The heading of the page, bare whenever the heading is unavailable. |
| content | string | The fetched leaf satisfied as Markdown text. |
Fetching is topic to the mark site's preparedness and admission policies.
Errors
Errors prosecute the OpenAI-compatible error format. The param site is continually null.
{
"error": {
"message": "'count' must be between 1 and 50",
"type": "invalid_request_error",
"param": null,
"code": "invalid_request_error"
}
}
| HTTP Status | Description |
|---|---|
| 400 | The petition headers or build are invalid, including malformed JSON or an invalid site value. |
| 401 | The API key is missing or invalid. |
| 402 | The document has insufficient balance. |
| 403 | The Fetch petition was rejected by the safety policy. |
| 404 | Fetch could not recover usable leaf content, for example because of an unavailable URL, a URL blocked by location policy, an error from the mark site, an unsupported satisfied type, or a leaf alongside no extractable Markdown content. |
| 408 | Reading the petition build timed out. |
| 413 | The petition build is too large. |
| 429 | The Search or Fetch QPS bounds was exceeded. |
| 500 | An inner server error occurred. |
| 504 | A downstream petition timed out. |
Search and Fetch are read-only. For HTTP 408, 429, or 5xx errors, delay and retry. For HTTP 402, top up your document before retrying. Do not retry another 4xx errors without changing the request.
Billing
Search and Fetch are billed per prosperous request, not by tokens or by the figure of returned results:
| API | Unit | Price |
|---|---|---|
| Search | Per 1,000 prosperous requests | $0.75 |
| Fetch | Per 1,000 prosperous requests | $0.75 |
A petition is billable lone whenever it returns HTTP 200 and produces a outcome (Search must come back a non-empty results array, and Fetch must come back leaf content). Failed requests, bare hunt results, and timeouts are not billed. figure lone controls how many results are returned and does not power the per-request price.
Note: whenever you use the DeepSeek API through DeepSeek Harness, Claude Code, or Codex, server-side tool calls already hit the Search and Fetch APIs. These calls are currently liberated of charge; per-request billing starts at 00:00 Beijing period on November 1, 2026.
Rate Limits
For all account, Search and Fetch are constricted independently, and traffic to one does not consume the other's quota:
| API | QPS Limit |
|---|---|
| Search | 5 |
| Fetch | 5 |
The QPS (requests per second) limits are calculated at the document level, despite of which API key is used, and are distinct from the example concurrency limits. Requests complete the account-level QPS bounds obtain HTTP 429. In supplement to the account-level limit, Fetch is additionally topic to a per-domain QPS limit, and requests complete that bounds additionally obtain HTTP 429.