EasyLink EasyDoc Parse
Overview
Use this skill to call EasyDoc async parsing APIs and return stable structured output.
Always follow the same lifecycle: select platform, validate inputs, submit task, poll result, normalize output.
RAG Retrieval
If the parsed output is being used for RAG, do not load the entire JSON file into context by default.
- Use grep-style search first
- If the host agent provides a text-search tool such as
Grep, Search, or equivalent "search within file content" capability, use that tool first.
- Prefer grep-style search to locate candidate passages, headings, node ids, table markers, or metadata fields inside parsed JSON.
- Search for user query terms, entity names, date ranges, section headers, and node
type values before opening any large file.
- Do not introduce a custom in-skill Python search script for this retrieval path.
- Do not shell out to
grep or rg if the host agent already exposes an equivalent search tool.
- Read only local slices
- After the search tool identifies relevant hits, read only the matching lines or a narrow surrounding window.
- Extract only the needed nodes, sections, or pages for downstream summarization or embedding.
- Escalate to full-load only when necessary
- Load the full JSON only when the task truly requires global document structure, full-tree reconstruction, or complete export.
- If full-load is required, say why.
Onboarding
If user has no API key, guide first:
cn platform key flow
- Open
https://platform.easylink-ai.com
- Register or sign in
- Enter API key management page and create a key
- Store as
EASYLINK_API_KEY
global platform key flow
- Open
https://platform.easydoc.sh
- Register or sign in
- Enter API key management page and create a key
- Store as
EASYDOC_API_KEY
When user does not specify platform, ask whether they want cn or global first.
Platform Selection
Choose platform before calling any endpoint:
cn platform
- Base URL:
https://api.easylink-ai.com
- Submit:
POST /v1/easydoc/parse
- Poll:
GET /v1/easydoc/parse/{task_id}
- File form field:
files
- Recommended modes:
easydoc-parse-flash, easydoc-parse-premium
global platform
- Base URL:
https://api.easydoc.sh
- Submit:
POST /api/v1/parse
- Poll:
GET /api/v1/parse/{task_id}/result
- File form field:
file
- Recommended mode:
lite
Workflow
- Validate request inputs
- Require
api-key from user input or secure environment variable.
- Require parse mode when needed; if omitted in script mode, use platform default (
cn: easydoc-parse-premium, global: lite).
- Validate file type and size (
<= 100MB) using platform-specific extension list.
- If key is missing, return platform-specific onboarding steps and expected env var name.
- Submit async parse task
- Use platform-specific submit URL and form-data file field.
- Include
mode.
- Read
task_id from response.
- Poll task status
- Use platform-specific result endpoint.
- Continue polling while task is pending or processing.
- Stop on terminal status (
SUCCESS, ERROR, FAILED, COMPLETED, DONE) or timeout.
- Normalize output
- Keep raw response as
raw.
- Return stable envelope for downstream consumers:
task_id, status, files.
- Handle failures predictably
- Include
task_id in error reports when available.
- Report HTTP status and response body for API errors.
- For parse failures, suggest mode switch or resubmission.
- Apply RAG-safe retrieval
- When parsed JSON is large, use the host agent's text-search tool or equivalent grep-style retrieval before any full read.
- Avoid pasting or loading entire parsed payloads into context unless the task depends on full-document traversal.
Quick Commands
China platform:
curl -X POST "https://api.easylink-ai.com/v1/easydoc/parse" \
-H "api-key: $EASYLINK_API_KEY" \
-F "files=@document.pdf" \
-F "mode=easydoc-parse-premium"
Global platform:
curl -X POST "https://api.easydoc.sh/api/v1/parse" \
-H "api-key: $EASYDOC_API_KEY" \
-F "file=@demo_document.pdf" \
-F "mode=lite"
Bundled Python helper:
python3 scripts/easydoc_parse.py --platform cn --api-key "$EASYLINK_API_KEY" \
--mode easydoc-parse-premium --file ./document.pdf --save ./result-cn.json
python3 scripts/easydoc_parse.py --platform global --api-key "$EASYDOC_API_KEY" \
--mode lite --file ./document.pdf --save ./result-global.json
# key can come from environment if --api-key is omitted
export EASYLINK_API_KEY="your-cn-key"
python3 scripts/easydoc_parse.py --platform cn --file ./document.pdf --save ./result-cn.json
export EASYDOC_API_KEY="your-global-key"
python3 scripts/easydoc_parse.py --platform global --file ./document.pdf --save ./result-global.json
References And Scripts
- Read
references/easydoc-rest-api.md for endpoint-level differences between cn and global.
- Use
scripts/easydoc_parse.py for deterministic submit and polling.
- Script default output is
normalized; use --output-format raw for raw payload only.
- In RAG workflows, prefer the host agent's built-in content search tool on saved JSON results before opening large file sections.
Output Contract
{
"task_id": "string",
"status": "SUCCESS|ERROR|PENDING|PROCESSING|FAILED|COMPLETED|DONE",
"files": [
{
"file_name": "string",
"markdown": "string or null",
"nodes": []
}
],
"raw": {}
}
1---2name: easylink-easydoc-parse3description: Use when tasks need EasyDoc REST API to convert unstructured documents into structured JSON or markdown on either China EasyLink platform or global EasyDoc platform. Trigger for requests about POST /v1/easydoc/parse and GET /v1/easydoc/parse/{task_id} (cn), POST /api/v1/parse and GET /api/v1/parse/{task_id}/result (global), selecting parse mode (cn: easydoc-parse-flash or easydoc-parse-premium, global: lite), normalizing parse output for LLM pipelines, and handling RAG retrieval against parsed JSON by using the host agent's text-search tool before any full-file loading.4---56# EasyLink EasyDoc Parse78## Overview910Use this skill to call EasyDoc async parsing APIs and return stable structured output.11Always follow the same lifecycle: select platform, validate inputs, submit task, poll result, normalize output.1213## RAG Retrieval1415If the parsed output is being used for RAG, do not load the entire JSON file into context by default.16171. Use grep-style search first18- If the host agent provides a text-search tool such as `Grep`, `Search`, or equivalent "search within file content" capability, use that tool first.19- Prefer grep-style search to locate candidate passages, headings, node ids, table markers, or metadata fields inside parsed JSON.20- Search for user query terms, entity names, date ranges, section headers, and node `type` values before opening any large file.21- Do not introduce a custom in-skill Python search script for this retrieval path.22- Do not shell out to `grep` or `rg` if the host agent already exposes an equivalent search tool.23242. Read only local slices25- After the search tool identifies relevant hits, read only the matching lines or a narrow surrounding window.26- Extract only the needed nodes, sections, or pages for downstream summarization or embedding.27283. Escalate to full-load only when necessary29- Load the full JSON only when the task truly requires global document structure, full-tree reconstruction, or complete export.30- If full-load is required, say why.3132## Onboarding3334If user has no API key, guide first:35361. `cn` platform key flow37- Open `https://platform.easylink-ai.com`38- Register or sign in39- Enter API key management page and create a key40- Store as `EASYLINK_API_KEY`41422. `global` platform key flow43- Open `https://platform.easydoc.sh`44- Register or sign in45- Enter API key management page and create a key46- Store as `EASYDOC_API_KEY`4748When user does not specify platform, ask whether they want `cn` or `global` first.4950## Platform Selection5152Choose platform before calling any endpoint:53541. `cn` platform55- Base URL: `https://api.easylink-ai.com`56- Submit: `POST /v1/easydoc/parse`57- Poll: `GET /v1/easydoc/parse/{task_id}`58- File form field: `files`59- Recommended modes: `easydoc-parse-flash`, `easydoc-parse-premium`60612. `global` platform62- Base URL: `https://api.easydoc.sh`63- Submit: `POST /api/v1/parse`64- Poll: `GET /api/v1/parse/{task_id}/result`65- File form field: `file`66- Recommended mode: `lite`6768## Workflow69701. Validate request inputs71- Require `api-key` from user input or secure environment variable.72- Require parse mode when needed; if omitted in script mode, use platform default (`cn`: `easydoc-parse-premium`, `global`: `lite`).73- Validate file type and size (`<= 100MB`) using platform-specific extension list.74- If key is missing, return platform-specific onboarding steps and expected env var name.75762. Submit async parse task77- Use platform-specific submit URL and form-data file field.78- Include `mode`.79- Read `task_id` from response.80813. Poll task status82- Use platform-specific result endpoint.83- Continue polling while task is pending or processing.84- Stop on terminal status (`SUCCESS`, `ERROR`, `FAILED`, `COMPLETED`, `DONE`) or timeout.85864. Normalize output87- Keep raw response as `raw`.88- Return stable envelope for downstream consumers: `task_id`, `status`, `files`.89905. Handle failures predictably91- Include `task_id` in error reports when available.92- Report HTTP status and response body for API errors.93- For parse failures, suggest mode switch or resubmission.94956. Apply RAG-safe retrieval96- When parsed JSON is large, use the host agent's text-search tool or equivalent grep-style retrieval before any full read.97- Avoid pasting or loading entire parsed payloads into context unless the task depends on full-document traversal.9899## Quick Commands100101China platform:102103```bash104curl -X POST "https://api.easylink-ai.com/v1/easydoc/parse" \105 -H "api-key: $EASYLINK_API_KEY" \106 -F "files=@document.pdf" \107 -F "mode=easydoc-parse-premium"108```109110Global platform:111112```bash113curl -X POST "https://api.easydoc.sh/api/v1/parse" \114 -H "api-key: $EASYDOC_API_KEY" \115 -F "file=@demo_document.pdf" \116 -F "mode=lite"117```118119Bundled Python helper:120121```bash122python3 scripts/easydoc_parse.py --platform cn --api-key "$EASYLINK_API_KEY" \123 --mode easydoc-parse-premium --file ./document.pdf --save ./result-cn.json124125python3 scripts/easydoc_parse.py --platform global --api-key "$EASYDOC_API_KEY" \126 --mode lite --file ./document.pdf --save ./result-global.json127128# key can come from environment if --api-key is omitted129export EASYLINK_API_KEY="your-cn-key"130python3 scripts/easydoc_parse.py --platform cn --file ./document.pdf --save ./result-cn.json131132export EASYDOC_API_KEY="your-global-key"133python3 scripts/easydoc_parse.py --platform global --file ./document.pdf --save ./result-global.json134```135136## References And Scripts137138- Read `references/easydoc-rest-api.md` for endpoint-level differences between cn and global.139- Use `scripts/easydoc_parse.py` for deterministic submit and polling.140- Script default output is `normalized`; use `--output-format raw` for raw payload only.141- In RAG workflows, prefer the host agent's built-in content search tool on saved JSON results before opening large file sections.142143## Output Contract144145```json146{147 "task_id": "string",148 "status": "SUCCESS|ERROR|PENDING|PROCESSING|FAILED|COMPLETED|DONE",149 "files": [150 {151 "file_name": "string",152 "markdown": "string or null",153 "nodes": []154 }155 ],156 "raw": {}157}158```