Search the web with Brave
bravesearch.web.searchSearch Brave's independent web index for ranked pages and rich results.
- 价格
- $0.005/call按目录价
- 成功率
- 73.7%近 30 天 · 2,407 次
- 延迟 p50
- 555 毫秒p95 772 毫秒
- 最后验证
- 2026年10月30日实测可用
GEThttps://toolswitch.dev/v1/tools/bravesearch.web.search?q=Python+programming+language&count=1Beta- 可用平台额度调用
- 同步返回
- 读取公开数据
参数
Results are in web.results; the web object may be absent on a no-match query. Other rich blocks remain in the raw response.
| 参数 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
| 查询参数 | ||||
q | 字符串 | 必填 | Python programming language | |
count | 整数 | 可选 | 1 | |
country | 字符串 | 可选 | ||
freshness | 字符串 | 可选 | pd, pw, pm, py, or YYYY-MM-DDtoYYYY-MM-DD | |
safesearch | 字符串 | 可选 | ||
spellcheck | 布尔 | 可选 | ||
search_lang | 字符串 | 可选 | ||
- 查询参数
q字符串必填示例:
Python programming languagecount整数可选示例:
1country字符串可选freshness字符串可选pd, pw, pm, py, or YYYY-MM-DDtoYYYY-MM-DD
safesearch字符串可选spellcheck布尔可选search_lang字符串可选
代码示例
将 $TOOLSWITCH_KEY 替换为你在控制台创建的密钥。
Beta
curl -X GET 'https://toolswitch.dev/v1/tools/bravesearch.web.search?q=Python+programming+language&count=1' \
-H "X-Toolswitch-Key: $TOOLSWITCH_KEY"import os
import requests
response = requests.request(
"GET",
"https://toolswitch.dev/v1/tools/bravesearch.web.search?q=Python+programming+language&count=1",
headers={"X-Toolswitch-Key": os.environ["TOOLSWITCH_KEY"]},
)
response.raise_for_status()
print(response.text)const response = await fetch("https://toolswitch.dev/v1/tools/bravesearch.web.search?q=Python+programming+language&count=1", {
method: "GET",
headers: {
"X-Toolswitch-Key": process.env.TOOLSWITCH_KEY ?? "",
},
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
console.log(await response.text());网关接口为 Beta,地址与鉴权方式可能变更。 示例参数仅为样例数据。 调用按 $0.005/call 计费,已含服务费。