Web fetch: deepseek-fetch
curl --request POST \
--url https://api.apiyi.com/v1/tools/fetch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://docs.apiyi.com/en"
}
'import requests
url = "https://api.apiyi.com/v1/tools/fetch"
payload = { "url": "https://docs.apiyi.com/en" }
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({url: 'https://docs.apiyi.com/en'})
};
fetch('https://api.apiyi.com/v1/tools/fetch', 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/fetch",
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([
'url' => 'https://docs.apiyi.com/en'
]),
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/fetch"
payload := strings.NewReader("{\n \"url\": \"https://docs.apiyi.com/en\"\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/fetch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://docs.apiyi.com/en\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.apiyi.com/v1/tools/fetch")
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 \"url\": \"https://docs.apiyi.com/en\"\n}"
response = http.request(request)
puts response.read_body{
"title": "APIYI Docs",
"content": "# APIYI Docs\n\nBody converted to Markdown..."
}DeepSeek Search & Fetch
DeepSeek Web Fetch API Reference
DeepSeek Fetch API reference and playground: /v1/tools/fetch attempts to extract usable content from public web pages as Markdown, with parameters, retrieval limitations and error handling.
POST
/
v1
/
tools
/
fetch
Web fetch: deepseek-fetch
curl --request POST \
--url https://api.apiyi.com/v1/tools/fetch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://docs.apiyi.com/en"
}
'import requests
url = "https://api.apiyi.com/v1/tools/fetch"
payload = { "url": "https://docs.apiyi.com/en" }
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({url: 'https://docs.apiyi.com/en'})
};
fetch('https://api.apiyi.com/v1/tools/fetch', 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/fetch",
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([
'url' => 'https://docs.apiyi.com/en'
]),
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/fetch"
payload := strings.NewReader("{\n \"url\": \"https://docs.apiyi.com/en\"\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/fetch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://docs.apiyi.com/en\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.apiyi.com/v1/tools/fetch")
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 \"url\": \"https://docs.apiyi.com/en\"\n}"
response = http.request(request)
puts response.read_body{
"title": "APIYI Docs",
"content": "# APIYI Docs\n\nBody converted to Markdown..."
}Try it in the Playground on the right: put
Bearer sk-your-api-key (a key in the default or svip group) in Authorization,
enter the public web page URL you want to read and send. You are billed only when page content is fetched successfully.Pricing, test data and the things you need to know are in the Overview.
Parameter reference
| Parameter | Type | Required | Description |
|---|---|---|---|
url | string | ✓ | HTTP / HTTPS URL with a host, up to 8192 characters, no username or password |
model field; unknown fields are ignored.
Response highlights
{
"title": "APIYI Docs",
"content": "# APIYI Docs\n\nBody converted to Markdown..."
}
contentis the extracted body in Markdown; navigation, ads and other page chrome are mostly removedtitleis an empty string when the page has no title- In testing, a docs page of about 6,400 characters took 1.6 s; some sites are slower, so set your client timeout to 30 s or more
Retrieval limitations and handling failures
Fetch depends on both the target page and the fetch service. A page opening in a browser or appearing in Search does not guarantee Fetch can retrieve it. Even when you setneed_content=true in a Search request and the response contains content, a subsequent Fetch request for the same URL can fail.
404 failed to fetch URL means no usable content was obtained. It does not necessarily mean the page is missing or the API endpoint does not exist; the message alone cannot distinguish access restrictions from page processing failures or other causes. Keep the existing search results, reuse available content and check its completeness. Clearly identify summaries as summaries. If you need more content, try another accessible source or abstract page, or download the document for your client to read, instead of repeatedly retrying the same link.
Some DeepSeek Harness versions wrap API errors as WEB_PROVIDER_ERROR and append generic endpoint configuration advice. Use the actual request path, HTTP status and original message to diagnose the issue. If the same /v1/tools/fetch endpoint has successful calls, do not change the Base URL solely because some target URLs fail.
Error codes
| HTTP | Example message | Cause and fix | Billed |
|---|---|---|---|
| 400 | 'url' must be a valid HTTP or HTTPS URL | Malformed URL | No |
| 400 | missing field 'url' | url missing | No |
| 401 | Invalid token. | Invalid API key or missing Authorization header | No |
| 404 | failed to fetch URL | No usable content; this message alone does not establish the cause. Try another URL or reading method instead of repeatedly retrying the same link | No |
| 429 | — | Upstream rate limit (25 QPS, plus a per-domain limit) 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-fetch | Check the key’s group and API availability. Replace a ClaudeCode group key with a default / svip key | No |
| 504 | Request timeout | Upstream fetch timeout; wait and retry a limited number of times. Preserve and report error details if failures persist | No |
Soft 404s are billed: some sites answer a missing page with their home page or a notice page instead of a 404,
and Fetch treats that as a successful fetch. Make sure the URL is valid before calling.
shell_api_error alone does not identify the cause. Use the HTTP status code and original message. Fetch failures are not limited to 404. 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 target URL, API path, HTTP status, error body and any request IDs. Do not include your API key or the Authorization header.Authorizations
Body
application/json
Was this page helpful?