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-KeyandX-Project-Id - Create or copy them from API key settings on the current site
- Use
https://api.lexmount.comfor COM projects andhttps://api.lexmount.cnfor 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:
titledescriptionmain_textfinal_urlauthorpublish_timelinksimagesenginedom_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_domin the response, see Return Raw DOM
Next
- See All-in-One Extract for the full
/v1/extractrequest and response shape - See Dump DOM for
/v1/dom/dumpoptions 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-leveloptionsinstead. - Check HTTP status first, then handle an
errorobject, anerrorstring, or amessage. 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.
