> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zenrows.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> The Zenrows HTTP API serves Fetch and Extract (extract=auto) at https://api.zenrows.com/v1/, Crawl at https://api.zenrows.com/v1/crawls, and Batch at https://async.api.zenrows.com/v1. Fetch, Extract, Crawl and Batch are described in OpenAPI 3.1 at https://www.zenrows.com/openapi.json and listed in the RFC 9727 API catalog at https://www.zenrows.com/.well-known/api-catalog. Every endpoint also has its own page under /api-reference with its schema. Use the spec for exact parameter names and types. Crawl's endpoints, parameters and errors are also at https://docs.zenrows.com/crawl/endpoints.md. To call Zenrows from an agent, connect the MCP server at https://mcp.zenrows.com/mcp. To search these docs from an agent, connect the docs MCP server at https://docs.zenrows.com/mcp. Agent skills for Zenrows are published at https://github.com/ZenRows/cli and install with `npx skills add ZenRows/cli`.

# Markdown Response

> Get scraped page content returned as clean Markdown instead of raw HTML using the `response_type=markdown` parameter.

The `response_type=markdown` parameter tells Zenrows to convert the scraped page's HTML into clean Markdown before returning the response. Instead of receiving raw HTML that you need to parse yourself, you get structured, readable content that's ready to process or display.

This is particularly useful for AI pipelines, content extraction workflows, and any use case where you need human-readable text with preserved structure (headings, lists, links, tables) without the noise of HTML tags.

> [!WARNING]
>
> `response_type=markdown` cannot be combined with the `outputs` parameter. Use one or the other depending on whether you need structured data extraction or a full Markdown conversion of the page.

## How it works

Zenrows fetches the target page, renders it if needed, and converts the resulting HTML into Markdown. The conversion preserves the semantic structure of the page: headings map to `#` through `######`, lists remain as `-` items, links keep their text and URL, and tables are converted to Markdown table syntax.

For example, given the following HTML:

```html HTML theme={"theme":"css-variables"}
<h1>Product Title</h1>
<p>This is a great product that does many things.</p>
<ul>
    <li>Feature 1</li>
    <li>Feature 2</li>
    <li>Feature 3</li>
</ul>
```

The Markdown response returns:

```markdown Markdown theme={"theme":"css-variables"}
# Product Title

This is a great product that does many things.

- Feature 1
- Feature 2
- Feature 3
```

## Basic Usage

Add `response_type=markdown` to your request parameters:

```python Python theme={"theme":"css-variables"}
import requests

url = "https://www.scrapingcourse.com/ecommerce/"
apikey = "YOUR_ZENROWS_API_KEY"

params = {
    "url": url,
    "apikey": apikey,
    "response_type": "markdown",
}

response = requests.get("https://api.zenrows.com/v1/", params=params)
print(response.text)
```

```javascript Node.js theme={"theme":"css-variables"}
import axios from "axios";

const url = "https://www.scrapingcourse.com/ecommerce/";
const apikey = "YOUR_ZENROWS_API_KEY";

const response = await axios.get("https://api.zenrows.com/v1/", {
params: {
    url,
    apikey,
    response_type: "markdown",
},
});

console.log(response.data);
```

```java Java theme={"theme":"css-variables"}
import org.apache.hc.client5.http.fluent.Request;

public class APIRequest {
    public static void main(final String... args) throws Exception {
        String apiUrl = "https://api.zenrows.com/v1/?apikey=YOUR_ZENROWS_API_KEY&url=https%3A%2F%2Fwww.scrapingcourse.com%2Fecommerce%2F&response_type=markdown";
        String response = Request.get(apiUrl)
                .execute().returnContent().asString();
        System.out.println(response);
    }
}
```

