Data API / Tavily / Extract
Tavily Extract
Extract readable content from one URL or an array of URLs. Select text or Markdown with format. Inspect both results and failed_results: a failed URL can be reported in an otherwise successful HTTP response. Set include_usage to receive resource usage information; usage.credits is not a Felo charge.
Параметры
Параметров пути, запроса и заголовков нет.
Тело запроса
urlsОбязательныйThe URL or URLs to extract content from. A single URL string and an array of URL strings are both accepted.
querystringНеобязательныйUser intent for reranking extracted content chunks.
chunks_per_sourceintegerНеобязательныйMaximum number of relevant chunks returned per source. Available only when query is provided.
extract_depthstringНеобязательныйДопустимые значения: basic · advanced
Depth of the extraction process.
include_imagesbooleanНеобязательныйInclude a list of images extracted from the URLs.
include_faviconbooleanНеобязательныйInclude the favicon URL for each result.
formatstringНеобязательныйДопустимые значения: markdown · text
Format of the extracted web page content.
timeoutnumberНеобязательныйMaximum time in seconds to wait for URL extraction. If omitted, default timeouts depend on extract_depth: 10 seconds for basic and 30 seconds for advanced.
include_usagebooleanНеобязательныйInclude resource usage information in the response. This is not Felo billing information.
Пример запроса
curl -X POST "https://openapi.felo.ai/v1/beta/tavily/extract" \
-H "Authorization: Bearer $FELO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"urls": {},
"query": "<string>",
"chunks_per_source": 0,
"extract_depth": "<string>",
"include_images": false,
"include_favicon": false,
"format": "<string>",
"timeout": 0
}'Ответ
Пример ответа
{
"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"
}Поля ответа
resultsobject[]НеобязательныйurlstringНеобязательныйURL of the extracted content.
titlestringНеобязательныйTitle of the extracted page.
raw_contentstringНеобязательныйExtracted raw content from the URL.
imagesstring[]НеобязательныйImages extracted from the URL when include_images is true.
faviconНеобязательныйFavicon URL of the extracted content.
failed_resultsstring[]НеобязательныйList of URLs that could not be processed.
response_timenumberНеобязательныйTime in seconds it took to complete the request.
usageobjectНеобязательныйcreditsintegerНеобязательныйResource units consumed by this request, not USD or Felo credits.
request_idstringНеобязательныйUnique request identifier.