DeepSeek search and fetch – $0.75 per 1000 successful requests

Hacker News by 7 min read 49x views
DeepSeek search and fetch – $0.75 per 1000 successful requests

Share Post

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:

APIEndpoint
SearchPOST https://api.deepseek.com/v1/tools/search
FetchPOST 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:

HeaderRequiredValue
AuthorizationYesBearer <DeepSeek API Key>
Content-TypeYesapplication/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:

FieldTypeRequiredDefaultDescription
querystringYes-The hunt query must merge 1 to 128 Unicode characters, cannot be all whitespace, and supports the query operators listed below.
countintegerNo10The figure of results to return, between 1 and 50.
ori_questionstringNo-The user's first inquiry that triggered the search, between 1 and 128 characters, to enhance query understanding, alongside null treated as not provided.
localizationstringNo""An optional IP location used to localize hunt results.
need_contentbooleanNofalseWhether 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.

OperatorExampleDescription
site:DeepSeek site:github.comRestrict 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.comExclude the stated site, and distinct multiple sites alongside spaces.
-DeepSeek -advertisementExclude 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,enRestrict 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-01Restrict results to pages published following a date.
before:DeepSeek before:2026 or DeepSeek before:2026-06-01Restrict 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:

FieldTypeDescription
rerank_scorenumberA 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.
titlestringThe heading of the result.
urlstringThe URL of the result.
snippetstringA abbreviated summary connected to the query, typically 100 to 200 characters, intended for display in a UI.
summarystringA lengthy summary connected to the query, typically 600 to 800 characters, intended to be peruse by a model.
contentstringThe leaf content, which is bare whenever need_content is false or whenever the satisfied is unavailable.
site_namestring or nullThe name of the site, or null whenever unavailable.
site_iconstring or nullThe URL of the location icon, or null whenever unavailable.
datestring or nullThe publish period in UTC, formatted as RFC 3339, or null whenever unknown.
authorityintegerThe 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:

FieldTypeRequiredDescription
urlstringYesThe 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."
}
FieldTypeDescription
titlestringThe heading of the page, bare whenever the heading is unavailable.
contentstringThe 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 StatusDescription
400The petition headers or build are invalid, including malformed JSON or an invalid site value.
401The API key is missing or invalid.
402The document has insufficient balance.
403The Fetch petition was rejected by the safety policy.
404Fetch 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.
408Reading the petition build timed out.
413The petition build is too large.
429The Search or Fetch QPS bounds was exceeded.
500An inner server error occurred.
504A 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:

APIUnitPrice
SearchPer 1,000 prosperous requests$0.75
FetchPer 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:

APIQPS Limit
Search5
Fetch5

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.

Other Article Hacker News
↑
Close Right Ads
Close Left Ads