Logo of Lexmount
DocsTemplatesBlogHelp Center
GitHub
Logo of LexmountLexmount Browser

Get started

Lexmount Documentation
Console guide

Browser

Web Fetch

OverviewQuick Start
Common Errors

Web Search

OverviewQuick StartSearch API

Runtime

OverviewQuickstartCapabilitiesExamples

Help and billing

Capability FAQ
ChangelogContact support

Quick Start

Send your first Web Fetch request and understand the default response behavior.

Use Lexmount Web Fetch when you want structured content from a public web page without building your own fetch, rendering, and extraction pipeline.

The most practical starting point is POST /v1/extract.

Authentication

  • External requests must include both X-API-Key and X-Project-Id
  • Create or copy them from API key settings on the current site
  • Use https://api.lexmount.com for COM projects and https://api.lexmount.cn for CN projects; credentials must match the API region

Send Your First Request

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://example.com"
    }
  }'

Typical response:

{
  "request_id": "01964d0f-5f3a-7c3d-8a41-1234567890ab",
  "result": {
    "url": "https://example.com",
    "final_url": "https://example.com",
    "status_code": 200,
    "title": "Example Domain",
    "description": "Example Domain",
    "main_text": "Example Domain This domain is for use in illustrative examples in documents.",
    "engine": "http",
    "dom_id": "123"
  },
  "metadata": {
    "dom_id": "123",
    "server_elapsed_ms": 1234
  }
}

Extraction-service JSON responses include request_id, also returned in X-Request-ID. An earlier gateway rejection may have a different body and no JSON request ID; preserve the HTTP status, response headers, and body when debugging.

What You Get

POST /v1/extract is the all-in-one endpoint. It handles:

  • page fetching
  • template matching
  • generic extraction when no template matches, with background template generation when available
  • final structured extraction

Common fields in result include:

  • title
  • description
  • main_text
  • final_url
  • author
  • publish_time
  • links
  • images
  • engine
  • dom_id

Top-level debugging fields:

  • request_id

When To Use Dump DOM

Use POST /v1/dom/dump when you need the captured HTML itself, want to inspect rendering output, or want to reuse a dom_id in a later extraction request.

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"}' \
  | jq '{final_url, engine, dom_id, html_len:(.html|length)}'

Optional Debug Fields

POST /v1/extract does not return trace or raw_dom by default.

  • If you need workflow diagnostics, see Enable Trace
  • If you need raw_dom in the response, see Return Raw DOM

Next

  • See All-in-One Extract for the full /v1/extract request and response shape
  • See Dump DOM for /v1/dom/dump options and reuse patterns
  • See Common Errors for troubleshooting guidance

Integration Checklist

  • The sample response shows a subset of fields. main_text, author, publication time, links, and images may be absent; HTTP 200 does not guarantee complete body text. Validate the content your application needs.
  • A missing template uses generic extraction when possible. Background template generation does not mean the current request waits for a new template.
  • Engine and User-Agent options belong under extract.options; see the request reference. Dump DOM uses top-level options instead.
  • Check HTTP status first, then handle an error object, an error string, or a message. See Common Errors.
  • Call from your own server. Public-endpoint browser CORS is configured for the Lexmount console; do not embed a project key in a public webpage or depend on arbitrary-origin browser access.

Try in the Playground

Select Extract or Dump DOM, enter a URL, and run the request. Inspect the response or copy the generated cURL command. Reset restores the example URL and request settings. This playground does not select a browser engine.

Open in console

Web Fetch API

Public overview for fetching structured content from public web pages with Lexmount Web Fetch.

All-in-One Extract

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

Table of Contents

Authentication
Send Your First Request
What You Get
When To Use Dump DOM
Optional Debug Fields
Next
Integration Checklist
Try in the Playground

Still need help?