# DeepSeek Search API

> Point DeepSeek Harness's built-in web search at Search1API by changing the Search / Fetch API base URL and key. Nothing to install.

Canonical URL: https://s1.dev/docs/compatibility/deepseek

Search1API answers DeepSeek's Search and Fetch API — `POST /search` and `POST /fetch`. Set the base URL to:

```text
https://api.search1api.com/compat/deepseek
```

DeepSeek Harness appends `/search` and `/fetch` to that base, and authenticates with your Search1API key as `Authorization: Bearer YOUR_API_KEY`.

## Configure DeepSeek Harness

The [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) web capability seam ships a DeepSeek Search API provider, so this is a settings change, not an installation:

1. Open **Plugins → Built-in plugin settings → Web search**.
2. Turn on **Use the new Web Search API**.
3. Set **Search / Fetch API base URL** to `https://api.search1api.com/compat/deepseek`.
4. Paste your Search1API key into **API key** and save.

From the next search on, the agent's `web_search` and `web_fetch` tools run on Search1API. The change applies to the next operation without a restart.

> **info:** The harness stores the key you enter as the `DEEPSEEK_API_KEY` credential. A conversation on a DeepSeek Account model still searches: the harness sends its account token only to DeepSeek's own origin and falls back to this key for any other base URL. Switching back to DeepSeek's own search means restoring that base URL and re-entering a DeepSeek key.

## Search

`POST /compat/deepseek/search`

| Field | Behavior |
| --- | --- |
| `query` | Required. |
| `count` | Results to return, `1` to `50`; default `10`. DeepSeek Harness sends its own result limit here, usually `8`. |
| `need_content` | Accepted and ignored; results never include page text. Use `/fetch` to read a page. |
| `ori_question` | Accepted and ignored. |

The response lists sources in rank order:

```json
{
  "results": [
    {
      "url": "https://hono.dev/docs/",
      "title": "Hono",
      "snippet": "Fast, lightweight web framework…",
      "date": "2026-11-04T00:00:00.000Z"
    }
  ]
}
```

`date` is always present: the publication date as ISO 8601, or `null` when the engine reports none. An empty result set is a successful response with `{"results": []}`.

## Fetch

`POST /compat/deepseek/fetch`

| Field | Behavior |
| --- | --- |
| `url` | Required. A public HTTP or HTTPS page. |

The response returns the page as Markdown:

```json
{ "content": "# Hono\n\nFast, lightweight web framework…" }
```

## How requests are handled

Each call is translated into the matching Search1API request (`/search` or `/crawl`), so **credits and limits are those of the native API**: one search costs 1 credit, and one fetched page costs 1 credit. Errors use DeepSeek's envelope — `{"error": {"message": "…", "type": "…", "code": 401}}` — with Search1API's status codes: `401` for an invalid key, `402` when credits run out and `429` when the rate limit is reached.

The harness's decoder is strict: one malformed result rejects the whole search. This endpoint therefore drops results without a URL and always emits `snippet`, `title` and `date`. The contract was verified against the `mapSearchResponse` decoder shipped with DeepSeek Harness 0.2.2.

## Limitations

- **No page text in search results.** `need_content: true` is accepted but ignored; follow up with `/fetch`.
- **No engine, recency or site filters.** DeepSeek's search request carries only `query` and `count`, so the harness cannot ask for a specific engine or time range through this endpoint. For those options, call [`/search`](https://s1.dev/docs/basic/search) directly or use the [SDKs](https://s1.dev/docs/integrations/sdks).
- **Generated answers are not available.** DeepSeek's `web_search` prose is not returned; only cited sources are.