For AI agents: a documentation index is available at /llms.txt
Skip to main content

Content API

Fetch fully rendered HTML from a real browser, including JavaScript-rendered content. Send a url to navigate, or html to render inline content.

Endpoint

  • Method: POST
  • Path: /content
  • Auth: token query parameter (?token=)
  • Content-Type: application/json
  • Response: text/html

See the OpenAPI reference for complete details.

Prerequisites

Quickstart

curl -X POST \
"https://production-sfo.browserless.io/content?token=YOUR_API_TOKEN_HERE" \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/json' \
-d '{
"url": "https://example.com/"
}'

Response

The API returns the fully rendered HTML content as text/html:

<!DOCTYPE html>
<html lang="en">
<head>
<title>Example Domain</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body{
background:#eee;
width:60vw;
margin:15vh auto;
font-family:system-ui,sans-serif
}
h1{font-size:1.5em}
div{opacity:0.8}
a:link,a:visited{color:#348}
</style>
</head>
<body>
<div>
<h1>Example Domain</h1>
<p>This domain is for use in documentation examples without needing permission. Avoid use in operations.</p>
<p><a href="https://iana.org/domains/example">Learn more</a></p>
</div>
</body>
</html>

Bot detection troubleshooting

If content is empty or incomplete, the site may be blocking automation. Signs include:

  • Empty HTML response or minimal content
  • Partial page content missing key elements
  • Different content compared to a regular browser
  • Blocked requests or access denied messages

The /unblock API is specifically designed to bypass bot detection mechanisms like Datadome and passive CAPTCHAs. It can return HTML content directly when content: true is set and works best with residential proxies.

Configuration options

The /content API supports shared request configuration options that apply across REST endpoints:

FAQ & Troubleshooting

Why am I getting a 401 Unauthorized error?

Your API token is missing or invalid. Include it as a ?token= query parameter or in the Authorization header. Verify the token in your account dashboard.

My request returns an empty response

The page may not have finished loading. Increase waitForTimeout or use waitForSelector to wait for specific content before extracting data.

Next steps