Skip to content
AgentSearch

Comparison

Extract vs headless render: when you need each

Use Extract when a page's text is in the HTML the server sends, and use headless Render only when the content appears after JavaScript runs; both cost $0.005 per call, so the usual pattern is Extract first and one Render fallback, which costs $0.01 for a JavaScript page.

Side by side

Web ExtractWeb Render (headless)
Runs JavaScriptNo: converts the HTML it receivesYes: headless Chromium runs the page first
Use it forDocs, blogs, news, most marketing pagesSPAs, dashboards, client-rendered lists, pages that need a screenshot
ReturnsFinal URL, title, markdown or text, up to 100 links, metaFinal URL, status, title, markdown, text, and on request HTML, links and a screenshot
Deadline4 s for the target fetch4.2 s render deadline; partial content can be returned
Price$0.005 per call$0.005 per call

Signs you need Render

Sign 1

Almost no text

Extract returned only a title, or a few hundred characters at most.

Sign 2

"Enable JavaScript"

The text says "enable JavaScript" or "requires JavaScript".

Sign 3

Empty app shell

The page is a single-page app whose body is an empty <div id="root">, or content appears only after the page loads data in the browser.

Start with Extract, and call Render once only when the result is thin. Don't retry Extract on the same URL. Render honors robots.txt (token AgentSearchRender); a refusal is not charged. It never logs in, clicks or submits forms, and reports bot walls instead of bypassing them.

Extract first, Render once

Decide when to fall back (Python, runs as-is)

def needs_render(extract: dict, min_chars: int = 500) -> bool:
    """After an Extract call, decide whether the page needs Render.

    `extract` is the Extract response body (the `data` object from the portal).
    """
    if extract.get("error"):
        return False  # site failed (404, timeout, PDF...): try another URL
    text = (extract.get("markdown") or extract.get("text") or "").strip()
    if len(text) < min_chars:  # only a title or a few hundred characters
        return True
    lowered = text.lower()
    return "enable javascript" in lowered or "requires javascript" in lowered

# Examples
print(needs_render({"error": None, "markdown": "# My App\n\nYou need to enable JavaScript to run this app."}))  # True
print(needs_render({"error": None, "markdown": "# Docs\n\n" + "Real content. " * 100}))  # False

Same request body, different endpoint

// Extract: POST https://agent.pocket.network/v1/agentsearch-web-extract-v1/v1/extract
{"url": "https://example.com/", "formats": ["markdown"], "max_chars": 20000}

// Render: POST https://agent.pocket.network/v1/agentsearch-web-render-v1/v1/render
{"url": "https://example.com/", "formats": ["markdown"], "max_chars": 20000}

From an MCP client, the AgentSearch MCP server exposes both as agentsearch_extract and agentsearch_render (wallet key required). Full Python fallback: read JavaScript pages from an AI agent.

FAQ

What is the difference between Extract and headless Render?

Extract converts the HTML a server sends into markdown without running scripts. Render loads the page in headless Chromium, lets its JavaScript run, then returns markdown, text and optionally HTML and a screenshot.

When do I need a headless browser?

When Extract returns almost no text, says to enable JavaScript, or the page is an empty single-page-app shell. Static pages don't need it.

How much does the Extract-then-Render fallback cost?

$0.005 for a page Extract can read, and $0.01 (two calls) when Render is needed. A robots.txt refusal from Render is not charged.

Can Render read pages behind a login or bot check?

No. It does not sign in, it honors robots.txt, and it reports bot walls as TARGET_BOT_WALL instead of bypassing them.

AgentSearch services

Web Search API · Web Extract API · Web Render API · Pricing · MCP server · Blog