PDF 转 JSON OCR API

API ID 14067

将任何包含或不包含图像的PDF文档转换为结构化的JSON输出,利用API的内置OCR功能。该API最适合用于LLM训练和数据集创建

623 ms 平均响应

API 文档

端点

请求
“转换 PDF 为 JSON”接口旨在将 PDF 文档转换为结构化的 JSON 格式,使开发者和应用程序能够轻松提取和处理这些文件中包含的数据。该接口通过解析输入 PDF 的元素——如文本、图像和元数据——来处理 PDF,并将提取的信息组织为一个 JSON 对象,保持原始内容的上下文和层次结构。常见用例包括将 PDF 报告、发票和合同转换为适合与 Web 应用程序、数据分析平台或机器学习模型集成的格式,从而以流畅和可访问的方式促进进一步的数据处理和分析任务 通过将 OCR 参数设置为 true 强制开启 OCR 默认情况下为自动
Endpoint ID: 34500
POST https://zylalabs.com/api/14067/pdf+to+json+ocr+api/34500/convert+pdf-to-json
输入参数

将PDF转换为JSON — 端点功能

对象 描述
ocr 必需 true for force OCR, false for no OCR
请求体 必需 文件二进制

剩余免费测试请求:3 / 3。


输入参数

ocr
API 示例响应
JSON
{
    "success": true,
    "data": {
        "id": "7d0dc6c9-1669-d756-22ca-121a4854ca27",
        "request_id": "a4de4cdb-9f68-4727-9ac1-b974aee01aa1",
        "file_name": "l03fgI9uxGsbBYmWGhzCnQsVaV9N8vX2j1CTiBXl",
        "page_count": 13,
        "total_pages": 13,
        "title": "Sec XI-Sample audit reports.pdf",
        "pages": [
            {
                "page_number": 1,
                "extraction_method": "text",
                "blocks": [
                    {
                        "type": "heading",
                        "level": 1,
                        "text": "1 ) SAMPLE - INDEPENDENT AUDITOR'S REPORT - UNMODIFIED OPINION"
                    },
                    {
                        "type": "paragraph",
                        "text": "Independent Auditor’s Report"
                    },
                    {
                        "type": "heading",
                        "level": 1,
                        "text": "Members of Tribal Council"
                    },
                    {
                        "type": "heading",
                        "level": 1,
                        "text": "8SQRUWK\u00037ULEDO\u0003+RXVLQJ"
                    },
                    {
                        "type": "heading",
                        "level": 1,
                        "text": "8SQRUWK\u000f\u0003$ODVNDS"
                    },
                    {
                        "type": "heading",
                        "level": 1,
                        "text": "Reportrt on the Financial Statements"
                    },
                    {
                        "type": "heading",
                        "level": 1,
                        "text": "We have audited the accompanying financial statements of the governmental activities, each"
                    },
                    {
                        "type": "heading",
                        "level": 1,
                        "text": "major fund and the aggregate remaining fund information of 8SQRUWK 7ULEDO\u00031RUWK +RXVLQJ 87+ as"
                    },
                    {
                        "type": "heading",
                        "level": 1,
                        "text": "of and for the year ended September 30, 20XX, and the related notes to the"
                    },
                    {
                        "type": "heading",
                        "level": 1,
                        "text": "financial statements, which collectively comprise RI\u0003 87+'s basic financial statements as listed in the"
                    },
                    {
                        "type": "heading",
                        "level": 1,
                        "text": "table of contents."
                    },
                    {
                        "type": "paragraph",
                        "text": "Management’s Responsibility for the Financial Statements Management is responsible for the preparation and fair presentation of these financial statements in accordance with accounting principles generally accepted in the United States of America; this includes the design, implementation, and maintenance of internal control relevant to the preparation and fair presentation of financial statements that are free from material misstatement, whether due to fraud or error."
                    },
                    {
                        "type": "paragraph",
                        "text": "Auditor’s Responsibility Our responsibility is to express opinions on these financial statements based on our audit. We conducted our audit in accordance with auditing standards generally accepted in the United States of America and the standards applicable to financial audits contained in Government Auditing Standards, issued by the Comptroller General of the United States. Those standards require that we plan and perform the audit to obtain reasonable assurance about whether the financial statements are free from material misstatement."
                    },
                    {
                        "type": "paragraph",
                        "text": "An audit involves performing procedures to obtain audit evidence about the amounts and disclosures in the financial statements. The procedures selected depend on the auditor’s judgment, including the assessment of the risks of material misstatement of the financial statements, whether due to fraud or error. In making those risk assessments, the auditor considers internal control relevant to the entity’s preparation and fair presentation of the financial statements in order to design audit procedures that are appropriate in the circumstances, but not for the purpose of expressing an opinion on the effectiveness of the entity’s internal control. Accordingly, we express no such opinion. An audit also includes evaluating the appropriateness of accounting policies used and the reasonableness of significant accounting estimates made by management, as well as evaluating the overall presentation of the financial statements."
                    },
                    {
                        "type": "paragraph",
                        "text": "We believe that the audit evidence we have obtained is sufficient and appropriate to provide a basis for our audit opinions."
                    }
                ]
            },
            {
                "page_number": 2,
                "extraction_method": "text",
                "blocks": [
                    {
                        "type": "paragraph",
                        "text": "Members of Tribal Council 8SQRUWK\u00037ULEDO\u0003+RXVLQJ Opinions"
                    },
                    {
                        "type": "heading",
                        "level": 1,
                        "text": "In our opinion, the financial statements referred to above present fairly, in all material respects, the"
                    },
                    {
                        "type": "heading",
                        "level": 1,
                        "text": "respective financial position of the governmental activities, each major fund and the aggregate remaining"
                    },
                    {
                        "type": "heading",
                        "level": 1,
                        "text": "fund information of 8SQRUWK\u00037ULEDO +RXVLQJ as of 'HFHPEHU\u0003 \u0016\u0014 , 20XX, and the respective changes"
                    },
                    {
                        "type": "heading",
                        "level": 1,
                        "text": "in financial position for the year then ended in accordance with accounting principles generally"
                    },
                    {
                        "type": "heading",
                        "level": 1,
                        "text": "accepted in the United States of America."
                    },
                    {
                        "type": "paragraph",
                        "text": "Other Matters Required Supplementary Information Management has omitted the Management Discussion and Analysis and required budget to actual schedules that accounting principles generally accepted in the United States of America requires to be presented to supplement the basic financial statements. Such missing information, although not a part of the basic financial statements, is required by the Governmental Accounting Standards Board who considers it to be an essential part of financial reporting for placing the basic financial statements in an appropriate operational, economic, or historical context. Our opinion on the basic financial statements is not affected by this missing information."
                    },
                    {
                        "type": "paragraph",
                        "text": "Other Information Our audit was conducted for the purpose of forming opinions on the financial statements that collectively comprise 8SQRUWK\u0003 7ULEDO\u0003 +RXVLQJ’s basic financial statements. The information listed in the Table of Contents as “Additional Supplementary Information”, which includes Other Governmental Funds: Combining Balance Sheet and Combining Statement of Revenues, Expenditures and Changes in Fund Balances, is presented for purposes of additional analysis and is not a required part of the basic financial statements. The Schedule of Expenditures of Federal Awards is presented for the purpose of additional analysis as required by Title 2 U.S. Code of Federal Regulations (CFR) Part 200, Uniform Administrative Requirements, Cost Principles, and Audit Requirements for Federal Awards, and is also not a required part of the basic financial statements."
                    },
                    {
                        "type": "paragraph"
                    }
                ]
            }
        ]
    },
    "_note": "Response truncated for documentation purposes"
}
将PDF转换为JSON — 代码片段

    curl --location 'https://zylalabs.com/api/14067/pdf+to+json+ocr+api/34500/convert+pdf-to-json?ocr=auto' \
    --header 'Content-Type: application/json' \ 
    --form 'image=@"FILE_PATH"'

