网络搜索 API
Web Search API

原始链接: https://developers.cloudflare.com/changelog/post/2026-10-02-introducing-web-search-api/

Cloudflare 的 Web Search API 现已进入测试阶段,可让 AI 智能体和应用程序检索互联网上的实时信息,而无需依赖模型训练数据或猜测网址。该 API 支持三个搜索提供商:Ceramic.ai、Exa 和 Linkup。三者均通过 Cloudflare 提供零数据保留服务,并遵循其经验证的机器人抓取标准。 请求将通过 AI Gateway 执行,并显示在网关日志中。费用按各提供商的 API 费率通过 AI Gateway 积分结算,Cloudflare 不加收额外费用。用户也可以使用自己的提供商 API 密钥。 该 API 支持通过 REST 调用,也可直接从 Workers AI 绑定中调用。调用时可指定查询内容、搜索提供商、结果数量上限以及可选的网关配置。Cloudflare 的《如何使用 Web Search API》指南提供了设置说明和示例。

相关文章

原文

Web Search API is now available in beta. Web Search API lets your AI agents and applications search the Internet and ground their responses in live information, instead of guessing URLs or relying on a model's training cutoff.

At launch, you can choose between three search providers: Ceramic.ai, Exa, and Linkup. All three support Zero Data Retention for requests made through Cloudflare, and all have committed to Cloudflare's verified bot crawling standards.

Web Search API runs through AI Gateway, so search requests appear in your gateway logs and are billed to your AI Gateway credits at each provider's list API price, with no additional markup. You can also bring your own provider API key.

Call Web Search API with the REST API:

curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/websearch/ \
  --request POST \
  --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
    "query": "What are some fun things to do in Salt Lake City as fall approaches?",
    "provider": "ceramic",
    "limit": 5,
    "options": { "gateway": { "id": "default" } }
  }'

Or from a Worker with the AI binding:

const response = await env.AI.websearch({
	gatewayId: "default",
	query: "What are some fun things to do in Salt Lake City as fall approaches?",
	provider: "exa",
	limit: 5,
});

const results = await response.json();

To get started, refer to How to use Web Search API.

联系我们 contact @ memedata.com