Sand AISand AI MAGI-2MAGI-2 现已上线 SandBase:支持原生音频的 1080p 视频立即试用

Tavily URL Content Extraction

API 文档
https://api.sandbase.ai/v1/api/tavily/extract

Extracts clean text content from specified web pages using their URLs. Supports basic or advanced extraction depth and optional image inclusion.

价格
起价 $0.0016美元 / 次调用
方法
POST
响应
JSON
参数
1 个必填 · 2 个可选

Playground

输入
URLs to extract content from.
Depth of content extraction.
Include images found on the pages.
输出示例
响应outputs · 420 B · 13 行
{
  "failed_results": [],
  "request_id": "35001ccb-b475-4057-b008-b5026dc5ac41",
  "response_time": 0,
  "results": [
    {
      "images": [],
      "raw_content": "# Example Domain\n\nThis domain is for use in documentation examples without needing permission. Avoid use in operations.\n\n[Learn more](https://iana.org/domains/example)",
      "title": "Example Domain",
      "url": "https://example.com"
    }
  ]
}

示例

选择一个示例,将其输入和结果加载到 playground 中。

API README

Tavily URL Content Extraction API

Returns the page title and images for each URL you send, with a list of URLs that could not be extracted. It needs a urls array with one or more web page addresses.

Use cases

  • Pull the title of a list of known pages to check what each URL points to.
  • Collect the images found on specific pages by setting include_images to true.
  • Find which URLs in a batch could not be extracted by reading failed_results.
  • Run a batch of pages from a search or site crawl through one extraction call.

Request

curl -X POST "https://api.sandbase.ai/v1/api/tavily/extract" \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"urls": ["https://en.wikipedia.org/wiki/Artificial_intelligence"]}'

The result is returned in outputs[0].data.

Parameters

NameTypeRequiredDescription
urlsarrayYesURLs to extract content from.
extract_depthstringNoDepth of content extraction.
include_imagesbooleanNoInclude images found on the pages.

Example response

Real response for the request above, trimmed: lists keep their first item and long strings are cut.

{
  "failed_results": [],
  "request_id": "f594f392-10f6-4a3f-9d7c-ac020a617625",
  "response_time": 0.03,
  "results": [
    {
      "images": [],
      "title": "Artificial intelligence - Wikipedia",
      "url": "https://en.wikipedia.org/wiki/Artificial_intelligence"
    }
  ],
  "usage": {
    "credits": 1
  }
}

Response fields

FieldMeaning
results[]One entry per URL that was extracted successfully.
results[].urlThe page address that was extracted. Use it to match each result to the URL you sent.
results[].titleThe title of the page, for example Artificial intelligence - Wikipedia.
results[].imagesList of images found on the page. It is empty in this response, where include_images was not set.
failed_resultsList of URLs that could not be extracted. It is empty when every URL worked.
request_idUnique ID of the request, as a UUID.
response_timeTime taken for the request. The value is a number such as 0.03.
usage.creditsNumber of credits recorded for the call, such as 1.

Notes

  • Pass several addresses in the urls array to extract them in one call. Check both results and failed_results for each one.
  • Set extract_depth to basic or advanced. Set include_images to true to fill results[].images.
  • To find URLs to extract, call Tavily Search or Tavily Site Map.

Submit URLs without assuming a text field

Send urls as an array of public page addresses. extract_depth accepts basic or advanced; include_images is a boolean. Search takes a query, while this request takes URLs you already selected. The current reference sample shows URL, title and image fields with failed_results; it does not demonstrate raw_content. That absence is not proof that text extraction is impossible, and it is not a guarantee of full-page text either. Check the approved response for your target before writing a text parser or claiming a complete RAG workflow.

To discover candidate URLs first, read the Tavily Search parameters and the Python search guide. Review and select a URL yourself; the examples do not chain or retry requests.

Pricing

Billed like Tavily's pay-as-you-go price of $0.008 per credit, where 5 successful extractions use 1 credit (tavily.com, checked 2026-11-22 UTC): $0.0016 per successfully extracted URL with extract_depth: "basic" (the default), $0.0032 with "advanced". 5 URLs cost $0.008. Tavily counts credits across calls, so a single URL is not rounded up to a full credit. URLs that fail to extract are not charged, and a call where every URL fails costs nothing. The estimate before a call assumes every URL succeeds. It is not part of the daily free quota, because its price varies with the request.

探索更多

相关 APIs

全部 APIs
API价格响应
Tavily每次调用从 $0.0016 起JSON
Tavily每次调用从 $0.04 起JSON
Tavily每次调用从 $0.008 起JSON

指南:Tavily alternatives: compare Exa and Firecrawl searchExa vs Tavily vs Firecrawl for AI agents

问题

常见问题

如何使用 Tavily URL Content Extraction API?

向 https://api.sandbase.ai/v1/api/tavily/extract 发送 POST 请求,在 Authorization 请求头中使用您的 SandBase API key(Bearer),并将参数作为 JSON 请求体传入。您也可以直接在本页的 Playground 中试用,无需编写代码。

Tavily URL Content Extraction API 的价格是多少?

起价每次调用 $0.0016,从您的 SandBase 余额中扣费。您只需为实际调用付费;无需订阅。

Tavily URL Content Extraction API 接受哪些参数?

必填:urls (array)。 可选:extract_depth(basic, advanced 之一) 和 include_images (boolean)。 Parameters 表和本页的 Playground 列出了每个字段。

Tavily URL Content Extraction API 返回什么?

在同一个 HTTP 请求中返回的 JSON 响应(同步)。 本页的 README 包含一个示例响应。

我需要 Tavily 开发者账户或 API key 吗?

不需要。Tavily URL Content Extraction 通过 SandBase 运行,因此一个 SandBase API key 即可覆盖此端点以及目录中的其他所有 API 和模型。您无需单独申请 Tavily API 访问权限。

URL 输入格式是什么?

将 urls 作为公开页面地址数组发送,而不是单个字符串或搜索查询。extract_depth 接受 basic 或 advanced;include_images 是布尔值。请查看此端点当前的 schema,不要照搬额外的上游选项。

我可以假设每个提取结果都包含 raw_content 吗?

不可以。当前参考示例展示了 URL、title 和 image 字段以及 failed_results,但没有演示 raw_content。这并不能说明页面文本不可用。请先为你的目标验证一个已获批准的响应,再依赖文本字段、整页覆盖或下游 RAG 工作流。

一次已完成的请求能证明每个 URL 都被提取了吗?

不能。文档中的封装是 outputs[0].data,参考说明也描述了 results 和 failed_results。仅凭一次完成的运行或 HTTP 成功,并不能证明每个 URL 都生成了你想要的内容。请检查响应,并将缺失字段保留为未知,而不是把它们转换为空文本。