> For the complete documentation index, see [llms.txt](/llms.txt)

# 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](/open-api/chrome-content) for complete details.

- A Browserless API token from your [account dashboard](https://browserless.io/account/)

## Quickstart

  
**cURL:**

```sh
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/"
}'
```
  
  
**JavaScript:**

```js
const TOKEN = "YOUR_API_TOKEN_HERE";
const url = `https://production-sfo.browserless.io/content?token=${TOKEN}`;
const headers = {
    "Cache-Control": "no-cache",
    "Content-Type": "application/json"
};
const data = {
    url: "https://example.com/"
};

const fetchContent = async () => {
    const response = await fetch(url, {
        method: 'POST',
        headers: headers,
        body: JSON.stringify(data)
    });

    const content = await response.text();
    console.log(content);
};

fetchContent();
```
  
  
**Python:**

```python
import requests

TOKEN = "YOUR_API_TOKEN_HERE"
url = f"https://production-sfo.browserless.io/content?token={TOKEN}"
headers = {
    "Cache-Control": "no-cache",
    "Content-Type": "application/json"
}
data = {
    "url": "https://example.com/"
}

response = requests.post(url, headers=headers, json=data)
print(response.text)
```
  

**Response**

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

```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>
  
    <h1>Example Domain</h1>
    This domain is for use in documentation examples without needing permission. Avoid use in operations.
    <a href="https://iana.org/domains/example">Learn more</a>
  
</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](/rest-apis/unblock) 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](/rest-apis/proxies).

## Configuration options

The `/content` API supports shared [request configuration options](/rest-apis/request-configuration) that apply across REST endpoints:

- [**Waiting for things**](/rest-apis/request-configuration#waiting-for-things): Wait for [events](/rest-apis/request-configuration#waitforevent), [functions](/rest-apis/request-configuration#waitforfunction), [selectors](/rest-apis/request-configuration#waitforselector), or [timeouts](/rest-apis/request-configuration#waitfortimeout) before returning content
- [**Navigation options**](/rest-apis/request-configuration#navigation-options): Customize navigation behavior with `gotoOptions`
- [**Rejecting undesired requests**](/rest-apis/request-configuration#rejecting-undesired-requests): Block resources with `rejectResourceTypes` and `rejectRequestPattern`
- [**Continue on error**](/rest-apis/request-configuration#continue-on-error): Use `bestAttempt` to continue when async events fail or time out

## FAQ & Troubleshooting

<details>
<summary>Why am I getting a <code>401 Unauthorized</code> error?</summary>

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](https://browserless.io/account/).

</details>

<details>
<summary>My request returns an empty response</summary>

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

</details>

## Next steps

  <a href="/rest-apis/intro" className="next-step-card-link">
    
      <h3 className="next-step-card-title">REST API overview</h3>
      introduction to all available endpoints
    
  </a>
  <a href="/rest-apis/api-playground" className="next-step-card-link">
    
      <h3 className="next-step-card-title">API playground</h3>
      test endpoints interactively
    
  </a>