Logo of LexmountLexmount Docs
Logo of LexmountLexmount Docs
Homepage

Introduction

Documentation Overview
WebFetch APIQuick Start
All-in-One ExtractDump DOMCommon Errors
X (Twitter)
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-Key and X-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

FieldTypeRequiredDescription
urlstringYesTarget page URL
options.engine_preferencestringNoPreferred engine, default auto
options.timeout_msintNoRequest timeout
options.filter_scripts_stylesboolNoRemove script and style before returning and saving the dump

Supported engine_preference values:

  • auto
  • http
  • chrome
  • chrome_cdp
  • lightmount_lite
  • lightmount_dcl
  • lightmount_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_id
  • url
  • final_url
  • status_code
  • fetched_at
  • engine
  • dom_id
  • html
  • debug

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.

All-in-One Extract

Full request and response reference for POST /v1/extract.

Common Errors

Common HTTP and API failure cases when integrating with WebFetch.

Table of Contents

Authentication
Request Body
Fields
Basic Example
Response Fields
Filter script / style
Reuse dom_id