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
| Format | Content-Type | Use Case |
|---|---|---|
html | text/html | Browser viewing, embedding, sharing |
pdf | application/pdf | Download, print, archive |
markdown | text/markdown | Raw 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.pdfThe 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.mdReturns the raw markdown report as generated by the synthesis model. This is the most portable format for further processing.
Parameters
| Parameter | Type | Default | Options |
|---|---|---|---|
format | string | "html" | html, pdf, markdown |
theme | string | "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.pdfwhat-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