Web search: deepseek-search
curl --request POST \
--url https://api.apiyi.com/v1/tools/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "DeepSeek V4 release"
}
'import requests
url = "https://api.apiyi.com/v1/tools/search"
payload = { "query": "DeepSeek V4 release" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({query: 'DeepSeek V4 release'})
};
fetch('https://api.apiyi.com/v1/tools/search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.apiyi.com/v1/tools/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'query' => 'DeepSeek V4 release'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.apiyi.com/v1/tools/search"
payload := strings.NewReader("{\n \"query\": \"DeepSeek V4 release\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.apiyi.com/v1/tools/search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"DeepSeek V4 release\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.apiyi.com/v1/tools/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"DeepSeek V4 release\"\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"title": "DeepSeek V4 released",
"url": "https://example.com/news/deepseek-v4",
"snippet": "A short snippet of about 100–200 characters...",
"summary": "A long summary of about 600–800 characters...",
"content": "",
"rerank_score": 2.1,
"authority": 3,
"date": "2026-10-20T08:00:00Z",
"site_name": "Example News",
"site_icon": "https://example.com/favicon.ico"
}
]
}DeepSeek Search & Fetch
DeepSeek Web Search API Reference
DeepSeek Search API reference and playground: /v1/tools/search parameters, search operators, response structure and error codes.
POST
/
v1
/
tools
/
search
Web search: deepseek-search
curl --request POST \
--url https://api.apiyi.com/v1/tools/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "DeepSeek V4 release"
}
'import requests
url = "https://api.apiyi.com/v1/tools/search"
payload = { "query": "DeepSeek V4 release" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({query: 'DeepSeek V4 release'})
};
fetch('https://api.apiyi.com/v1/tools/search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.apiyi.com/v1/tools/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'query' => 'DeepSeek V4 release'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.apiyi.com/v1/tools/search"
payload := strings.NewReader("{\n \"query\": \"DeepSeek V4 release\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.apiyi.com/v1/tools/search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"DeepSeek V4 release\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.apiyi.com/v1/tools/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"DeepSeek V4 release\"\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"title": "DeepSeek V4 released",
"url": "https://example.com/news/deepseek-v4",
"snippet": "A short snippet of about 100–200 characters...",
"summary": "A long summary of about 600–800 characters...",
"content": "",
"rerank_score": 2.1,
"authority": 3,
"date": "2026-10-20T08:00:00Z",
"site_name": "Example News",
"site_icon": "https://example.com/favicon.ico"
}
]
}Try it in the Playground on the right: put
Bearer sk-your-api-key (a key in the default or svip group) in Authorization.
The default example is filled in; click send to see results. Each successful call is billed once.
localization takes the user’s IP address (e.g. 8.8.8.8); a locale code such as en-US returns 400.Pricing, test data and the things you need to know are in the Overview.
Parameter reference
| Parameter | Type | Required | Description |
|---|---|---|---|
query | string | ✓ | 1–128 characters, not all whitespace. Supports site:, -site:, "...", lang:, after:, before: and other operators |
count | int | 1–50, default 10. Does not affect the price | |
need_content | bool | Default false; when true, requests available page content. Complete content is not guaranteed for every page | |
ori_question | string | The user’s original question, 1–128 characters | |
localization | string | The user’s IP address (not a locale code), used for localized ranking |
model field; unknown fields are ignored.
Check the length of query before sending it. The entire query, including operators such as site:, must fit within 128 characters. Shorten the keywords or split the query rather than retrying it unchanged. ori_question also cannot exceed 128 characters.
Response highlights
{
"results": [
{
"title": "...",
"url": "https://...",
"snippet": "short summary, about 100–200 characters",
"summary": "long summary, about 600–800 characters",
"content": "",
"rerank_score": 2.1,
"authority": 3,
"date": "2026-10-20T08:00:00Z",
"site_name": "...",
"site_icon": "https://..."
}
]
}
- Give
summaryto models and showsnippetto people. To request page content, enableneed_contentor pick a few results and use Fetch - A result URL or
contentfrom Search does not guarantee a subsequent Fetch request for that URL will succeed. Reuse availablecontentand check its completeness. If only a summary is available, identify it as a summary; try another accessible source or abstract page when you need more content rerank_score≥ 1.5 andauthority≥ 3 mark high-quality results and make good filter thresholds- With
count=50the response is about 180 KB, andneed_contentmore than doubles it; set your client timeout accordingly
Error codes
| HTTP | Example message | Cause and fix | Billed |
|---|---|---|---|
| 400 | 'count' must be between 1 and 50 | count out of range | No |
| 400 | 'query' must not be empty / missing field 'query' | query missing or empty | No |
| 400 | 'query' must be at most 128 characters | Query too long; shorten the keywords or split the query before retrying | No |
| 400 | 'localization' must be a valid IP address | A locale code was passed; send an IP or drop the field | No |
| 401 | Invalid token. | Invalid API key or missing Authorization header | No |
| 429 | — | Upstream rate limit (100 QPS) exceeded; wait and retry a limited number of times with increasing delays | No |
| 500 | Internal Server Error | Upstream internal error; wait and retry a limited number of times with increasing delays | No |
| 503 | no available channels for model deepseek-search | Check the key’s group and API availability. Replace a ClaudeCode group key with a default / svip key | No |
| 504 | Request timeout | Upstream timeout; wait and retry a limited number of times. Preserve and report error details if failures persist | No |
shell_api_error alone does not identify the cause. Use the HTTP status code and original message. If a 503 explicitly says no available channels, check the key’s group and whether the API is enabled first.
Some failed requests may not appear in console billing logs. For troubleshooting, retain the time and time zone, full query, API path, HTTP status, error body and any request IDs. Do not include your API key or the Authorization header. See the Overview for more details.Authorizations
Body
application/json
Was this page helpful?