LogoLexmount Docs
LogoLexmount Docs
Homepage

Introduction

How to UseOpenClaw Integration with LexmountCodex Skill Integration with Lexmount
X (Twitter)

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 X-API-Key
  • Contact an administrator to get your API key

Request Body

{
  "extract": {
    "url": "https://example.com"
  },
  "workflow": {
    "match_timeout_ms": 30000,
    "generate_timeout_ms": 30000,
    "extract_timeout_ms": 30000
  },
  "trace": {
    "include_steps": true,
    "include_raw_dom": false
  }
}

Fields

FieldTypeRequiredDescription
extractobjectYesMain extraction request
extract.urlstringNoTarget page URL
extract.dom_idstringNoExisting DOM snapshot ID
workflow.match_timeout_msintNoTemplate match timeout, default 30000
workflow.generate_timeout_msintNoTemplate generation timeout, default 30000
workflow.extract_timeout_msintNoFinal extract timeout, default 30000
trace.include_stepsboolNoReturn workflow steps, default true
trace.include_raw_domboolNoReturn raw DOM, default false

Rules:

  • At least one of extract.url or extract.dom_id is required
  • Omit workflow unless you need custom timeouts
  • For normal production calls, set trace.include_steps=false and trace.include_raw_dom=false

Minimal Example

API_KEY='<your-api-key>'

curl -sS -X POST https://webfetch.lexmount.com/v1/extract \
  -H 'content-type: application/json' \
  -H "X-API-Key: $API_KEY" \
  -d '{"extract":{"url":"https://mp.weixin.qq.com/s/H8Nnk6HEKlwDREmxdjsXSg"}}'

Response Shape

Top-level response fields:

FieldDescription
resultStructured extraction result on success
metadataExtra metadata such as dom_id, template_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

Common fields inside result:

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

Reuse an Existing dom_id

curl -sS -X POST https://webfetch.lexmount.com/v1/extract \
  -H 'content-type: application/json' \
  -H "X-API-Key: $API_KEY" \
  -d '{
    "extract": {
      "dom_id": "123"
    },
    "trace": {
      "include_steps": false,
      "include_raw_dom": false
    }
  }'

Disable Trace

By default, POST /v1/extract returns trace.

To make the response smaller, explicitly disable it:

curl -sS -X POST https://webfetch.lexmount.com/v1/extract \
  -H 'content-type: application/json' \
  -H "X-API-Key: $API_KEY" \
  -d '{
    "extract": {
      "url": "https://example.com"
    },
    "trace": {
      "include_steps": false
    }
  }'

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://webfetch.lexmount.com/v1/extract \
  -H 'content-type: application/json' \
  -H "X-API-Key: $API_KEY" \
  -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://webfetch.lexmount.com/v1/extract \
  -H 'content-type: application/json' \
  -H "X-API-Key: $API_KEY" \
  -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.

Table of Contents

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