读取网页
curl --request GET \
--url https://api.pipellm.ai/v1/websearch/reader \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.pipellm.ai/v1/websearch/reader"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.pipellm.ai/v1/websearch/reader', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.pipellm.ai/v1/websearch/reader"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}读取网页
抓取 URL 并返回干净文本。
GET
/
v1
/
websearch
/
reader
读取网页
curl --request GET \
--url https://api.pipellm.ai/v1/websearch/reader \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.pipellm.ai/v1/websearch/reader"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.pipellm.ai/v1/websearch/reader', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.pipellm.ai/v1/websearch/reader"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}如果你已经知道目标网页 URL,并希望让 PipeLLM WebSearch 抓取并转换成干净文本,
就使用这条路由。
Endpoint
| 方法 | 端点 |
|---|---|
GET | https://api.pipellm.ai/v1/websearch/reader |
认证
Authorization: Bearer $PIPELLM_API_KEY
查询参数
| 参数 | 类型 | 必填 | 描述 |
|---|---|---|---|
url | string | 是 | 要读取的网页 URL |
请求示例
curl -X GET "https://api.pipellm.ai/v1/websearch/reader?url=https://go.dev" \
-H "Authorization: Bearer $PIPELLM_API_KEY"
响应结构
{
"code": 200,
"message": "ok",
"content": "# The Go Programming Language\n\nGo is an open source programming language..."
}
错误结构
{
"code": 400,
"message": "url parameter is required"
}
说明
- 这条路由代理到内部
/api/reader。 - 这条接口返回的是
content字段,而不是data。 pipellm_web_reader对应的最直接 HTTP 路由就是它。- 每次成功请求价格为 $0.01,并以内部模型名
websearch-reader记录。 - PipeLLM 会根据路由自动确定模型名,客户端不需要传入。
相关文档
pipellm-websearch(npm)
在 OpenClaw 里启用网页读取工具
深度搜索
如果你还不知道目标页面,先用搜索路由
WebSearch 总览
查看产品总览和路由矩阵
此页面对您有帮助吗?