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

All-in-One Extract

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

POST /v1/extract

Use this endpoint when you want a single request to fetch a page and return structured output.

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

{
  "extract": {
    "url": "https://example.com"
  }
}

Fields

FieldTypeRequiredDescription
extractobjectYesMain extraction request
extract.urlstringNoTarget page URL
extract.dom_idstringNoExisting DOM snapshot ID
trace.include_stepsboolNoReturn workflow steps when set to true
trace.include_raw_domboolNoReturn raw DOM when set to true

Rules:

  • At least one of extract.url or extract.dom_id is required
  • Set trace.include_steps=true when you need workflow diagnostics

Minimal Example

API_KEY='<your-api-key>'
PROJECT_ID='<your-project-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":{"url":"https://mp.weixin.qq.com/s/H8Nnk6HEKlwDREmxdjsXSg"}}'

Response Shape

Top-level response fields:

FieldDescription
request_idRequest correlation ID. Also returned in the X-Request-ID response header
resultStructured extraction result on success
metadataExtra metadata such as dom_id and server_elapsed_ms
errorError object on failure
traceWorkflow trace steps; returned only when include_steps=true
raw_domRaw DOM content; returned only when include_raw_dom=true

Use request_id when you need to report a problem or correlate a client-side response with server-side request logs.

Common fields inside result:

  • url
  • final_url
  • status_code
  • title
  • description
  • main_text
  • publish_time
  • author
  • language
  • links
  • images
  • engine
  • dom_id

Reuse an Existing 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": "123"
    }
  }'

Enable Trace

By default, POST /v1/extract does not return trace.

To inspect workflow diagnostics, explicitly enable it:

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": {
      "url": "https://example.com"
    },
    "trace": {
      "include_steps": true
    }
  }'

Return Raw DOM

By default, raw_dom is not returned.

Enable it only when you actually need the captured DOM in the response:

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": {
      "url": "https://example.com"
    },
    "trace": {
      "include_raw_dom": true
    }
  }'
  • raw_dom can be very large and is not recommended for normal production calls

Debug Mode

Turn on both debug fields only when you need to inspect the workflow and the captured page:

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": {
      "url": "https://example.com"
    },
    "trace": {
      "include_steps": true,
      "include_raw_dom": true
    }
  }'
  • trace makes responses larger
  • raw_dom can be very large and is not recommended for normal production calls

For common failures, see Common Errors.

Quick Start

Send your first WebFetch request and understand the default response behavior.

Dump DOM

Capture HTML, inspect rendered output, and reuse DOM snapshots.

Table of Contents

Authentication
Request Body
Fields
Minimal Example
Response Shape
Reuse an Existing dom_id
Enable Trace
Return Raw DOM
Debug Mode