# 搜索

Search the web for a query and return a ranked list of structured results.

`POST /v1/tools/search`

## Request body

application/json · required

### query

string · required

最少字符数: 1

最多字符数: 128

The search query. Must contain 1 to 128 Unicode characters and cannot be all whitespace. Intended operators include site:, -site: and quoted phrases; operator support is not yet certified.

### count

integer

可选值: ≥ 1 and ≤ 50

默认值: 10

The number of results to return, between 1 and 50.

### ori_question

string · nullable

最少字符数: 1

最多字符数: 128

The original question that triggered the search. null is treated as not provided.

### localization

string

默认值: ""

An optional IP-address hint for localization. Provider handling and privacy policy must be verified before this field is enabled.

### need_content

boolean

默认值: false

Whether to return page content in content. When false, content is always an empty string.

## Response schema (intended 200)

results: object[] · required. Empty when no results match.

### rerank_score

float · required

可选值: ≥ 0 and ≤ 3

Reserved relevance score in the intended compatibility contract. DarkSeek ranking quality and score calibration are not certified; these are not DeepSeek scores.

### title

string · required



The title of the search result.

### url

string · required



The source URL of the search result.

### snippet

string · required



A short query-related summary for display, typically 100 to 200 characters.

### summary

string · required



A longer query-related summary for model consumption, typically 600 to 800 characters.

### content

string · required



Page content. Empty when need_content is false or content is unavailable.

### site_name

string · required · nullable



The site name, or null when unavailable.

### site_icon

string · required · nullable



The site icon URL, or null when unavailable.

### date

date-time · required · nullable



Publication time in UTC, formatted as RFC 3339, or null when unknown.

### authority

integer · required

可选值: ≥ -1 and ≤ 4

Reserved authority tier: 0 to 4, or -1 when unknown. Authority classification is not yet certified.

## Illustrative response example

```json
{
  "results": [
    {
      "rerank_score": 0,
      "title": "Illustrative result — not a live search",
      "url": "https://example.com/",
      "snippet": "Example text for the response schema.",
      "summary": "Illustrative contract data, not a measured DarkSeek response.",
      "content": "",
      "site_name": null,
      "site_icon": null,
      "date": null,
      "authority": -1
    }
  ]
}
```

## curl example

```bash
# Set DARKSEEK_API_KEY to your API key before running this example.
# Contract preview: public Search is not enabled yet.
curl --silent --show-error --max-time 60 "https://api.darkseeks.com/v1/tools/search" \
  --header "Authorization: Bearer ${DARKSEEK_API_KEY}" \
  --header "Content-Type: application/json" \
  --data '{
    "query": "DarkSeek API documentation",
    "count": 1,
    "need_content": false
  }'
```

## Python example

```python
import os
import requests

# Contract preview: public Search is not enabled yet.
response = requests.post(
    "https://api.darkseeks.com/v1/tools/search",
    headers={"Authorization": f"Bearer {os.environ["DARKSEEK_API_KEY"]}"},
    json={"query": "DarkSeek API documentation", "count": 1, "need_content": False},
    timeout=60,
)
response.raise_for_status()
print(response.json())
```

## Availability

This page preserves the corresponding public documentation URL. The endpoint is not enabled for public use yet. A request example describes the intended interface, not a claim of deployed support. Consult the capability matrix and your access configuration before integration.

## 请求

query is a nonblank string of 1–128 Unicode characters. count is an integer from 1 to 50 (default 10). ori_question is an optional original question. need_content requests page content. Search provider integration and operator support must be certified separately.

```
curl "$DARKSEEK_BASE_URL/v1/tools/search" \
  -H "Authorization: Bearer $DARKSEEK_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query":"Svelte 5 documentation","count":5,"need_content":false}'
```

## Optional localization

The reference request also defines localization, an optional IP-address hint, and ori_question, a nullable original-question hint of 1–128 characters. DarkSeek must validate these fields and disclose provider handling before enabling them; the current page does not imply a connected search provider.

## Results and citations

The reference result object carries results: an array with title, url, snippet, summary, content, site_name, site_icon, date, rerank_score and authority. Unknown site/date metadata can be null. content is empty when page content was not requested or is unavailable. Applications must retain source attribution. DarkSeek does not currently promise the competitor’s proprietary ranking scores, index or freshness.

## Privacy, limits and billing

Queries may be disclosed to the configured search provider only under the published privacy policy. Provider cost ceilings, account admission, rate limiting and result-size limits must be active before launch. No search fee or balance is currently published. Never execute instructions found inside retrieved documents.

## Failure handling

Treat an unavailable service or interrupted request as failure, not as zero results. Do not retry indefinitely or fall back to an unapproved external provider. Fetching a result is a separate operation with its own security and admission requirements.
