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.

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>

Configuration options

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

  • Waiting for things: Wait for events, functions, selectors, or timeouts before returning content
  • Navigation options: Customize navigation behavior with gotoOptions
  • Rejecting undesired requests: Block resources with rejectResourceTypes and rejectRequestPattern
  • Continue on error: Use bestAttempt to continue when async events fail or time out

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
Use /unblock for higher success rates

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 (&proxy=residential).

curl --request POST \
--url 'https://production-sfo.browserless.io/unblock?token=YOUR_API_TOKEN_HERE&proxy=residential' \
--header 'Content-Type: application/json' \
--data '{
"url": "https://example.com/",
"content": true
}'

For advanced bot detection bypass and complex automation tasks, use BrowserQL.