Skip to main content
POST
使用 Tavily Crawl、基于图的网站遍历工具。
从根 url 遍历站点并返回沿途页面的正文。可用自然语言 instructions 加正则路径/域名过滤引导,并用 max_depthmax_breadthlimit 限定范围。返回 base_urlresults[],每条含 urlraw_content。实测限制 3 个页面时约 4.5 秒;成本和耗时随你设的上限增长,所以务必设。适合需要覆盖某一个站点的场景 —— 文档站、商品目录、竞品博客。它是同步返回的,而 post_firecrawl_crawl 不是:那个作为后台任务跑,适合大到等不起的爬取。若只是几个已知页面,post_tavily_extract 便宜得多;想在付费爬取前先看看站有多大,先跑 post_tavily_map

授权

Authorization
string
header
必填

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

请求体

application/json
url
string
必填

开始抓取的根 URL。

示例:

"docs.tavily.com"

instructions
string

用于爬虫的自然语言指令。

chunks_per_source
integer
默认值:3

每个来源返回的相关文本块的最大数量。

必填范围: 1 <= x <= 5
max_depth
integer
默认值:1

最大抓取深度。

必填范围: 1 <= x <= 5
max_breadth
integer
默认值:20

树中每一层可跟踪的最大链接数量。

必填范围: 1 <= x <= 500
limit
integer
默认值:50

爬虫停止前将处理的链接总数。

必填范围: x >= 1
select_paths
string[]

用于仅选择具有特定路径模式的 URL 的正则表达式模式。

select_domains
string[]

用于选择仅抓取特定域名或子域名的正则表达式模式。

exclude_paths
string[]

用于排除具有特定路径模式的 URL 的正则表达式模式。

exclude_domains
string[]

用于从抓取中排除特定域名或子域名的正则表达式模式。

allow_external
boolean
默认值:true

在最终结果列表中包含外部域名链接。

include_images
boolean
默认值:false

在抓取结果中包含图片。

extract_depth
enum<string>
默认值:basic

提取过程的深度。

可用选项:
basic,
advanced
format
enum<string>
默认值:markdown

提取的网页内容格式。

可用选项:
markdown,
text
include_favicon
boolean
默认值:false

为每个结果包含 favicon URL。

timeout
number<float>
默认值:150

等待抓取操作完成的最长时间(秒)。

必填范围: 10 <= x <= 150
include_usage
boolean
默认值:false

在响应中包含信用额度用量信息。

响应

200 - application/json

已成功返回抓取结果。

base_url
string

已抓取的基础 URL。

results
object[]
response_time
number<float>

完成请求所用的时间(秒)。

usage
object
request_id
string

唯一请求标识符。