websearch.fast
控制台获取密钥

面向程序和智能体的网页搜索 API

带网页正文的搜索、网页读取、地理编码和知识卡片,都在一个 JSON API 里。调用按计费单位从 relay.fast 余额扣费,空结果和所有错误都不收费。

POST /v1/web/search

示例来自 API 参考,并非本页加载时的实时调用。

curl https://api.websearch.fast/v1/web/search \
  -H "Authorization: Bearer $WEBSEARCH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "q": "rust async runtime comparison",
    "num": 3,
    "content": {"pages": 1, "max_chars_per_page": 3000}
  }'
import os
import httpx

response = httpx.post(
    "https://api.websearch.fast/v1/web/search",
    headers={"Authorization": f"Bearer {os.environ['WEBSEARCH_API_KEY']}"},
    json={
        "q": "rust async runtime comparison",
        "num": 3,
        "content": {"pages": 1, "max_chars_per_page": 3000},
    },
    timeout=60,
)
response.raise_for_status()
print(response.json())
const response = await fetch("https://api.websearch.fast/v1/web/search", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.WEBSEARCH_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    q: "rust async runtime comparison",
    num: 3,
    content: { pages: 1, max_chars_per_page: 3000 },
  }),
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.json());

2003 条结果示例

  1. Choosing an async runtime in 2026blog.example.comWe benchmarked four runtimes on the same HTTP workload and compared scheduling, I/O and memory use. 2026-09-14
  2. Async runtimes: a comparison of schedulersdocs.example.orgHow work-stealing and thread-per-core runtimes differ, with notes on when each fits. 2026-06-02
  3. Moving a service between async runtimeswww.example.netWhat changed in our code when we moved a Rust service from one async runtime to another. 2026-03-21
{
  "object": "web.search",
  "request_id": "20261128120000123456789a1b2c3d4Kx7Qm2Pz",
  "created": 1795867200,
  "input": {
    "q": "rust async runtime comparison",
    "type": "web",
    "page": 1,
    "num": 3,
    "safe": "moderate",
    "operators": {},
    "content": {
      "pages": 1,
      "format": "markdown",
      "max_chars_per_page": 3000,
      "mode": "full"
    },
    "timeout_ms": 25000
  },
  "results": [
    {
      "position": 1,
      "title": "Choosing an async runtime in 2026",
      "url": "https://blog.example.com/posts/async-runtimes-2026",
      "domain": "blog.example.com",
      "snippet": "We benchmarked four runtimes on the same HTTP workload and compared scheduling, I/O and memory use.",
      "published_at": "2026-09-14T00:00:00Z",
      "origin": "index",
      "content": {
        "status": "ok",
        "format": "markdown",
        "chars": 3000,
        "truncated": true,
        "text": "# Choosing an async runtime in 2026\n\n...",
        "fetched_at": 1795860000
      }
    },
    {
      "position": 2,
      "title": "Async runtimes: a comparison of schedulers",
      "url": "https://docs.example.org/rust/async/runtimes",
      "domain": "docs.example.org",
      "snippet": "How work-stealing and thread-per-core runtimes differ, with notes on when each fits.",
      "published_at": "2026-06-02T00:00:00Z",
      "origin": "live"
    },
    {
      "position": 3,
      "title": "Moving a service between async runtimes",
      "url": "https://www.example.net/notes/runtime-migration",
      "domain": "www.example.net",
      "snippet": "What changed in our code when we moved a Rust service from one async runtime to another.",
      "published_at": "2026-03-21T00:00:00Z",
      "origin": "live"
    }
  ],
  "has_more": true,
  "usage": {
    "charged": true,
    "items": [
      {"unit": "search_web", "count": 1},
      {"unit": "content_page", "count": 1}
    ]
  },
  "cache": {"hit": false, "data_age_seconds": 0, "fetched_at": 1795867200}
}

端点

已经在用 Serper 请求格式?

兼容路径接受这种格式,也按它的结构返回。换掉域名和密钥,请求体原样保留。这种格式的字段没有全部填上,迁移指南里列出了缺哪些。

搜索客户端

- POST $PREVIOUS_BASE_URL/search
+ POST https://api.websearch.fast/search
- X-API-KEY: $PREVIOUS_API_KEY
+ X-API-KEY: $WEBSEARCH_API_KEY

迁移指南

在智能体中使用

MCP 服务器以 Streamable HTTP 提供 web_search、web_fetch、geocode、reverse_geocode、autocomplete 和 knowledge 六个工具。客户端只要能填远程服务器 URL 和 Bearer 请求头,就能接入。

.mcp.json

{
  "mcpServers": {
    "websearch": {
      "type": "http",
      "url": "https://api.websearch.fast/mcp",
      "headers": {"Authorization": "Bearer ${WEBSEARCH_API_KEY}"}
    }
  }
}

会读文档的智能体可以从本站的索引开始。

curl https://websearch.fast/llms.txt

各客户端的 MCP 配置

计费

没有单独的订阅。每次调用按用到的计费单位折算成积分,以 USD 从 relay.fast 账户余额扣除,模型调用也从这份余额扣费。错误、空结果和没能读取的网页都不计费。

每个响应都在 usage 里列出本次的计费内容。用量接口按天和端点汇总一个密钥的用量。

用 relay.fast 登录,创建密钥