HTML or Markdown Response
By default, ScrAPI returns results wrapped in a JSON envelope that includes metadata (duration, credits used, cookies, headers, etc.). If you only need the raw content, you can set the responseFormat parameter to HTML or Markdown to receive just the page content directly.
- HTML - Returns the full HTML source with
Content-Type: text/html. - Markdown - Returns a clean Markdown conversion of the page content with
Content-Type: text/markdown.
When To Use This
- RAG and LLM pipelines - Markdown is ideal for feeding web content into AI models. It’s clean, token-efficient, and preserves document structure without HTML noise.
- Browser proxying - Use HTML format to proxy ScrAPI responses directly into a browser or iframe.
- Content archival - Save raw HTML or Markdown without having to parse JSON first.
- Simplified integrations - Skip JSON parsing when all you need is the page content.
- AI agent workflows - The MCP Server uses these formats to return content to LLMs.
Response Headers
When using HTML or Markdown format, the metadata normally returned in the JSON body is provided via response headers instead:
| Header | Description |
|---|---|
X-ScrAPI-Duration | Time taken to perform the scrape operation. |
X-ScrAPI-Attempts | Number of retry attempts made. |
X-ScrAPI-CreditsUsed | Credits consumed by this request. |
X-ScrAPI-Cookies | Semi-colon separated cookie key/value pairs from the response. |
X-ScrAPI-Headers | Semi-colon separated header key/value pairs from the response. |
X-ScrAPI-ScreenshotUrl | URL to download the screenshot (if requested). |
X-ScrAPI-PdfUrl | URL to download the PDF (if requested). |
X-ScrAPI-VideoUrl | URL to download the video recording (if requested). |
X-ScrAPI-CaptchasSolved | Captcha types and count of solves. |
X-ScrAPI-ErrorMessages | Errors encountered during scraping or browser command execution. |
Example Request
GET https://api.scrapi.tech/v1/scrape?url=https://deventerprise.com&responseFormat=HTML
POST https://api.scrapi.tech/v1/scrape
HTML Format
{
"url": "https://deventerprise.com",
"responseFormat": "HTML"
}Markdown Format
{
"url": "https://deventerprise.com",
"responseFormat": "Markdown"
}Related Features
- Response Selector - Combine with a CSS or XPath selector to extract only specific content from the HTML or Markdown response.
- MCP Server - The MCP tools return content in HTML or Markdown format for AI consumption.
- Real Browser - Works with all response formats; use a browser when the page requires JavaScript rendering.
Testing
Test this request in the Playground or view the OpenAPI specification.