```php PHP theme={"theme":"css-variables"}
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.zenrows.com/v1/?apikey=YOUR_ZENROWS_API_KEY&url=https%3A%2F%2Fwww.scrapingcourse.com%2Fecommerce%2F&response_type=markdown");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
echo $response . PHP_EOL;
curl_close($ch);
?>
```

```go Go theme={"theme":"css-variables"}
package main

import (
    "io"
    "log"
    "net/http"
)

func main() {
    client := &http.Client{}
    req, err := http.NewRequest("GET", "https://api.zenrows.com/v1/?apikey=YOUR_ZENROWS_API_KEY&url=https%3A%2F%2Fwww.scrapingcourse.com%2Fecommerce%2F&response_type=markdown", nil)
    if err != nil {
        log.Fatalln(err)
    }

    resp, err := client.Do(req)
    if err != nil {
        log.Fatalln(err)
    }
    defer resp.Body.Close()

    body, err := io.ReadAll(resp.Body)
    if err != nil {
        log.Fatalln(err)
    }

    log.Println(string(body))
}
```

```ruby Ruby theme={"theme":"css-variables"}
require "faraday"

url = URI.parse("https://api.zenrows.com/v1/?apikey=YOUR_ZENROWS_API_KEY&url=https%3A%2F%2Fwww.scrapingcourse.com%2Fecommerce%2F&response_type=markdown")
conn = Faraday.new()
conn.options.timeout = 180
res = conn.get(url, nil, nil)
print(res.body)
```

```bash cURL theme={"theme":"css-variables"}
curl "https://api.zenrows.com/v1/?apikey=YOUR_ZENROWS_API_KEY&url=https%3A%2F%2Fwww.scrapingcourse.com%2Fecommerce%2F&response_type=markdown"
```

## When to use Markdown response

The Markdown response is the right choice when you need the full text content of a page with its structure preserved, but don't want to parse HTML yourself. It works well for:

* **AI and LLM pipelines**: feed scraped content directly into language models without pre-processing. Markdown is cleaner and more token-efficient than raw HTML.
* **Content extraction and archiving**: capture articles, documentation pages, or product descriptions in a portable, readable format.
* **Knowledge base ingestion**: convert web pages into Markdown for ingestion into vector databases, RAG pipelines, or internal wikis.
* **Developer tooling**: use Markdown output to power documentation crawlers, content diff tools, or search indexers.

> [!NOTE]
>
> If you only need specific data types from a page (like emails, links, or tables), use the `outputs` parameter instead. Markdown response converts the entire page, which may include content you don't need.

## Best practices

**Enable `js_render` for dynamic pages:** \

If the page loads content via JavaScript, combine `response_type=markdown` with `js_render=true`. Without it, the Markdown output will only reflect the initial HTML and may be missing key content.

**Use `wait` or `wait_for` when content loads after a delay:** \

For pages where content appears after a delay or user interaction, add `wait` (milliseconds) or `wait_for` (CSS selector) to ensure the full content is present before conversion.

