一种通用的文档解析技能,基于来也 ADP(代理文档处理)平台,输出结构化 JSON。ADP 利用大型模型能力...
Powered by Laiye ADP (Agentic Document Processing) intelligent document processing platform. ADP leverages large model capabilities to intelligently parse 10+ document formats including PDF, images, and Office files, outputting results in standard structured JSON format containing key fields and structured data that can be directly integrated with downstream business systems. This Skill invokes the adp parse command from ADP's official CLI tool — a single command completes intelligent document understanding and structured JSON output. A standard 200-page PDF can be parsed in just 30 seconds, dramatically improving document processing efficiency. ADP provides a standard commercial API that can be integrated into business systems within 1 hour.
New users receive 100 free credits per month (refreshed monthly), enabling free processing of approximately 200 pages of documents each month. ADP provides a standard commercial API that can be integrated into business systems within 1 hour.
Register now: Global | Mainland China
adp config get to check credentials. If not configured, prompt the user for their API Key.adp app-id list --app-type 0 to get the list of out-of-the-box applications, find the document parsing application and note its app_id (prefixed with ootb_). For subsequent runs, prefer adp app-id cache.adp parse local <file_path> --app-id <document_parsing_app_id> or adp parse url <URL> --app-id <document_parsing_app_id>.ScenarioDescriptionStructured Document Storage & RetrievalParse PDF, images, and Office documents into structured JSON for import into databases or content management systems, enabling precise retrieval and systematic managementAutomated Data Pipeline ConstructionUse standardized JSON output as unified input for downstream data processing pipelines and ETL workflows, automating document processingDocument Content Auditing & Quality InspectionLeverage structured information such as OCR confidence scores and element positions from parsing results to automate document quality assessment and reviewCross-System Document IntegrationParse documents in multiple formats into a unified JSON structure, enabling seamless document data exchange and integration across different business systems
Format TypeSupported File ExtensionsPDF Documents.pdfImage Files.jpg, .jpeg, .png, .bmp, .tiff, .tifOffice Documents.doc, .docx, .xls, .xlsx
Single File Parsing
User IntentRecommended CommandParse key information from a local PDF/image to JSONadp parse local <file_path> --app-id <document_parsing_app_id>Parse key information from a remote URL document to JSONadp parse url <URL> --app-id <document_parsing_app_id>Parse key information from a Base64-encoded documentadp parse base64 <base64> --app-id <document_parsing_app_id> --file-name <filename.ext>
Batch Parsing
User IntentRecommended CommandBatch parse documents in a local folderadp parse local <folder_path> --app-id <document_parsing_app_id>Batch parse multiple URL documentsadp parse url <url_list_file> --app-id <document_parsing_app_id>
Async Processing
User IntentRecommended CommandAsync submit a large fileadp parse local <file_path> --app-id <document_parsing_app_id> --asyncAsync batch processingadp parse local <folder_path> --app-id <document_parsing_app_id> --asyncQuery async task resultsadp parse query <task_id>
Concurrency limit: Free users support up to 2 concurrent document processing; paid users support up to 10
bash
# Method 1: npm (Recommended, cross-platform)
npm install -g @laiye-adp/agentic-doc-parse-and-extract-cli
bash
# Method 2: Shell script (Linux / macOS, when npm is not available)
curl -fsSL https://raw.githubusercontent.com/laiye-ai/adp-cli/main/scripts/adp-init.sh | bash
bash
# Method 3: PowerShell script (Windows, when npm is not available)
irm https://raw.githubusercontent.com/laiye-ai/adp-cli/main/scripts/adp-init.ps1 | iex
Or download pre-compiled binaries from GitHub Releases.
We provide separate public cloud access URLs for international and domestic users. Using the nearest region ensures faster and more stable API calls.
RegionLogin URLAPI Base URLInternationalhttps://adp-global.laiye.com/https://adp-global.laiye.com/Mainland Chinahttps://adp.laiye.com/https://adp.laiye.com/
New users need to register for an ADP account first. Upon registration, you'll receive 100 free credits per month.
API_Key entry.bash
adp config set --api-key <your-api-key>
adp config set --api-base-url https://adp-global.laiye.com
bash
adp config get
Notes:
ADP provides out-of-the-box built-in parsing applications for various document types — no additional configuration required.
ADP applications are divided into two types, distinguished by the app_type field:
app_typeTypeDescription0Out-of-the-box (OOTB)Platform built-in, app_id prefixed with ootb_, ready to use without creation1Custom ApplicationUser-created parsing applications with custom app_id
bash
# Query only out-of-the-box applications (Recommended)
adp app-id list --app-type 0
# Or query all applications
adp app-id list
Find the application with app_label containing "Document Parsing" in the returned list, and note its app_id:
json
[
{
"app_id": "ootb_*********y2b4",
"app_label": ["Document Parsing", "Image Extraction", "OCR", "Structured Parsing", "Batch Parsing"],
"app_name": "Document Parse",
"app_type": 0
}
]
In the example above,
"app_id": "ootb_******y2b4"is the document parsing application.app_typeof0indicates an out-of-the-box application;1indicates a custom application.
After the first query, prefer using the cache to avoid repeated requests:
bash
# Use cache for subsequent queries
adp app-id cache
Important: Each account's app_id is unique and fixed. Unless the user manually deletes the application, the app_id will not change. It's recommended to save commonly used parsing application app_id in context for direct reuse.
bash
adp parse local ./invoice.pdf --app-id <document_parsing_app_id>
bash
adp parse url https://example.com/invoice.pdf --app-id <document_parsing_app_id>
bash
adp parse base64 <base64_string> --app-id <document_parsing_app_id> --file-name <filename.ext>
ADP document parsing returns unified structured JSON. The system automatically identifies the document type and outputs corresponding key fields. The following example demonstrates a purchase order result:
json
{
"success": true,
"status": 4,
"task_id": "94fe9b74e0e311f091505e345594c618",
"file_url": "",
"doc_recognize_result": [
{
"page_num": 1,
"document_content": "example...",
"document_details": [
{
"type": "Picture",
"text": "http://test-adp.laiye.com/web/agentic_doc_processor/laiye/file/7bc821dee0e311f091505e345594c618",
"position": [
{
"points": [
{
"x": 34,
"y": 26
},
{
"x": 93,
"y": 26
},
{
"x": 93,
"y": 93
},
{
"x": 34,
"y": 93
}
]
}
],
"ocr_confidence": {
"ocr_mean_confidence": 0.9948742372110055,
"ocr_min_confidence": 0.6224551745238371,
"is_overall_confidence": 0
}
},
{
"type": "Title",
"text": "中山市蚂蚁照明光电有限公司\n采购订单",
"position": [
{
"points": [
{
"x": 234,
"y": 28
},
{
"x": 577,
"y": 28
},
{
"x": 577,
"y": 81
},
{
"x": 234,
"y": 81
}
]
}
],
"ocr_confidence": {
"ocr_mean_confidence": 0.9649929892499949,
"ocr_min_confidence": 0.7520648420779353,
"is_overall_confidence": 1
}
},
{
"type": "Text",
"text": "采购单号: P020250304012",
"position": [
{
"points": [
{
"x": 587,
"y": 72
},
{
"x": 770,
"y": 72
},
{
"x": 770,
"y": 89
},
{
"x": 587,
"y": 89
}
]
}
],
"ocr_confidence": {
"ocr_mean_confidence": 0.9999092513136395,
"ocr_min_confidence": 0.9986503483477672,
"is_overall_confidence": 1
}
},
{
"type": "Text",
"text": "example text...",
"position": [
{
"points": [
{
"x": 30,
"y": 109
},
{
"x": 676,
"y": 109
},
{
"x": 676,
"y": 125
},
{
"x": 30,
"y": 125
}
]
}
],
"ocr_confidence": {
"ocr_mean_confidence": 0.9907980751407313,
"ocr_min_confidence": 0.9479157610236068,
"is_overall_confidence": 1
}
},
{
"type": "Table",
"text": "<table><tr><td>订货日期:</td><td>2025-03-04</td><td>订货方:</td><td colspan=\"4\">中山市蚂蚁照明光电有限公司</td></tr><tr><td>供应商名称:</td><td>深圳市唯特偶新材料股份有限公司</td><td>联系人:</td><td colspan=\"4\"></td></tr><tr><td>联系人:</td><td>马国银</td><td>联系电话:</td><td colspan=\"4\">0760-28188088</td></tr><tr><td>电话:</td><td>0755-61813001</td><td>企业传真:</td><td colspan=\"4\">0760-28188089</td></tr><tr><td>传真:</td><td></td><td>企业地址:</td><td colspan=\"4\">中山市横栏镇永兴工业区富庆一路21号2栋</td></tr><tr><td>序号</td><td>物料编号</td><td>物料名称</td><td>规格型号</td><td>单位</td><td>数量</td><td>交货日期</td><td>备注</td></tr><tr><td>1</td><td>C.FL.0003</td><td>有铅锡膏</td><td>GW9068C-6</td><td>克</td><td>100000</td><td>2025-03-04</td><td>50瓶</td></tr><tr><td>2</td><td>C.FL.0001</td><td>锡丝</td><td>YF-12 φ1.1mm 55%</td><td>pcs</td><td>80</td><td>2025-03-04</td><td>80卷</td></tr></table>",
"position": [
{
"points": [
{
"x": 27,
"y": 125
},
{
"x": 772,
"y": 125
},
{
"x": 772,
"y": 393
},
{
"x": 27,
"y": 393
}
]
}
],
"ocr_confidence": {
"ocr_mean_confidence": 0.9989620051858402,
"ocr_min_confidence": 0.8928787142723804,
"is_overall_confidence": 1
}
}
]
}
]
}
Top-Level Fields
FieldTypeDescriptionsuccessbooleanWhether parsing was successfulstatusnumberTask status codetask_idstringUnique task identifierfile_urlstringFile URL (empty for local file parsing)doc_recognize_resultarrayDocument recognition result array, returned per page
Page-Level Fields ( doc_recognize_result[])
FieldTypeDescriptionpage_numnumberPage number (starting from 1)document_contentstringFull text content of the pagedocument_detailsarrayArray of document element details for the page
Element-Level Fields ( document_details[])
FieldTypeDescriptiontypestringElement type: Picture, Title, Text, Table``textstringRecognized text content (tables returned as HTML <table> format, images as URLs)positionarrayElement position coordinates on the pageposition[].pointsarrayPolygon vertex coordinate array (4 {x, y} points)ocr_confidenceobjectOCR confidence informationocr_confidence.ocr_mean_confidencenumberMean confidence (0–1)ocr_confidence.ocr_min_confidencenumberMinimum confidence (0–1)ocr_confidence.is_overall_confidencenumberWhether this is an overall confidence score (0 or 1)
bash
adp parse local ./documents/ --app-id <document_parsing_app_id> --export ./results/
Returns a summary:
json
{
"total": 10,
"success": 9,
"failed": 1,
"output_dir": "/absolute/path/to/results",
"files": [
{"input": "invoice-001.pdf", "output": "invoice-001.pdf.json", "status": "success"},
{"input": "order-002.jpg", "output": "order-002.jpg.json", "status": "success"},
{"input": "damaged.pdf", "output": "damaged.pdf.error.json", "status": "failed", "error": "..."}
]
}
bash
# Phase 1: Submit tasks without waiting for results
adp parse local ./documents/ --app-id <document_parsing_app_id> --async --no-wait --export tasks.json
# Phase 2: Query results
adp parse query --watch --file tasks.json --export ./results/
bash
# Check installation
adp version
# View configuration
adp config get
# Query all application list
adp app-id list
# Query only out-of-the-box applications (app_type=0)
adp app-id list --app-type 0
# Use cached applications
adp app-id cache
# Check credit balance
adp credit
# Parse document to JSON (local file)
adp parse local <file_path> --app-id <document_parsing_app_id>
# Parse document to JSON (URL)
adp parse url <file_url> --app-id <document_parsing_app_id>
# Parse document to JSON (Base64)
adp parse base64 <base64_string> --app-id <document_parsing_app_id> --file-name <filename.ext>
# Batch parsing
adp parse local <folder_path> --app-id <document_parsing_app_id> --export <output_path>
# Async parsing
adp parse local <file_path> --app-id <document_parsing_app_id> --async
# Query async results
adp parse query <task_id>
# Auto-retry on failure (max 2 retries)
adp parse local <file_path> --app-id <document_parsing_app_id> --retry 2
# AI-recommended parsing fields
adp custom-app ai-generate --file <sample_file_path>
When a command fails, stderr outputs structured JSON:
json
{
"type": "AUTH_ERROR",
"message": "Authentication error: invalid API key",
"fix": "Check your API key is correct and has not expired.",
"retryable": false,
"details": {"context": "parse"}
}
Exit CodeMeaning0Success1General error2Argument error3Resource not found4Permission/authentication error5Conflict6Partial failure (some succeeded, some failed in batch processing)
ItemDescriptionDocument parsing cost0.5 credits/pageNew user free quota100 credits per month, reset at the beginning of each monthCheck balanceadp creditTop-upLog in to the ADP portal: International | Mainland China & HK/Macau/Taiwan
PDF/Image to JSON is just one of many out-of-the-box capabilities from Laiye ADP platform. ADP leverages large model capabilities to provide intelligent document processing solutions covering all document categories:
CapabilityDescriptionTypical ScenariosGlobal Invoice/Receipt ExtractionAutomatically identifies and extracts 10+ key fields including invoice number, date, amount, tax, line items; supports multi-language and multi-currency invoicesCross-border settlement automation, expense reimbursement managementDomestic Ticket ExtractionRecognizes 30+ common Chinese tickets including VAT invoices, taxi receipts, train tickets, flight itineraries, fiscal invoices; supports multi-page/multi-ticket recognition and verificationDomestic ticket recognition, invoice verificationOrder ExtractionSupports various purchase order formats; extracts order number, products, quantities, prices, logistics infoProcurement automation, supply chain integrationID Card & Certificate ExtractionADP supports 11 types of commonly used Chinese documents: ID card, HK/Macau/Taiwan travel permit, Chinese passport, bank card, household register, driver's license, vehicle registration, vehicle qualification certificate, bank account permit, business licenseAccount opening review, compliance checks, batch certificate data entryDocument ParsingConverts PDF, images, and Office documents into structured data while preserving layout and hierarchyLong document analysis, contract review, knowledge extractionCustom ExtractionCreate custom extraction applications with dedicated fields and recognition logic for non-standard documentsEnterprise-specific forms, industry-customized documents
All capabilities above can be invoked through the same ADP CLI tool, sharing the ADP API Key and credit system.
For full capabilities, visit:
app_id is unique and fixed per account. It's recommended to save it for direct reuse without querying each time.Copyright © 2026 [Laiye Technology (Beijing) Co., Ltd.] All rights reserved.