Install
openclaw skills install @sycamore792/easydoc-extractUse when tasks need EasyLink extraction API to extract structured fields from documents. Trigger for requests about POST /v1/easydoc/extract and GET /v1/easydoc/extract/{task_id}, selecting mode (easydoc-extract, easydoc-extract-flash, bl-extract, occ-extract), customizing extracted fields via json_schema, using custom prompts, and handling async polling until SUCCESS or FAILED.
openclaw skills install @sycamore792/easydoc-extractUse this skill to call the EasyLink async extraction API and return structured field data from documents. Always follow the same lifecycle: validate inputs, submit task, poll result, present extracted fields.
If user has no API key, guide first:
https://platform.easylink-ai.comEASYLINK_API_KEYSingle platform only (CN/EasyLink):
https://api.easylink-ai.comPOST /v1/easydoc/extractGET /v1/easydoc/extract/{task_id}files| Mode | Description | json_schema | prompt_cus |
|---|---|---|---|
easydoc-extract | Universal extraction | Optional (enables closed extraction) | Optional (used when no schema) |
easydoc-extract-flash | Universal extraction with bounding boxes | Required | Not supported |
bl-extract | Business license (fixed fields) | Not supported | Not supported |
occ-extract | Org-code certificate (fixed fields) | Not supported | Not supported |
easydoc-extract has three behaviors based on parameters:
json_schema provided → closed extraction (schema fields only)prompt_cus provided → prompt-driven extractionValidate request inputs
api-key from user input or EASYLINK_API_KEY env var.<= 100MB).Submit async extraction task
multipart/form-data with files, mode, and optional json_schema or prompt_cus.task_id from response.Poll task status
/v1/easydoc/extract/{task_id} until terminal status.SUCCESS, ERROR, FAILED, COMPLETED, DONEPENDING, PROCESSING, RUNNING, IN_PROGRESS, QUEUEDNormalize output
raw.task_id, status, results.page_number and fields (flat key→value map).Handle failures predictably
task_id in error reports when available.{
"type": "object",
"properties": {
"字段名": { "type": "string" }
}
}
Open extraction (auto-detect all fields):
curl -X POST "https://api.easylink-ai.com/v1/easydoc/extract" \
-H "api-key: $EASYLINK_API_KEY" \
-F "files=@doc.pdf" \
-F "mode=easydoc-extract"
Closed extraction with custom fields:
curl -X POST "https://api.easylink-ai.com/v1/easydoc/extract" \
-H "api-key: $EASYLINK_API_KEY" \
-F "files=@doc.pdf" \
-F "mode=easydoc-extract" \
-F 'json_schema={"type":"object","properties":{"姓名":{"type":"string"},"金额":{"type":"string"}}}'
Business license:
curl -X POST "https://api.easylink-ai.com/v1/easydoc/extract" \
-H "api-key: $EASYLINK_API_KEY" \
-F "files=@license.jpg" \
-F "mode=bl-extract"
Org-code certificate:
curl -X POST "https://api.easylink-ai.com/v1/easydoc/extract" \
-H "api-key: $EASYLINK_API_KEY" \
-F "files=@cert.jpg" \
-F "mode=occ-extract"
Poll status:
curl -X GET "https://api.easylink-ai.com/v1/easydoc/extract/{task_id}" \
-H "api-key: $EASYLINK_API_KEY"
Bundled Python helper:
# Open extraction
python3 scripts/easydoc_extract.py --file ./doc.pdf --mode easydoc-extract
# Closed extraction with custom fields
python3 scripts/easydoc_extract.py --file ./doc.pdf --mode easydoc-extract \
--fields "姓名" "日期" "金额" --save ./result.json
# Flash mode (returns bounding boxes, requires --fields)
python3 scripts/easydoc_extract.py --file ./doc.pdf --mode easydoc-extract-flash \
--fields "姓名" "金额"
# Custom prompt
python3 scripts/easydoc_extract.py --file ./doc.pdf --mode easydoc-extract \
--prompt "提取所有金额和日期"
# Business license
python3 scripts/easydoc_extract.py --file ./license.jpg --mode bl-extract
# Org-code certificate
python3 scripts/easydoc_extract.py --file ./cert.jpg --mode occ-extract
# Poll existing task only
python3 scripts/easydoc_extract.py --poll-only --task-id "b_extract_xxx"
references/easydoc-extract-api.md for endpoint details and error codes.scripts/easydoc_extract.py for deterministic submit and polling.normalized; use --output-format raw for raw payload.{
"task_id": "string",
"status": "SUCCESS|ERROR|PENDING|PROCESSING|FAILED|COMPLETED|DONE",
"results": [
{
"page_number": 1,
"fields": {
"field_name": "value"
}
}
],
"raw": {}
}