> [!TIP]
>
> Find more details on our [Wait Documentation](https://docs.zenrows.com/fetch/features/wait.md) or [Wait For Selector Documentation](https://docs.zenrows.com/fetch/features/wait-for.md).

**Expect navigation and boilerplate in the output:** \

The Markdown response converts the full page, including headers, footers, navigation menus, and sidebars. If you need only the main body content, consider post-processing the Markdown to strip boilerplate, or evaluate whether `css_extractor` with a targeted selector better fits your use case.

> [!TIP]
>
> Find more details on our [CSS Extractor Documentation](https://docs.zenrows.com/fetch/features/css-extractor.md).

**Credits are charged on successful responses:** \

A request using `response_type=markdown` is charged when the API returns a `200` status code, regardless of whether the Markdown output contains the content you expected. Test on a small set of URLs before running at scale.

## Troubleshooting

> [accordion] The Markdown output is missing most of the page content
>
> The page likely renders its content via JavaScript. Add `js_render=true` to your request to ensure Zenrows renders the page fully before converting it. If content still appears incomplete, combine with `wait_for` targeting a CSS selector that's only present once the main content has loaded.

> [accordion] The output includes a lot of navigation, ads, or boilerplate
>
> The Markdown response converts the full HTML of the page, not just the main body. This is expected behavior. To target only a specific section of the page, use `css_extractor` with a selector pointing to the main content container (for example, `article` or `main`) instead of using `response_type=markdown`.

> [accordion] Tables are not converting correctly
>
> Markdown table conversion works on standard HTML `table` elements. If the site uses `div`-based layouts to simulate tables, they won't convert cleanly. In that case, use the `outputs=tables` filter or `css_extractor` to target the relevant elements directly.

> [accordion] I'm getting an error when combining response\_type=markdown with outputs
>
> These two parameters are mutually exclusive. `response_type=markdown` converts the entire page to Markdown, while `outputs` performs targeted data extraction. You can only use one per request. Choose `outputs` when you need specific data types, and `response_type=markdown` when you need the full page content as structured text.

## Pricing

The `response_type=markdown` parameter is included at **no additional cost** with all Zenrows requests. You only pay extra for JavaScript Render and Premium Proxy when used.

> [!TIP]
>
> You can monitor your Zenrows usage in multiple ways to stay informed about your account activity and prevent unexpected overages.
>
> **Dashboard monitoring**: View real-time usage statistics, remaining requests, success rates, and request history on your Analytics page. You can also set up usage alerts in your notification settings to receive notifications when you approach your limits.
>
> [Open Analytics](https://app.zenrows.com/overview#performance)
> [Open notification settings](https://app.zenrows.com/settings/notifications)
>
> **Programmatic monitoring**: For automated monitoring in your applications, call the `/v1/subscriptions/self/details` endpoint with your API key in the `X-API-Key` header. This returns real-time usage data that you can integrate into your monitoring systems. [Learn more about the usage endpoint](https://docs.zenrows.com/fetch/features/other.md#plan-usage).
>
> **Response header monitoring**: Track your concurrency usage through response headers included with each request:
>
> * `Concurrency-Limit`: Your maximum concurrent requests
> * `Concurrency-Remaining`: Available concurrent request slots
> * `X-Request-Cost`: Cost of the current request
> * `X-Key-Credits-Remaining`: Lowest remaining credits across your API key's [credit caps](https://docs.zenrows.com/first-steps/api-key-credit-caps.md), sent only for keys with at least one cap

## FAQ (Frequently Asked Questions)

> [accordion] Does response\_type=markdown work with js\_render?
>
> Yes, you can combine `response_type=markdown` with `js_render=true` to render JavaScript before the conversion. This is recommended for any page that loads content dynamically.

> [accordion] Does it cost more credits to use response\_type=markdown?
>
> No, the `response_type=markdown` parameter does not add extra credit cost on its own. Credits are calculated based on the other parameters you use, such as `js_render` or `premium_proxy`, exactly as they would be for a standard request.

> [accordion] Can I use response\_type=markdown with the Zenrows Browser?
>
> No, `response_type=markdown` is a parameter of Fetch. It is not available in Zenrows Browser (CDP/Playwright) sessions. In a Zenrows Browser session, you control the page directly and can extract and convert content using your own script logic.

> [accordion] What Markdown flavor does the conversion follow?
>
> Zenrows converts to standard CommonMark-compatible Markdown. Most elements (headings, lists, bold, italic, links, code blocks, tables) are supported. Custom HTML components, embedded scripts, and non-semantic markup are stripped from the output.

> [accordion] Can I use response\_type=markdown to feed content into an LLM?
>
> Yes, and this is one of the most common use cases. Markdown is significantly more compact and cleaner than raw HTML, which reduces token usage and improves the quality of LLM outputs. Zenrows strips tags, scripts, and boilerplate during conversion, leaving structured prose that models can process directly.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.