POST
/distill
Distill Single Page

Convert a web page into clean, LLM-ready Markdown format.

Use Cases:

  • Prepare web content for RAG (Retrieval-Augmented Generation)
  • Extract article content for AI processing
  • Convert documentation pages to markdown
  • Process dynamic web applications

What's Included:

  • Clean markdown content with preserved structure
  • Automatic removal of ads, navigation, and boilerplate
  • Metadata extraction (title, description, language)
  • JavaScript rendering for dynamic content
  • Automatic handling of anti-bot measures

Output Format: Returns markdown optimized for LLM consumption with minimal noise and maximum signal.

Authorization

YOUR_API_KEY
AuthorizationBearer <token>

Enter your API key from the Thunderbit Dashboard. The header format will be: Authorization: Bearer YOUR_API_KEY

In: header

Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

url*stringrequired

The URL of the web page to distill

Example:https://thunderbit.com/playground
timeoutnumberdefault:30000

Request timeout in milliseconds (default: 30000, max: 60000)

Required range:5000 <= x <= 60000
Example:
30000
waitFornumberdefault:0

Time to wait (in milliseconds) after page load for dynamic content to render before extracting content

Required range:0 <= x <= 10000
Example:
2000
includeTagsstring[]

Only include content from these HTML tags (e.g., ['article', 'main', 'div.content'])

Example:
[
  "article",
  "main"
]
excludeTagsstring[]

Exclude content from these HTML tags (e.g., ['nav', 'footer', 'aside'])

Example:
[
  "nav",
  "footer",
  "aside"
]
headersobject

Custom HTTP headers to send with the request

Example:
{
  "Accept-Language": "en-US"
}
countryCodestringdefault:"US"

2-letter ISO country code for geo-targeting (default: US). Traffic is routed through proxy servers in the specified country.

Example:US
renderModestringdefault:"none"

JavaScript rendering mode. none = no JS rendering (fastest, default); basic = standard rendering; full = standard rendering with extended wait for dynamic content

Value in"none" | "basic" | "full"
forceRefreshbooleandefault:false

Bypass cache and force a fresh fetch of the page (default: false)

formatsany[]

Output formats. Strings select simple formats; objects parameterise LLM formats (summary, question, highlights).

Example:
[
  "markdown",
  "links",
  "images"
]
includestring[]

Optional fields to include in the response. Available values: metadata (title, description, language, etc.), html (original HTML), links (extracted links). Replaces includeHtml and extractLinks.

Example:
[
  "metadata",
  "links"
]
includeHtmlbooleandefault:false

Whether to include the original HTML in the response (default: false). Consider using the include parameter instead.

extractLinksbooleandefault:false

Whether to extract links from the page (default: false). Consider using the include parameter instead.

Response

application/json

Success response

successboolean
Example:
true
dataobject
Show child attributes
urlstring

The URL that was distilled

Example:https://thunderbit.com/playground
markdownstring

Clean markdown content extracted from the page

Example:# 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)

Show child attributes
titlestring

Page title extracted from tag or Open Graph

Example:Understanding Web Distillation | Tech Blog
descriptionstring

Meta description or excerpt

languagestring

Detected language code (ISO 639-1)

Example:en
sourceUrlstring

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

statusCodeinteger

HTTP status code of the response

Example:
200
htmlstring

Raw HTML content (optional, only if requested)

Example:
null
linksobject[]

Links found in the content

Show child attributes
textstring

Visible link text as rendered in the page

Example:Read more
hrefstring

Resolved absolute URL of the link

Example:https://example.com/article
imagesobject[]

Images extracted from the page.

Show child attributes
srcstring

Image source URL.

Example:https://example.com/hero.png
altstring

Image alt text.

Example:Hero banner
widthinteger

Image width in pixels.

heightinteger

Image height in pixels.

summarystring

Structured Markdown summary (LLM format).

answerstring

Answer to the question supplied in the question format.

highlightsstring[]

Highlighted passages surfaced by the highlights format.

errorobject
Example:
null