> ## Documentation Index
> Fetch the complete documentation index at: https://germeytechnology-docs-remove-4o-image-nav.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# WebExtrator Webpage Rendering API Integration Guide

> WebExtrator Web Render & Extract 集成指南 - Ace Data Cloud

`POST https://api.acedata.cloud/webextrator/render`

## Authentication

Add `Authorization: Bearer <your API Key>` in the request header.

## Request Parameters

| Field               | Type      | Required | Default        | Description                                                                                      |
| ------------------- | --------- | :------: | -------------- | ------------------------------------------------------------------------------------------------ |
| `url`               | string    |     ✅    | -              | The URL of the page to render                                                                    |
| `user_agent`        | string    |     ❌    | System default | Custom User-Agent                                                                                |
| `timeout`           | number    |     ❌    | 30000          | Timeout for a single render (milliseconds), max 120000                                           |
| `wait_until`        | string    |     ❌    | `load`         | Load completion event: `load`/`domcontentloaded`/`networkidle`                                   |
| `delay`             | number    |     ❌    | 0              | Additional wait time after load completion (milliseconds), max 30000                             |
| `wait_for_selector` | string    |     ❌    | -              | Wait for the specified CSS selector to appear                                                    |
| `block_resources`   | string\[] |     ❌    | -              | Block resource types: `image`/`media`/`font`/`stylesheet`, etc.                                  |
| `headers`           | object    |     ❌    | -              | Additional HTTP headers                                                                          |
| `cookies`           | array     |     ❌    | -              | List of cookies, elements like `{name, value, domain, path}`                                     |
| `callback_url`      | string    |     ❌    | -              | Callback URL for async mode; if provided, returns task ID immediately, results via POST callback |

## Synchronous Response (without callback\_url)

```json theme={null}
{
  "success": true,
  "task_id": "550e8400-e29b-41d4-a716-446655440000",
  "trace_id": "550e8400-e29b-41d4-a716-446655440001",
  "started_at": "2026-05-02T10:30:00.123Z",
  "finished_at": "2026-05-02T10:30:05.456Z",
  "elapsed": 5.333,
  "data": {
    "kind": "render",
    "url": "https://example.com",
    "title": "Example Domain",
    "html": "<!doctype html>...",
    "text": "Example Domain ...",
    "markdown": "# Example Domain\n...",
    "screenshot": "data:image/png;base64,iVBORw0K...",
    "links": ["https://www.iana.org/domains/example"]
  }
}
```

## Asynchronous Mode (with callback\_url)

Initial response:

```json theme={null}
{
  "success": true,
  "task_id": "550e8400-e29b-41d4-a716-446655440000",
  "trace_id": "550e8400-e29b-41d4-a716-446655440001",
  "started_at": "2026-05-02T10:30:00.123Z"
}
```

The response header will include `x-usage-exempt: true`, indicating this synchronous handshake is free of charge. Once the task is completed, the platform will send a POST request to the `callback_url`. The request body contains the `data` field from the synchronous response plus the same `task_id` / `trace_id` / `started_at` / `finished_at` / `elapsed` fields.

## Error Response

```json theme={null}
{
  "success": false,
  "task_id": "550e8400-e29b-41d4-a716-446655440000",
  "trace_id": "550e8400-e29b-41d4-a716-446655440001",
  "started_at": "2026-05-02T10:30:00.123Z",
  "error": {
    "code": "timeout",
    "message": "page load timed out after 30000ms"
  }
}
```

Error codes: `bad_request` / `forbidden` / `too_many_requests` / `not_found` / `api_error` / `timeout` / `unknown` / `busy`.

## Example

```bash theme={null}
curl -X POST https://api.acedata.cloud/webextrator/render \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com",
    "wait_until": "networkidle",
    "block_resources": ["image", "media", "font"]
  }'
```
