Export

Export research results as PDF, HTML, or Markdown

Research results can be exported in three formats via the /results/\{result_id\}/export endpoint.

Formats

FormatContent-TypeUse Case
htmltext/htmlBrowser viewing, embedding, sharing
pdfapplication/pdfDownload, print, archive
markdowntext/markdownRaw content, further processing

Usage

HTML Export

curl -H "X-API-Key: your-key" \
  "https://api.krawl.sh/results/RESULT_UUID/export?format=html"

Supports a theme parameter for light or dark mode:

# Dark theme
curl -H "X-API-Key: your-key" \
  "https://api.krawl.sh/results/RESULT_UUID/export?format=html&theme=dark"

The HTML export is a self-contained page with:

  • Full markdown-to-HTML rendering
  • Styled headings, tables, lists, code blocks
  • Source list with URLs and source types
  • Research metadata (query, mode, duration)

PDF Export

curl -H "X-API-Key: your-key" \
  "https://api.krawl.sh/results/RESULT_UUID/export?format=pdf" \
  -o report.pdf

The PDF includes:

  • Title and metadata header
  • Full report content with formatting
  • Sources appendix with URLs and source types
  • Generated via fpdf2 with HTML subset rendering
  • Fallback to plain text if HTML rendering fails

Markdown Export

curl -H "X-API-Key: your-key" \
  "https://api.krawl.sh/results/RESULT_UUID/export?format=markdown" \
  -o report.md

Returns the raw markdown report as generated by the synthesis model. This is the most portable format for further processing.

Parameters

ParameterTypeDefaultOptions
formatstring"html"html, pdf, markdown
themestring"light"light, dark (HTML only)

Filenames

Downloaded files use a sanitized version of the research query as the filename:

  • what-is-the-current-state-of-ai-agents.pdf
  • what-is-the-current-state-of-ai-agents.md

HTML exports use Content-Disposition: inline (displayed in browser). PDF and Markdown use Content-Disposition: attachment (downloaded).

Getting a Result ID

Result IDs are returned in the result SSE event during research, and can be retrieved from:

# List all results
curl -H "X-API-Key: your-key" https://api.krawl.sh/results

# Get a specific result
curl -H "X-API-Key: your-key" https://api.krawl.sh/results/RESULT_UUID

On this page