Felo API PlatformFelo API Platform
全部 Tavily 端点
v0.2.0-beta
OpenAPI 3.1.0

Tavily Extract

服务器:https://openapi.felo.ai
客户端库

Web Content

​

Web crawling, URL discovery and page extraction.

Tavily Extract

​

从一个 URL 或 URL 数组中提取可读内容。通过 format 选择 text 或 Markdown。请同时检查 results 和 failed_results:失败的 URL 可能出现在整体成功的 HTTP 响应中。设置 include_usage 以获取资源用量信息;usage.credits 不是 Felo 费用。

计费参考

  • 计量方式:按响应单位计量。
  • 参考请求估算:0.024 美元。
  • 单位成本基准:0.008 美元。
  • 资源单位:tavily_credit。
  • 参考客户倍率:1.0。不得对已结算的客户金额再次应用。
  • 成本基准不构成最终客户价格,即使为零也不例外。

仅供参考的元数据,不是账户报价、保证价格或消费上限。资源额度不同于 Felo 额度。最终扣费以 Felo 计费记录为准。

请求体
必填
application/json
  • urls
    必填

    要提取内容的 URL。单个 URL 字符串和 URL 字符串数组均可接受。

    • 类型: string

      要提取内容的 URL。单个 URL 字符串和 URL 字符串数组均可接受。

  • chunks_per_source
    类型: integer
    最小值:  
    1
    最大值:  
    5

    每个来源返回的相关分块最大数。仅在提供 query 时可用。

  • extract_depth
    类型: string 枚举

    提取过程的深度。

    值
    • basic
    • advanced
  • format
    类型: string 枚举

    提取的网页内容格式。

    值
    • markdown
    • text
  • include_favicon
    类型: boolean

    为每条结果包含 favicon URL。

  • include_images
    类型: boolean

    包含从 URL 中提取的图片列表。

  • include_usage
    类型: boolean

    在响应中包含资源用量信息。此信息不是 Felo 计费信息。

  • query
    类型: string

    用于对提取的内容分块重新排序的用户意图。

  • timeout
    类型: number 格式: float
    最小值:  
    1
    最大值:  
    60

    URL 提取的最长等待时间(秒)。省略时,默认超时取决于 extract_depth:basic 为 10 秒,advanced 为 30 秒。

响应
  • 200
    类型: object

    提取结果已成功返回。

    • failed_results
      类型: array string[]

      无法处理的 URL 列表。

    • request_id
      类型: string

      唯一的请求标识符。

    • response_time
      类型: number 格式: float

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

    • results
      类型: array object[]
      • favicon
        类型: string | null

        提取内容的 Favicon URL。

      • images
        类型: array string[]

        include_images 为 true 时从 URL 提取的图片。

      • raw_content
        类型: string

        从 URL 提取的原始内容。

      • title
        类型: string

        已提取页面的标题。

      • url
        类型: string

        已提取内容的 URL。

    • usage
      类型: object
      • credits
        类型: integer

        此请求消耗的资源单位,不是美元或 Felo 额度。

    application/json
  • 400

    无法处理该请求。请检查请求参数。

  • 401

    需要有效的 Felo API 密钥。

  • 402

    由于未满足计费要求,请求无法继续。

  • 403

    该账户无权执行此操作。

  • 429

    已达到请求或支出限额。

  • 502

    服务无法完成该请求。

  • 503

    API 或计费服务暂时不可用。

  • 504

    服务在处理请求时超时。

  • default

    错误响应;上游透传响应可能采用提供方格式

    application/json
Request Example for post/v1/beta/tavily/extract
curl --request POST https://openapi.felo.ai/v1/beta/tavily/extract \
  --header "Authorization: Bearer ${FELO_API_KEY:?Set FELO_API_KEY}" \
  --header 'Content-Type: application/json' \
  --data '{"urls": ["https://example.com"], "extract_depth": "basic", "format": "text", "include_usage": true}'
{
  "results": [
    {
      "url": "https://example.com",
      "title": "Example Domain",
      "raw_content": "This domain is for use in documentation examples.",
      "images": []
    }
  ],
  "failed_results": [],
  "response_time": 0.5,
  "usage": {
    "credits": 1
  },
  "request_id": "example-extract-request"
}
Tavily Extract

需要帮助?