Web Search
Search public web content with Tavily.
Tavily Search
搜尋網路並傳回含標題、URL 與內容摘要的排序結果。query 為必填。使用 max_results 控制結果數量,使用 search_depth 選擇搜尋模式。額外的 answer、images 與原始內容僅在要求時傳回。設定 include_usage 以接收資源用量資訊;usage.credits 並非 Felo 費用。
計費參考
- 計量方式:依回應單位計量。
- 參考請求估算:0.016 美元。
- 單位成本基準:0.008 美元。
- 資源單位:
tavily_credit。 - 參考客戶乘數:1.0。不得再次套用於已結算的客戶金額。
- 成本基礎不構成最終客戶價格,即使為零亦同。
僅供參考的中繼資料,並非帳戶報價、保證價格或消費上限。資源額度並非 Felo 額度。最終費用依 Felo 計費記錄為準。
- 類型: stringquery必填
使用 Tavily 執行的搜尋查詢。
- 類型: booleanauto
_parameters 根據查詢內容自動設定搜尋參數。
- 類型: integerchunks
_per _source 最小值:1最大值:3每個來源傳回的相關區塊最大數。
- 類型: string 列舉country
提升來自特定國家的搜尋結果。僅在 topic 為 general 時可用。
值- afghanistan
- albania
- algeria
- andorra
- angola
- 類型: string 格式: dateend
_date 傳回指定結束日期之前的結果。
- 類型: array string[] …150exclude
_domains 要從搜尋結果中明確排除的網域清單。
- include
_answer 包含 LLM 產生的答案。true 使用預設答案模式;basic 或 advanced 指定答案產生模式。
- 類型: boolean
包含 LLM 產生的答案。true 使用預設答案模式;basic 或 advanced 指定答案產生模式。
- 類型: array string[] …300include
_domains 要明確包含在搜尋結果中的網域清單。
- 類型: booleaninclude
_favicon 為每筆結果包含 favicon URL。
- 類型: booleaninclude
_image _descriptions include_images 為 true 時,為每張圖片新增描述文字。
- 類型: booleaninclude
_images 執行圖片搜尋並包含結果。
- include
_raw _content 為每筆搜尋結果包含清理並解析後的內容。true 或 markdown 傳回 Markdown;text 傳回純文字,可能增加延遲。
- 類型: boolean
為每筆搜尋結果包含清理並解析後的內容。true 或 markdown 傳回 Markdown;text 傳回純文字,可能增加延遲。
- 類型: booleaninclude
_usage 在回應中包含資源用量資訊。此資訊不是 Felo 計費資訊。
- 類型: integermax
_results 最小值:0最大值:20要傳回的搜尋結果數量上限。
- 類型: booleansafe
_search 從搜尋結果中過濾成人或不安全內容。僅限企業版;search_depth 為 fast 或 ultra-fast 時不支援。
- 類型: string 列舉search
_depth 控制延遲與相關性的取捨。advanced 相關性最高,但延遲和成本也更高;basic 較為均衡;fast 和 ultra-fast 著重降低延遲。
值- advanced
- basic
- fast
- ultra
-fast
- 類型: string 格式: datestart
_date 傳回指定開始日期之後的結果。
- 類型: string 列舉time
_range 依發布日期篩選結果的時間範圍。
值- day
- week
- month
- year
- d
- w
- m
- y
- 類型: string 列舉topic
搜尋類別。
值- general
- news
- finance
- 類型: object200
已成功傳回搜尋結果。
- 類型: string | nullanswer
簡短的 LLM 產生答案。include_answer 為 false 或未產生答案時為 null。
- 類型: array object[]images
- description類型: string
圖片描述。
- url類型: string
圖片 URL。
- 類型: stringquery
實際執行的搜尋查詢。
- 類型: stringrequest
_id 唯一的請求識別碼。
- 類型: number 格式: floatresponse
_time 完成該請求所用的時間(秒)。
- 類型: array object[]results
- content類型: string
搜尋結果的內容摘要。
- favicon類型: string | null
搜尋結果的 Favicon URL。
- raw類型: string | null
_content 清理並解析後的來源內容。除非請求 include_raw_content,否則為 null;沒有可用的原始內容時同為 null。
- score類型: number 格式: float
搜尋結果的相關性分數。
- title類型: string
搜尋結果的標題。
- url類型: string
搜尋結果的 URL。
- 類型: objectusage
- credits類型: integer
此請求消耗的資源單位,不是美元或 Felo 額度。
application/json - 400
無法處理該要求。請檢查請求參數。
- 401
需要有效的 Felo API 金鑰。
- 402
由於未符合計費要求,要求無法繼續。
- 403
該帳戶無權執行此操作。
- 429
已達到要求或支出上限。
- 502
服務無法完成該要求。
- 503
API 或計費服務暫時無法使用。
- 504
服務在處理要求時逾時。
- default
錯誤回應;上游透傳回應可能採用供應商格式
application/json
curl --request POST https://openapi.felo.ai/v1/beta/tavily/search \
--header "Authorization: Bearer ${FELO_API_KEY:?Set FELO_API_KEY}" \
--header 'Content-Type: application/json' \
--data '{"query": "Python official documentation", "search_depth": "basic", "max_results": 2, "include_usage": true}'
{
"query": "Python official documentation",
"answer": null,
"images": [],
"results": [
{
"title": "Python Documentation",
"url": "https://docs.python.org/3/",
"content": "Documentation for the Python programming language.",
"score": 0.98,
"raw_content": null
}
],
"response_time": 1.2,
"usage": {
"credits": 1
},
"request_id": "example-search-request"
}