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

# Get Content

> Fetch the current page content as HTML, Markdown, or plain text.

## Overview

Returns the content of the session's active page. If `url` is supplied, the session navigates there first. The response format can be raw HTML, cleaned Markdown, or plain text.

## Path Parameters

<ParamField path="id" type="string" required={true}>
  Browser session ID (UUID).
</ParamField>

## Body

<ParamField body="url" type="string">
  Optional URL to navigate to before capturing content. If omitted, captures whatever is currently loaded in the active tab.
</ParamField>

<ParamField body="format" type="string" default="html">
  Output format. One of `html`, `markdown`, `text`.
</ParamField>

<ParamField body="proxyUrl" type="string">
  Optional per-request proxy override.
</ParamField>

<ParamField body="headers" type="object">
  Extra request headers applied when `url` is set.
</ParamField>

## Example Request

<CodeGroup>
  ```bash cURL (current page) theme={null}
  curl -X POST "https://api.scrapengine.io/api/v1/browser/sessions/baa3f390-fa6e-4a24-b84a-a575a5f3a9c7/content" \
    -H "Authorization: Bearer $SCRAPENGINE_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{ "format": "markdown" }'
  ```

  ```bash cURL (navigate first) theme={null}
  curl -X POST "https://api.scrapengine.io/api/v1/browser/sessions/baa3f390-fa6e-4a24-b84a-a575a5f3a9c7/content" \
    -H "Authorization: Bearer $SCRAPENGINE_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "url": "https://example.com",
      "format": "text"
    }'
  ```
</CodeGroup>

## Response

### Success Response (200)

<ResponseField name="url" type="string">
  Effective URL of the captured page (after any redirects).
</ResponseField>

<ResponseField name="content" type="string">
  Page content in the requested format.
</ResponseField>

<ResponseField name="format" type="string">
  Echoed format — one of `html`, `markdown`, `text`.
</ResponseField>

**Example Response:**

```json theme={null}
{
  "url": "https://example.com/",
  "content": "# Example Domain\n\nThis domain is for use in illustrative examples...",
  "format": "markdown"
}
```

### Error Responses

| Status | Description                                         |
| ------ | --------------------------------------------------- |
| `400`  | Invalid body — unknown `format` or malformed `url`. |
| `401`  | Unauthorized — invalid or missing API key.          |
| `404`  | Session not found or not owned by the caller.       |
| `503`  | The browser session is temporarily unreachable.     |
