Felo API PlatformFelo API Platform

設定 Harness

Web Fetch API

透過 selector 和 readability 選項,將網頁內容擷取為 HTML、text 或 Markdown。

POST/v2/web/extract

認證

Bearer API key

Content type

application/json

限流說明

可能適用 endpoint 專屬限制。

Web Fetch API 從目標 URL 擷取內容,並返回更適合 agents、RAG systems 和 content workflows 處理的結果。它可返回 HTML、plain text 或 Markdown,並支援 selectors、readability options、cache control、custom user agents 和 request cookies。

Endpoint

POST https://openapi.felo.ai/v2/web/extract

認證

Authorization: Bearer YOUR_API_KEY

Body Parameters

ParameterTypeRequiredDefaultDescription
urlstring-要擷取的網頁 URL
crawl_modestringfastfast 更快;fine 更精細,適合複雜頁面
output_formatstringhtml支援 htmltextmarkdown
with_readabilityboolean or stringNo-啟用 readability 處理,聚焦主要內容
target_selectorstring-目標 CSS selector,例如 article.main-content
wait_for_selectorstring-等待 selector 出現後再擷取,適合動態頁面
set_cookiesarrayNo-隨請求傳送 cookies
user_agentstring-自定義 User-Agent
timeoutinteger-請求 timeout,單位 ms

回應

data 採用透明透傳設計,具體欄位取決於 output_format 和 options。

{
  "status": "ok",
  "message": null,
  "data": { "content": "# Example Article

Extracted article content..." }
}

Error Responses

HTTP StatusError Code說明建議操作
400WEB_EXTRACT_FAILEDURL 無效、請求引數錯誤或 extractor 返回客戶端錯誤檢查 url、selectors 和引數
401INVALID_API_KEYAPI key 缺失、無效或已撤銷檢查 API key 和 authorization header
500WEB_EXTRACT_FAILED內部服務錯誤重試;持續失敗請聯絡 support

Example

curl -X POST https://openapi.felo.ai/v2/web/extract   -H "Authorization: Bearer YOUR_API_KEY"   -H "Content-Type: application/json"   -d '{"url":"https://example.com/article","output_format":"markdown","with_readability":true}'

使用場景

  • 在 Agent 回答問題前提供網頁上下文
  • 為 RAG ingestion 或 knowledge base creation 擷取文章正文
  • 將網頁轉換為 Markdown,用於歸檔或文件工作流
  • 使用 CSS selectors 從頁面中擷取聚焦內容