当任务需要使用 EasyLink 提取 API 从文档中抽取结构化字段时使用。触发于 POST /v1/easydoc/extract 和 GET /v1/easy... 的请求。
Use 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}filesModeDescriptionjson_schemaprompt_cuseasydoc-extractUniversal extractionOptional (enables closed extraction)Optional (used when no schema)easydoc-extract-flashUniversal extraction with bounding boxesRequiredNot supportedbl-extractBusiness license (fixed fields)Not supportedNot supportedocc-extractOrg-code certificate (fixed fields)Not supportedNot supported
easydoc-extract has three behaviors based on parameters:
json_schema provided → closed extraction (schema fields only)prompt_cus provided → prompt-driven extractionapi-key from user input or EASYLINK_API_KEY env var.<= 100MB).multipart/form-data with files, mode, and optional json_schema or prompt_cus.task_id from response./v1/easydoc/extract/{task_id} until terminal status.SUCCESS, ERROR, FAILED, COMPLETED, DONEPENDING, PROCESSING, RUNNING, IN_PROGRESS, QUEUEDraw.task_id, status, results.page_number and fields (flat key→value map).task_id in error reports when available.json
{
"type": "object",
"properties": {
"字段名": { "type": "string" }
}
}
Open extraction (auto-detect all fields):
bash
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:
bash
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:
bash
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:
bash
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:
bash
curl -X GET "https://api.easylink-ai.com/v1/easydoc/extract/{task_id}" \
-H "api-key: $EASYLINK_API_KEY"
Bundled Python helper:
bash
# 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.json
{
"task_id": "string",
"status": "SUCCESS|ERROR|PENDING|PROCESSING|FAILED|COMPLETED|DONE",
"results": [
{
"page_number": 1,
"fields": {
"field_name": "value"
}
}
],
"raw": {}
}