{
"document_type": {
"value": "invoice",
"quote": "Invoice INV/2023/03/0008",
"confidence": 0.9
},
"vendor": {
"name": {
"value": "Global Wholesaler",
"quote": "Global Wholesaler",
"confidence": 0.95
},
"address": {
"value": "Azure Interior 4557 De Silva St Fremont CA 94538 United States",
"quote": "Azure Interior 4557 De Silva St Fremont CA 94538 United States",
"confidence": 0.95
},
"vat_id": {
"value": null,
"quote": null,
"confidence": null
},
"email": {
"value": "[email protected]",
"quote": "[email protected]",
"confidence": 0.95
},
"phone": {
"value": "(870)-931-0505",
"quote": "(870)-931-0505",
"confidence": 0.95
},
"iban": {
"value": "US1234567890",
"quote": "US1234567890",
"confidence": 0.95
}
},
"customer": {
"name": {
"value": "YourCompany",
"quote": "YourCompany, Mitchell Admin",
"confidence": 0.95
},
"address": {
"value": "215 Vine St Scranton PA 18503 United States",
"quote": "215 Vine St Scranton PA 18503 United States",
"confidence": 0.95
},
"vat_id": {
"value": null,
"quote": null,
"confidence": null
}
},
"invoice_number": {
"value": "INV/2023/03/0008",
"quote": "Invoice INV/2023/03/0008",
"confidence": 0.95
},
"order_number": {
"value": "CUSTREF123",
"quote": "Reference:CUSTREF123",
"confidence": 0.95
},
"issue_date": {
"value": "2023-03-20",
"quote": "03/20/2023",
"confidence": 0.9
},
"due_date": {
"value": "2023-04-04",
"quote": "04/04/2023",
"confidence": 0.9
},
"currency": {
"value": "USD",
"quote": "$ 112.00",
"confidence": 0.9
},
"payment_terms": {
"value": "15 Days",
"quote": "Payment terms: 15 Days",
"confidence": 0.95
},
"totals": {
"subtotal": {
"value": 262.9,
"quote": "Subtotal $ 262.90",
"confidence": 0.98
},
"vat_total": {
"value": 16.94,
"quote": "Tax 15% on $ 112.90 $ 16.94",
"confidence": 0.98
},
"total": {
"value": 279.84,
"quote": "Total $ 279.84",
"confidence": 0.98
},
"amount_due": {
"value": null,
"quote": null,
"confidence": null
}
},
"vat_breakdown": [
{
"rate": 15,
"base": 112.9,
"amount": 16.94,
"quote": "$ 16.94",
"confidence": 0.85
}
],
"line_items": [
{
"description": "Beeswax XL",
"quantity": 1,
"unit_price": 42,
"amount": 42,
"vat_rate": 15,
"quote": "[17589684] Beeswax XL Acme beeswax 1.00 kg 42.00 0.00 15.00% $ 42.00",
"confidence": 0.85
},
{
"description": "Office Chair",
"quantity": 1,
"unit_price": 70,
"amount": 70,
"vat_rate": 15,
"quote": "[FURN_7777] Office Chair 1.00 Units 70.00 0.00 15.00% $ 70.00",
"confidence": 0.85
},
{
"description": "Olive Oil",
"quantity": 1,
"unit_price": 1,
"amount": 0.9,
"vat_rate": 15,
"quote": "*987123* Olive Oil 1.00 L 1.00 10.00 15.00% $ 0.90",
"confidence": 0.85
},
{
"description": "Luxury Truffles",
"quantity": 15,
"unit_price": 10,
"amount": 150,
"vat_rate": null,
"quote": "[LUX_TRF] Luxury Truffles 15.00 g 10.00 0.00 $ 150.00",
"confidence": 0.85
}
],
"checks": {
"subtotal_plus_vat_equals_total": true,
"line_items_sum_equals_subtotal_or_total": true,
"vat_breakdown_sum_equals_vat_total": true,
"due_date_not_before_issue_date": true
},
"overall_confidence": 0.94,
"missing": [
"vendor_vat_id",
"customer_vat_id",
"amount_due"
],
"pages": 1,
"billed_usd": 0.0075,
"input": "pdf",
"text_chars": 1036,
"model": "@cf/mistralai/mistral-small-3.1-24b-instruct",
"timing_ms": {
"pdf_text_ms": 826,
"extract_ms": 14828,
"total": 15654
},
"confidence_method": "Per field: 0.6 if the quote is found verbatim in the document text (+0.3 if the value matches the quote; 0.35 base if the quote is not verbatim), then +0.08/-0.15 from the arithmetic checks for totals. Values with confidence < 0.6 should be reviewed.",
"limits": "LLM extraction can misread layouts; check important values (quotes make that quick). Scanned PDFs need image input. Documents are not stored.",
"sources": [
{
"name": "Cloudflare Workers AI: toMarkdown (PDF text layer), Mistral Small 3.1 24B (OCR of images + field extraction; fallback Llama 3.3 70B / Llama 4 Scout / Gemma 3 12B)",
"url": "https://developers.cloudflare.com/workers-ai/",
"note": "Documents are processed in memory and not stored or logged. No third-party LLM API."
}
]
}
curl --location --request GET 'https://zylalabs.com/api/14523/invoice+and+text+to+json+extraction+api/37076/invoice+to+json?url=https://raw.githubusercontent.com/invoice-x/invoice2data/master/tests/compare/AzureInterior.pdf' --header 'Authorization: Bearer YOUR_API_KEY'
{
"document_type": {
"value": "invoice",
"quote": "Invoice INV/2023/03/0008",
"confidence": 0.9
},
"vendor": {
"name": {
"value": "Global Wholesaler",
"quote": "Global Wholesaler",
"confidence": 0.95
},
"address": {
"value": "Azure Interior 4557 De Silva St Fremont CA 94538 United States",
"quote": "Azure Interior 4557 De Silva St Fremont CA 94538 United States",
"confidence": 0.95
},
"vat_id": {
"value": null,
"quote": null,
"confidence": null
},
"email": {
"value": "[email protected]",
"quote": "[email protected]",
"confidence": 0.95
},
"phone": {
"value": "(870)-931-0505",
"quote": "(870)-931-0505",
"confidence": 0.95
},
"iban": {
"value": "US1234567890",
"quote": "US1234567890",
"confidence": 0.95
}
},
"customer": {
"name": {
"value": "YourCompany",
"quote": "YourCompany, Mitchell Admin",
"confidence": 0.95
},
"address": {
"value": "215 Vine St Scranton PA 18503 United States",
"quote": "215 Vine St Scranton PA 18503 United States",
"confidence": 0.95
},
"vat_id": {
"value": null,
"quote": null,
"confidence": null
}
},
"invoice_number": {
"value": "INV/2023/03/0008",
"quote": "Invoice INV/2023/03/0008",
"confidence": 0.95
},
"order_number": {
"value": "CUSTREF123",
"quote": "Reference:CUSTREF123",
"confidence": 0.95
},
"issue_date": {
"value": "2023-03-20",
"quote": "03/20/2023",
"confidence": 0.9
},
"due_date": {
"value": "2023-04-04",
"quote": "04/04/2023",
"confidence": 0.9
},
"currency": {
"value": "USD",
"quote": "$ 112.00",
"confidence": 0.9
},
"payment_terms": {
"value": "15 Days",
"quote": "Payment terms: 15 Days",
"confidence": 0.95
},
"totals": {
"subtotal": {
"value": 262.9,
"quote": "$ 262.90",
"confidence": 0.98
},
"vat_total": {
"value": 16.94,
"quote": "$ 16.94",
"confidence": 0.98
},
"total": {
"value": 279.84,
"quote": "$ 279.84",
"confidence": 0.98
},
"amount_due": {
"value": null,
"quote": null,
"confidence": null
}
},
"vat_breakdown": [
{
"rate": 15,
"base": 112.9,
"amount": 16.94,
"quote": "$ 16.94",
"confidence": 0.85
}
],
"line_items": [
{
"description": "Beeswax XL",
"quantity": 1,
"unit_price": 42,
"amount": 42,
"vat_rate": 15,
"quote": "[17589684] Beeswax XL Acme beeswax 1.00 kg 42.00 0.00 15.00% $ 42.00",
"confidence": 0.85
},
{
"description": "Office Chair",
"quantity": 1,
"unit_price": 70,
"amount": 70,
"vat_rate": 15,
"quote": "[FURN_7777] Office Chair 1.00 Units 70.00 0.00 15.00% $ 70.00",
"confidence": 0.85
},
{
"description": "Olive Oil",
"quantity": 1,
"unit_price": 1,
"amount": 0.9,
"vat_rate": 15,
"quote": "*987123* Olive Oil 1.00 L 1.00 10.00 15.00% $ 0.90",
"confidence": 0.85
},
{
"description": "Luxury Truffles",
"quantity": 15,
"unit_price": 10,
"amount": 150,
"vat_rate": null,
"quote": "[LUX_TRF] Luxury Truffles 15.00 g 10.00 0.00 $ 150.00",
"confidence": 0.85
}
],
"checks": {
"subtotal_plus_vat_equals_total": true,
"line_items_sum_equals_subtotal_or_total": true,
"vat_breakdown_sum_equals_vat_total": true,
"due_date_not_before_issue_date": true
},
"overall_confidence": 0.94,
"missing": [
"vendor_vat_id",
"customer_vat_id",
"amount_due"
],
"pages": 1,
"billed_usd": 0.0075,
"input": "pdf",
"text_chars": 1036,
"model": "@cf/mistralai/mistral-small-3.1-24b-instruct",
"timing_ms": {
"pdf_text_ms": 719,
"extract_ms": 17579,
"total": 18298
},
"confidence_method": "Per field: 0.6 if the quote is found verbatim in the document text (+0.3 if the value matches the quote; 0.35 base if the quote is not verbatim), then +0.08/-0.15 from the arithmetic checks for totals. Values with confidence < 0.6 should be reviewed.",
"limits": "LLM extraction can misread layouts; check important values (quotes make that quick). Scanned PDFs need image input. Documents are not stored.",
"sources": [
{
"name": "Cloudflare Workers AI: toMarkdown (PDF text layer), Mistral Small 3.1 24B (OCR of images + field extraction; fallback Llama 3.3 70B / Llama 4 Scout / Gemma 3 12B)",
"url": "https://developers.cloudflare.com/workers-ai/",
"note": "Documents are processed in memory and not stored or logged. No third-party LLM API."
}
]
}
curl --location --request POST 'https://zylalabs.com/api/14523/invoice+and+text+to+json+extraction+api/37077/invoice+to+json+post' --header 'Authorization: Bearer YOUR_API_KEY'
--data-raw '{"url":"https://raw.githubusercontent.com/invoice-x/invoice2data/master/tests/compare/AzureInterior.pdf"}'
{
"data": {
"order_id": "4471",
"company": "ACME GmbH",
"total": 1299,
"currency": "EUR",
"due_date": "2026-11-30",
"email": "[email protected]"
},
"method": "workers-ai",
"model": "@cf/meta/llama-3.1-8b-instruct-fp8-fast",
"missing": [],
"not_verbatim_in_text": [],
"limits": "Small-model / heuristic extraction; check important values. Text is not stored.",
"sources": [
{
"name": "Cloudflare Workers AI (Llama 3.1 8B fp8-fast, fallback Llama 3.3 70B / Mistral Small 3.1, JSON mode)",
"url": "https://developers.cloudflare.com/workers-ai/"
}
]
}
curl --location --request GET 'https://zylalabs.com/api/14523/invoice+and+text+to+json+extraction+api/37078/text+to+json?text=Order #4471 from ACME GmbH, total EUR 1.299,00, due 2026-11-30, contact [email protected]&schema={"type":"object","properties":{"order_id":{"type":"string"},"company":{"type":"string"},"total":{"type":"number"},"currency":{"type":"string"},"due_date":{"type":"string","format":"date"},"email":{"type":"string","format":"email"}}}' --header 'Authorization: Bearer YOUR_API_KEY'
{
"data": {
"order_id": "4471",
"total": 1299
},
"method": "workers-ai",
"model": "@cf/meta/llama-3.1-8b-instruct-fp8-fast",
"missing": [],
"not_verbatim_in_text": [],
"limits": "Small-model / heuristic extraction; check important values. Text is not stored.",
"sources": [
{
"name": "Cloudflare Workers AI (Llama 3.1 8B fp8-fast, fallback Llama 3.3 70B / Mistral Small 3.1, JSON mode)",
"url": "https://developers.cloudflare.com/workers-ai/"
}
]
}
curl --location --request POST 'https://zylalabs.com/api/14523/invoice+and+text+to+json+extraction+api/37079/text+to+json+post' --header 'Authorization: Bearer YOUR_API_KEY'
--data-raw '{"text":"Order ID: 4471, Total: EUR 1.299,00","schema":{"type":"object","properties":{"order_id":{"type":"string"},"total":{"type":"number"}}}}'
注册后,每个开发者都会被分配一个个人 API 访问密钥,这是一个唯一的字母和数字组合,用于访问我们的 API 端点。要使用 发票和文本到JSON提取 API 进行身份验证,只需在 Authorization 标头中包含您的 bearer token。
| 标头 | 描述 |
|---|---|
授权
|
必需
应为 Bearer access_key. 订阅后,请查看上方的"您的 API 访问密钥"。
|
发票到JSON端点返回发票和收据的结构化JSON数据,包括供应商详情、客户信息、发票号码和财务总额 文本到JSON端点根据混乱的文本输入返回干净的JSON,按照用户定义的模式结构化
发票到JSON响应中的主要字段包括供应商名称 地址 增值税ID 电子邮件 电话 发票号码 开具日期 货币 小计 增值税总额 和明细项 对于文本到JSON 关键字段取决于提供的架构 如订单ID 总额 和到期日
返回的数据为JSON格式,采用键值对结构。对于发票,它遵循固定的架构,并在其中嵌套了供应商和客户的详细信息。文本到JSON的响应根据用户定义的架构进行结构化,以确保类型一致性
发票到JSON端点提供详细的发票和收据信息,包括供应商和客户数据、财务总额和行项目 文本到JSON端点根据指定架构从非结构化文本中提取相关数据
用户可以发送参数,例如 {url}、{file_base64, mime_type} 或 {text},用于发票到 JSON 端点。对于文本到 JSON,用户提供杂乱的文本和 JSON 架构。GET 请求也可以使用 ?url= 或 ?text= 参数
响应数据被组织成结构化的JSON对象。每个关键字段包含一个值、来自源的逐字引用和一个置信度评分。这种组织方式使用户能够轻松访问和解释提取的信息
数据准确性通过每个提取字段的置信度分数得以保持,指示信息的可靠性 算术检查确保总数匹配,先进的人工智能模型的使用提高了提取质量
典型的用例包括自动化发票处理 从收据中提取关键信息用于会计以及将非结构化文本转换为结构化数据以进行分析 用户可以简化数据输入并提高财务记录的准确性