API 访问密钥和身份验证

注册后,每个开发者都会被分配一个个人 API 访问密钥,这是一个唯一的字母和数字组合,用于访问我们的 API 端点。要使用 PDF 转 JSON OCR API 进行身份验证,只需在 Authorization 标头中包含您的 bearer token。

标头
标头 描述
授权 必需 应为 Bearer access_key. 订阅后,请查看上方的"您的 API 访问密钥"。

无长期承诺。随时升级、降级或取消。 免费试用包括最多 50 个请求。

(年度计费可节省 2 个月 🎉)

起价
$10,000/年


  • 自定义数量
  • 自定义速率限制
  • 专业客户支持
  • 实时 API 监控

概览

将任何带或不带图像的PDF文档转换为结构化的JSON输出,利用API内置的OCR功能。该API最适合用于LLM训练和数据集创建

PDF 转 JSON OCR API FAQs

转换PDF为JSON端点返回包含从输入PDF中提取的文本、图像和元数据的结构化JSON数据它将这些信息组织成层次格式,便于访问和处理

响应中的关键字段包括“成功”“数据”“id”“请求_id”“文件名”“页面数”“总页数”和“页面”,其中包含每页内容和结构的详细信息

响应数据以JSON对象的形式组织,顶层的“data”字段包含一个“pages”数组。每个页面对象包括“page_number”,“extraction_method”和“blocks”,详细说明内容类型和文本

主要参数是“OCR”,可以设置为true以强制执行OCR处理,或设置为自动以进行自动检测。这允许用户自定义如何从基于图像的PDF中提取文本

转换端点的 HTML 页面处理原始 HTML 内容,并以各种格式返回,例如 PDF 或 DOCX 它从 HTML 中提取文本、图像和格式,使用户能够将网页内容转换为结构化文档

典型的用例包括将PDF报告、发票和合同转换为JSON以进行数据分析、与Web应用集成以及为机器学习模型训练准备数据集

用户可以解析 JSON 响应以提取特定内容,例如标题或段落,以便进一步分析或集成到应用程序中 结构化格式允许轻松操作和数据处理

