POST
/distill
蒸餾單個頁面

將網頁轉換為乾淨的、LLM 就緒的 Markdown 格式。

使用場景:

  • 為 RAG(檢索增強生成)準備網頁內容
  • 擷取文章內容用於 AI 處理
  • 將文件頁面轉換為 Markdown
  • 處理動態網頁應用

包含內容:

  • 保留結構的乾淨 Markdown 內容
  • 自動移除廣告、導覽和樣板內容
  • 中繼資料擷取(標題、描述、語言)
  • JavaScript 渲染處理動態內容
  • 自動處理反爬蟲措施

輸出格式: 返回針對 LLM 消費優化的 Markdown,最小雜訊,最大訊號。

授權

YOUR_API_KEY
授權Bearer <token>

在 Thunderbit Dashboard 取得 API key。標頭格式:Authorization: Bearer YOUR_API_KEY

位置: header

請求體

application/json

TypeScript Definitions

Use the request body type in TypeScript.

url*string必填

要蒸餾的網頁 URL

範例:https://thunderbit.com/playground
timeoutnumber預設值:30000

請求逾時時間(毫秒),預設 30000,最大 60000

取值範圍:5000 <= x <= 60000
範例:
30000
waitFornumber預設值:0

頁面載入後等待動態內容渲染的時間(毫秒),然後再擷取內容

取值範圍:0 <= x <= 10000
範例:
2000
includeTagsstring[]

僅包含這些 HTML 標籤中的內容(如 ['article', 'main', 'div.content'])

範例:
[
  "article",
  "main"
]
excludeTagsstring[]

排除這些 HTML 標籤中的內容(如 ['nav', 'footer', 'aside'])

範例:
[
  "nav",
  "footer",
  "aside"
]
headersobject

隨請求傳送的自訂 HTTP 標頭

範例:
{
  "Accept-Language": "en-US"
}
countryCodestring預設值:"US"

用於地理定位的 2 字母 ISO 國家碼(預設 US)。流量將透過指定國家的代理伺服器轉發。

範例:US
renderModestring預設值:"none"

JavaScript 渲染模式。none = 不渲染 JS(最快,預設);basic = 標準渲染;full = 標準渲染並延長等待以處理動態內容

取值範圍"none" | "basic" | "full"
forceRefreshboolean預設值:false

繞過快取,強制重新抓取頁面(預設 false)

formatsany[]

輸出格式。字串用於選擇簡單格式;物件用於參數化 LLM 格式(summaryquestionhighlights)。

範例:
[
  "markdown",
  "links",
  "images"
]
includestring[]

回應中可選包含的欄位。可選值:metadata(標題、描述、語言等)、html(原始 HTML)、links(提取的連結)。可取代 includeHtmlextractLinks

範例:
[
  "metadata",
  "links"
]
includeHtmlboolean預設值:false

回應中是否包含原始 HTML(預設 false)。建議改用 include 參數。

extractLinksboolean預設值:false

是否從頁面提取連結(預設 false)。建議改用 include 參數。

回應

application/json

成功回應

successboolean
範例:
true
dataobject
展開子屬性
urlstring

被蒸餾的 URL

範例:https://thunderbit.com/playground
markdownstring

從頁面擷取的乾淨 Markdown 內容

範例:# Understanding Web Distillation Web distillation is the process of converting raw HTML into clean, structured content... ## Key Benefits - **LLM-Ready Format**: Optimized for AI consumption - **Noise Removal**: Automatic filtering of ads and boilerplate - **Structure Preservation**: Maintains semantic hierarchy
metadataobject

Page metadata (only returned when include contains metadata)

展開子屬性
titlestring

標籤或 Open Graph 擷取的頁面標題

範例:Understanding Web Distillation | Tech Blog
descriptionstring

Meta 描述或摘要

languagestring

偵測到的語言代碼(ISO 639-1)

範例:en
sourceUrlstring

Original URL (may differ from requested URL due to redirects)

statusCodeinteger

回應的 HTTP 狀態碼

範例:
200
htmlstring

原始 HTML 內容(可選,僅在請求時返回)

範例:
null
linksobject[]

內容中發現的連結

展開子屬性
textstring

Visible link text as rendered in the page

範例:Read more
hrefstring

Resolved absolute URL of the link

範例:https://example.com/article
imagesobject[]

從頁面擷取的圖片。

展開子屬性
srcstring

Image source URL.

範例:https://example.com/hero.png
altstring

Image alt text.

範例:Hero banner
widthinteger

Image width in pixels.

heightinteger

Image height in pixels.

summarystring

結構化 Markdown 摘要(LLM 格式)。

answerstring

question 格式中提供的問題的回答。

highlightsstring[]

highlights 格式呈現的重點段落。

errorobject
範例:
null