Web Content
Web crawling, URL discovery and page extraction.
基于图的网站遍历工具,使用 Tavily Crawl。
从根 url 遍历站点,返回所发现页面的内容。通过自然语言 instructions 以及正则路径和域名过滤器引导遍历,并用 max_depth、max_breadth 和 limit 限定范围。返回 base_url 和 results[],其中包含 url 和 raw_content。适用于对单个站点进行广覆盖——文档、商品目录、竞品博客。它同步返回结果,而 post_firecrawl_crawl 不会:后者作为后台作业运行,适合无法等待的超大爬取。
计费参考
- 计量方式:按响应单位计量。
- 参考请求估算:0.024 美元。
- 单位成本基准:0.008 美元。
- 资源单位:
tavily_credit。 - 参考客户倍率:1.0。不得对已结算的客户金额再次应用。
- 成本基准不构成最终客户价格,即使为零也不例外。
仅供参考的元数据,不是账户报价、保证价格或消费上限。资源额度不同于 Felo 额度。最终扣费以 Felo 计费记录为准。
- 类型: stringurl必填
开始爬取的根 URL。
- 类型: booleanallow
_external 在最终结果列表中包含外部域名链接。
- 类型: integerchunks
_per _source 最小值:1最大值:5每个来源返回的相关分块最大数。
- 类型: array string[]exclude
_domains 用于在爬取时排除特定域名或子域名的正则表达式模式。
- 类型: array string[]exclude
_paths 用于排除具有特定路径模式的 URL 的正则表达式模式。
- 类型: string 枚举extract
_depth 提取过程的深度。
值- basic
- advanced
- 类型: string 枚举format
提取的网页内容格式。
值- markdown
- text
- 类型: booleaninclude
_favicon 为每条结果包含 favicon URL。
- 类型: booleaninclude
_images 在爬取结果中包含图片。
- 类型: booleaninclude
_usage 在响应中包含额度用量信息。
- 类型: stringinstructions
给爬虫的自然语言指令。
- 类型: integerlimit最小值:1
爬虫停止前会处理的链接总数。
- 类型: integermax
_breadth 最小值:1最大值:500树的每一层最多跟随的链接数。
- 类型: integermax
_depth 最小值:1最大值:5爬取的最大深度。
- 类型: array string[]select
_domains 用于将爬取限定到特定域名或子域名的正则表达式模式。
- 类型: array string[]select
_paths 用于仅选择具有特定路径模式的 URL 的正则表达式模式。
- 类型: number 格式: floattimeout最小值:10最大值:150
爬取操作的最长等待时间(秒)。
- 类型: object200
爬取结果已成功返回。
- 类型: stringbase
_url 被爬取的基准 URL。
- 类型: stringrequest
_id 唯一的请求标识符。
- 类型: number 格式: floatresponse
_time 完成该请求所用的时间(秒)。
- 类型: array object[]results
- favicon类型: string
已爬取页面的 Favicon URL。
- raw类型: string
_content 从页面提取的原始内容。
- url类型: string
已爬取页面的 URL。
- 类型: objectusage
- credits类型: integer
该请求的额度用量详情。
application/json - 400
无法处理该请求。请检查请求参数。
- 401
需要有效的 Felo API 密钥。
- 402
由于未满足计费要求,请求无法继续。
- 403
该账户无权执行此操作。
- 429
已达到请求或支出限额。
- 502
服务无法完成该请求。
- 503
API 或计费服务暂时不可用。
- 504
服务在处理请求时超时。
- default
错误响应;上游透传响应可能采用提供方格式
application/json
curl https://openapi.felo.ai/v1/beta/tavily/crawl \
--request POST \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
--data '{
"url": "docs.tavily.com",
"instructions": "",
"chunks_per_source": 3,
"max_depth": 1,
"max_breadth": 20,
"limit": 50,
"select_paths": [
""
],
"select_domains": [
""
],
"exclude_paths": [
""
],
"exclude_domains": [
""
],
"allow_external": true,
"include_images": false,
"extract_depth": "basic",
"format": "markdown",
"include_favicon": false,
"timeout": 150,
"include_usage": false
}'
{
"base_url": "string",
"results": [
{
"url": "string",
"raw_content": "string",
"favicon": "string"
}
],
"response_time": 1,
"usage": {
"credits": 1
},
"request_id": "string"
}