该API使用内置的OCR技术准确提取PDF中的文本,包括带有图像的PDF。持续更新和改进OCR算法有助于保持高数据质量和准确性

一般常见问题

Zyla API Hub 就像一个大型 API 商店,您可以在一个地方找到数千个 API。我们还为所有 API 提供专门支持和实时监控。注册后,您可以选择要使用的 API。请记住,每个 API 都需要自己的订阅。但如果您订阅多个 API,您将为所有这些 API 使用相同的密钥,使事情变得更简单。
价格以 USD(美元)、EUR(欧元)、CAD(加元)、AUD(澳元)和 GBP(英镑)列出。我们接受所有主要的借记卡和信用卡。我们的支付系统使用最新的安全技术,由 Stripe 提供支持,Stripe 是世界上最可靠的支付公司之一。如果您在使用卡片付款时遇到任何问题,请通过 [email protected]

此外,如果您已经以这些货币中的任何一种(USD、EUR、CAD、AUD、GBP)拥有有效订阅,该货币将保留用于后续订阅。只要您没有任何有效订阅,您可以随时更改货币。
定价页面上显示的本地货币基于您 IP 地址的国家/地区,仅供参考。实际价格以 USD(美元)为单位。当您付款时,即使您在我们的网站上看到以本地货币显示的等值金额,您的卡片对账单上也会以美元显示费用。这意味着您不能直接使用本地货币付款。
有时,银行可能会因其欺诈保护设置而拒绝收费。我们建议您首先联系您的银行,检查他们是否阻止了我们的收费。此外,您可以访问账单门户并更改关联的卡片以进行付款。如果这些方法不起作用并且您需要进一步帮助,请通过 [email protected]
价格由月度或年度订阅决定,具体取决于所选计划。
API 调用根据成功请求从您的计划中扣除。每个计划都包含您每月可以进行的特定数量的调用。只有成功的调用(由状态 200 响应指示)才会计入您的总数。这确保失败或不完整的请求不会影响您的月度配额。
Zyla API Hub 采用月度订阅系统。您的计费周期将从您购买付费计划的那一天开始,并在下个月的同一日期续订。因此,如果您想避免未来的费用,请提前取消订阅。
要升级您当前的订阅计划,只需转到 API 的定价页面并选择您要升级到的计划。升级将立即生效,让您立即享受新计划的功能。请注意,您之前计划中的任何剩余调用都不会转移到新计划,因此在升级时请注意这一点。您将被收取新计划的全部金额。
要检查您本月剩余多少 API 调用,请参考响应标头中的 "X-Zyla-API-Calls-Monthly-Remaining" 字段。例如,如果您的计划允许每月 1,000 个请求,而您已使用 100 个,则响应标头中的此字段将显示 900 个剩余调用。
要查看您的计划允许的最大 API 请求数,请检查 "X-Zyla-RateLimit-Limit" 响应标头。例如,如果您的计划包括每月 1,000 个请求,此标头将显示 1,000。
"X-Zyla-RateLimit-Reset" 标头显示您的速率限制重置之前的秒数。这告诉您何时您的请求计数将重新开始。例如,如果它显示 3,600,则意味着还有 3,600 秒直到限制重置。
是的,您可以随时通过访问您的账户并在账单页面上选择取消选项来取消您的计划。请注意,升级、降级和取消会立即生效。此外,取消后,您将不再有权访问该服务,即使您的配额中还有剩余调用。
为了让您有机会在没有任何承诺的情况下体验我们的 API,我们提供 7 天免费试用,允许您免费进行最多 50 次 API 调用。此试用只能使用一次,因此我们建议将其应用于您最感兴趣的 API。虽然我们的大多数 API 都提供免费试用,但有些可能不提供。试用在 7 天后或您进行了 50 次请求后结束,以先发生者为准。如果您在试用期间达到 50 次请求限制,您需要"开始您的付费计划"以继续发出请求。您可以在个人资料中的订阅 -> 选择您订阅的 API -> 定价标签下找到"开始您的付费计划"按钮。或者,如果您在第 7 天之前不取消订阅,您的免费试用将结束,您的计划将自动计费,授予您访问计划中指定的所有 API 调用的权限。请记住这一点以避免不必要的费用。
7 天后,您将被收取试用期间订阅的计划的全额费用。因此,在试用期结束前取消很重要。因忘记及时取消而提出的退款请求不被接受。
当您订阅 API 免费试用时,您可以进行最多 50 次 API 调用。如果您希望超出此限制进行额外的 API 调用,API 将提示您执行"开始您的付费计划"。您可以在个人资料中的订阅 -> 选择您订阅的 API -> 定价标签下找到"开始您的付费计划"按钮。
付款订单在每月 20 日至 30 日之间处理。如果您在 20 日之前提交请求,您的付款将在此时间范围内处理。
您可以通过我们的聊天渠道联系我们以获得即时帮助。我们始终在线,时间为上午 8 点至下午 5 点(EST)。如果您在该时间之后联系我们,我们将尽快回复您。此外,您可以通过 [email protected]

相关 API


您可能还喜欢