> ## Documentation Index
> Fetch the complete documentation index at: https://docs.apiyi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 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.

> [!NOTE]
>
> 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.

> [!TIP]
>
> Pricing, test data and the things you need to know are in the [Overview](/en/api-capabilities/deepseek-search-fetch/overview).

## Parameter reference

| Parameter | Type | Required | Description |
| - | - | - | - |
| `url` | string | ✓ | HTTP / HTTPS URL with a host, up to 8192 characters, no username or password |

The request body does not need a `model` field; unknown fields are ignored.

## Response highlights

```json theme={null}
{
  "title": "APIYI Docs",
  "content": "# APIYI Docs\n\nBody converted to Markdown..."
}
```

* `content` is the extracted body in Markdown; navigation, ads and other page chrome are mostly removed
* `title` is 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 |

> [!WARNING]
>
> **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.

The `type` in the error body is always `shell_api_error`; branch on the HTTP status code.


## OpenAPI

````yaml api-reference/deepseek-fetch-openapi-en.yaml POST /v1/tools/fetch
openapi: 3.1.0
info:
  title: DeepSeek Web Fetch API
  description: >
    `deepseek-fetch` — DeepSeek's native web fetch API. Turns any web page into
    Markdown body text.


    - Not a chat model and consumes no tokens: **billed per successful request**

    - Fetch failures (404) and parameter errors (400) are not billed

    - Upstream rate limit: 25 QPS, plus a separate limit per target domain

    - Available in the `default` / `svip` groups; ClaudeCode group keys cannot
    call it


    **Authentication**: header `Authorization: Bearer YOUR_API_KEY`


    **Get an API key**: create one in the APIYI console at `api.apiyi.com/token`
  version: 1.0.0
servers:
  - url: https://api.apiyi.com
    description: Primary endpoint
security:
  - bearerAuth: []
paths:
  /v1/tools/fetch:
    post:
      tags:
        - Search & Fetch
      summary: 'Web fetch: deepseek-fetch'
      description: >
        Send a URL, get the page title and Markdown body. The request body does
        not need a `model` field.
      operationId: deepseekToolsFetch
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FetchRequest'
            example:
              url: https://docs.apiyi.com/en
      responses:
        '200':
          description: Fetch succeeded (billed once)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FetchResponse'
              example:
                title: APIYI Docs
                content: |-
                  # APIYI Docs

                  Body converted to Markdown...
        '400':
          description: 'Invalid parameters, not billed: malformed or missing url'
        '401':
          description: Invalid API key
        '404':
          description: >-
            No usable content, not billed: target page 404, domain does not
            exist, private address, target site refused access, etc. Error
            message: failed to fetch URL
        '429':
          description: Upstream rate limit exceeded (25 QPS); wait and retry
        '503':
          description: >-
            This API is not enabled for the key's group (e.g. ClaudeCode); use a
            default / svip group key
      security:
        - bearerAuth: []
components:
  schemas:
    FetchRequest:
      type: object
      required:
        - url
      properties:
        url:
          type: string
          description: >-
            HTTP / HTTPS URL with a host, up to 8192 characters, no username or
            password
          example: https://docs.apiyi.com/en
    FetchResponse:
      type: object
      properties:
        title:
          type: string
          description: Page title; empty string if none
        content:
          type: string
          description: Extracted body text in Markdown
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Add Authorization: Bearer YOUR_API_KEY to the request headers'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.