---
title: DeepSeek Search | RunAPI
description: 通过 RunAPI 的 DeepSeek 兼容 Search operation 发送请求。
url: https://runapi.ai/zh-CN/docs/api/deepseek/search.md
canonical: https://runapi.ai/zh-CN/docs/api/deepseek/search
locale: zh-CN
---

> HTML 版本: https://runapi.ai/zh-CN/docs/api/deepseek/search
> 智能体网站索引: https://runapi.ai/llms.txt

# DeepSeek Search

## 概览

Synchronous search selected by this path. No model is required and streaming is not supported. Unknown fields are accepted but ignored.

### 快速开始

1. 创建 API Key，并将其设置为 RUNAPI_API_KEY。
2. 发送文档所列的 JSON 请求体，无需提供模型。
3. 读取 JSON 响应并处理文档所列的协议错误。

## 端点

POST /v1/tools/search

基础 URL: https://runapi.ai

Contract 版本: v1

首选身份验证: Authorization: Bearer YOUR_API_TOKEN

## 身份验证载体

RunAPI 接受下列每种载体；生成的示例使用该协议的首选请求头。

- `Authorization: Bearer YOUR_API_TOKEN` (首选)
- `x-api-key: YOUR_API_TOKEN`
- `x-goog-api-key: YOUR_API_TOKEN`
- `?key=YOUR_API_TOKEN`

## 兼容模型

打开模型页可查看当前价格、限流和商业使用详情。

