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 turns any web page into Markdown, with parameters, response structure and error codes.
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 any URL 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
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: target page 404, domain does not exist, private address, site refused access, unsupported type, etc. Try another URL | No |
| 429 | — | Upstream rate limit (25 QPS, plus a per-domain limit) exceeded; wait and retry | No |
| 503 | no available channels for model deepseek-fetch | The key’s group does not have this API (e.g. ClaudeCode); use a default / svip key | No |
| 5xx / 504 | — | Upstream internal error or fetch timeout; retry later | 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.
type in the error body is always shell_api_error; branch on the HTTP status code.Authorizations
Add Authorization: Bearer YOUR_API_KEY to the request headers
Body
application/json
HTTP / HTTPS URL with a host, up to 8192 characters, no username or password
Example:
"https://docs.apiyi.com/en"
Was this page helpful?