WebFetch APIReference
Dump DOM
Capture HTML, inspect rendered output, and reuse DOM snapshots.
POST /v1/dom/dump
Use this endpoint when you need the captured HTML itself, want to inspect rendering output, or want to reuse a DOM snapshot in a later extraction request.
Authentication
- The API is currently in internal testing
- External requests must include both
X-API-KeyandX-Project-Id - Create or copy them from https://browser.lexmount.cn/settings/api-keys
- For overseas access, use https://browser.lexmount.com/settings/api-keys and replace the endpoint with
https://api.lexmount.com
Request Body
{
"url": "https://example.com",
"options": {
"engine_preference": "lightmount_dcl",
"timeout_ms": 30000,
"filter_scripts_styles": false
}
}Fields
| Field | Type | Required | Description |
|---|---|---|---|
url | string | Yes | Target page URL |
options.engine_preference | string | No | Preferred engine, default auto |
options.timeout_ms | int | No | Request timeout |
options.filter_scripts_styles | bool | No | Remove script and style before returning and saving the dump |
Supported engine_preference values:
autohttpchromechrome_cdplightmount_litelightmount_dcllightmount_domstable
Basic Example
API_KEY='<your-api-key>'
PROJECT_ID='<your-project-id>'
curl -sS -X POST https://api.lexmount.cn/v1/dom/dump \
-H 'Content-Type: application/json' \
-H "X-API-Key: $API_KEY" \
-H "X-Project-Id: $PROJECT_ID" \
-d '{
"url": "https://example.com",
"options": {
"engine_preference": "lightmount_dcl",
"timeout_ms": 30000
}
}' \
| jq '{final_url, engine, dom_id, html_len:(.html|length)}'Response Fields
Common response fields:
request_idurlfinal_urlstatus_codefetched_atenginedom_idhtmldebug
request_id is the request correlation ID. The same value is also returned in the X-Request-ID response header.
Filter script / style
curl -sS -X POST https://api.lexmount.cn/v1/dom/dump \
-H 'Content-Type: application/json' \
-H "X-API-Key: $API_KEY" \
-H "X-Project-Id: $PROJECT_ID" \
-d '{
"url": "https://example.com",
"options": {
"engine_preference": "lightmount_dcl",
"filter_scripts_styles": true
}
}' \
| jq '{dom_id, has_script:(.html|test("<script"; "i")), has_style:(.html|test("<style"; "i"))}'Use this mode when you want a cleaner DOM for inspection or template work. Do not treat it as an exact browser snapshot.
Reuse dom_id
Capture a snapshot first, then pass dom_id into /v1/extract:
DOM_ID="$(curl -sS -X POST https://api.lexmount.cn/v1/dom/dump \
-H 'Content-Type: application/json' \
-H "X-API-Key: $API_KEY" \
-H "X-Project-Id: $PROJECT_ID" \
-d '{"url":"https://example.com","options":{"engine_preference":"lightmount_dcl"}}' \
| jq -r '.dom_id')"
curl -sS -X POST https://api.lexmount.cn/v1/extract \
-H 'Content-Type: application/json' \
-H "X-API-Key: $API_KEY" \
-H "X-Project-Id: $PROJECT_ID" \
-d "{\"extract\":{\"dom_id\":\"$DOM_ID\"}}" \
| jq '{title:.result.title, engine:.result.engine, dom_id:.metadata.dom_id}'For troubleshooting, see Common Errors.
Lexmount Docs