- [deepseek-search](https://runapi.ai/zh-CN/models/deepseek-search)

## 请求 Contract

Synchronous search selected by this path. No model is required and streaming is not supported. Unknown fields are accepted but ignored.

### JSON 请求体

必填: `query`

```json
{
  "count": {
    "description": "Number of results requested from 1 to 50.",
    "maximum": 50,
    "minimum": 1,
    "type": "integer"
  },
  "localization": {
    "description": "Localization hint such as the end user's IP address.",
    "type": "string"
  },
  "need_content": {
    "description": "Request page content in search results.",
    "type": "boolean"
  },
  "ori_question": {
    "description": "Original question of 1–128 Unicode characters. Null is treated as omitted.",
    "maxLength": 128,
    "minLength": 1,
    "type": [
      "string",
      "null"
    ]
  },
  "query": {
    "description": "Search query of 1–128 Unicode characters; must not consist entirely of whitespace.",
    "maxLength": 128,
    "minLength": 1,
    "type": "string"
  }
}
```

### 请求示例

```json
{
  "count": 5,
  "localization": "203.0.113.7",
  "need_content": true,
  "ori_question": null,
  "query": "DeepSeek V4 release"
}
```

## 同步响应

HTTP 200

### Schema

```json
{
  "additionalProperties": true,
  "properties": {
    "results": {
      "description": "Search results. An empty array is a successful response and incurs no charge.",
      "items": {
        "additionalProperties": true,
        "type": "object"
      },
      "type": "array"
    }
  },
  "required": [
    "results"
  ],
  "type": "object"
}
```

### 示例

```json
{
  "results": [
    {
      "snippet": "Browse DeepSeek models and API documentation.",
      "title": "DeepSeek models on RunAPI",
      "url": "https://runapi.ai/models/deepseek"
    }
  ]
}
```

## 协议错误：invalid_request

HTTP 400

### Schema

```json
{
  "additionalProperties": true,
  "properties": {
    "error": {
      "additionalProperties": true,
      "properties": {
        "code": {
          "type": [
            "string",
            "null"
          ]
        },
        "message": {
          "type": "string"
        },
        "param": {
          "type": [
            "string",
            "null"
          ]
        },
        "type": {
          "type": "string"
        }
      },
      "required": [
        "message",
        "type"
      ],
      "type": "object"
    }
  },
  "required": [
    "error"
  ],
  "type": "object"
}
```

### 示例

```json
{
  "error": {
    "message": "'query' is required",
    "type": "invalid_request_error"
  }
}
```

## 协议错误：rate_limited

HTTP 429

### Schema

```json
{
  "additionalProperties": true,
  "properties": {
    "error": {
      "additionalProperties": true,
      "properties": {
        "code": {
          "type": [
            "string",
            "null"
          ]
        },
        "message": {
          "type": "string"
        },
        "param": {
          "type": [
            "string",
            "null"
          ]
        },
        "type": {
          "type": "string"
        }
      },
      "required": [
        "message",
        "type"
      ],
      "type": "object"
    }
  },
  "required": [
    "error"
  ],
  "type": "object"
}
```

### 示例

```json
{
  "error": {
    "message": "Too many requests, please retry later",
    "type": "rate_limit_error"
  }
}
```

## 协议错误：unavailable

HTTP 503

### Schema

```json
{
  "additionalProperties": true,
  "properties": {
    "error": {
      "additionalProperties": true,
      "properties": {
        "code": {
          "type": [
            "string",
            "null"
          ]
        },
        "message": {
          "type": "string"
        },
        "param": {
          "type": [
            "string",
            "null"
          ]
        },
        "type": {
          "type": "string"
        }
      },
      "required": [
        "message",
        "type"
      ],
      "type": "object"
    }
  },
  "required": [
    "error"
  ],
  "type": "object"
}
```

### 示例

```json
{
  "error": {
    "message": "Service temporarily unavailable",
    "type": "service_unavailable"
  }
}
```

## 生成的代码示例

每个 cURL、JavaScript 和 Python 示例都会发送此 Contract 中经过验证的请求，无需协议专用 SDK。

### curl

```curl
curl -X POST https://runapi.ai/v1/tools/search \
  -H Authorization:\ Bearer\ YOUR_API_TOKEN \
  -H Content-Type:\ application/json \
  -d \{\"query\":\"DeepSeek\ V4\ release\",\"count\":5,\"ori_question\":null,\"localization\":\"203.0.113.7\",\"need_content\":true\}
```

### javascript

```javascript
const response = await fetch("https://runapi.ai/v1/tools/search", {
  method: "POST",
  headers: {
  "Authorization": "Bearer YOUR_API_TOKEN",
  "Content-Type": "application/json"
},
  body: JSON.stringify({
  "query": "DeepSeek V4 release",
  "count": 5,
  "ori_question": null,
  "localization": "203.0.113.7",
  "need_content": true
})
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const data = await response.json();
console.log(data);
```

### python

#### 安装

```bash
pip install requests
```

```python
import requests

response = requests.post(
    "https://runapi.ai/v1/tools/search",
    headers={"Authorization": "Bearer YOUR_API_TOKEN", "Content-Type": "application/json"},
    json={"query": "DeepSeek V4 release", "count": 5, "ori_question": None, "localization": "203.0.113.7", "need_content": True}
)
response.raise_for_status()
print(response.json())
```

## 相关指南

- [API 身份验证](https://runapi.ai/zh-CN/docs/guides/authentication.md)

---

## RunAPI 的更多内容

- [首页](https://runapi.ai/zh-CN/.md)
- [模型目录](https://runapi.ai/zh-CN/models.md)
- [定价](https://runapi.ai/zh-CN/pricing.md)
- [提供方](https://runapi.ai/zh-CN/models)
- [文档](https://runapi.ai/zh-CN/docs/guides)
- [SDK](https://runapi.ai/zh-CN/sdk.md)
- [CLI](https://runapi.ai/zh-CN/cli.md)
- [MCP Server](https://runapi.ai/zh-CN/mcp.md)
- [x402](https://runapi.ai/zh-CN/x402.md)
- [Claude Code 与 Cursor](https://runapi.ai/zh-CN/claude-code-vs-cursor.md)
- [Cursor API 设置](https://runapi.ai/zh-CN/cursor-api-setup.md)
- [RunAPI 与 OpenRouter](https://runapi.ai/zh-CN/openrouter-alternative.md)
- [企业版](https://runapi.ai/zh-CN/contact.md)
- [联系](https://runapi.ai/zh-CN/contact.md)
- [服务条款](https://runapi.ai/zh-CN/terms.md)
- [隐私政策](https://runapi.ai/zh-CN/privacy.md)
- [智能体网站索引](https://runapi.ai/llms.txt)

联系我们: contact@runapi.ai

## 结构化数据

```json
[
  {
    "@context": "https://schema.org",
    "inLanguage": "zh-CN",
    "@type": "WebSite",
    "name": "RunAPI",
    "url": "https://runapi.ai/zh-CN",
    "potentialAction": {
      "@type": "SearchAction",
      "target": {
        "@type": "EntryPoint",
        "urlTemplate": "https://runapi.ai/zh-CN/models?q={search_term_string}"
      },
      "query-input": "required name=search_term_string"
    }
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "zh-CN",
    "@type": "Organization",
    "name": "RunAPI",
    "url": "https://runapi.ai/zh-CN",
    "logo": {
      "@type": "ImageObject",
      "url": "https://runapi.ai/zh-CNicon.svg"
    },
    "sameAs": [
      "https://github.com/runapi-ai"
    ]
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "zh-CN",
    "@type": "TechArticle",
    "headline": "DeepSeek Search",
    "description": "通过 RunAPI 的 DeepSeek 兼容 Search operation 发送请求。",
    "url": "https://runapi.ai/zh-CN/docs/api/deepseek/search",
    "mainEntityOfPage": "https://runapi.ai/zh-CN/docs/api/deepseek/search"
  }
]
```
