{"uid":"cap__UL0aFv2PEaxfzPObJfEx","slug":"x402-gateway-document-extract-to-json-860b5add","name":"x402-gateway Document Extract to JSON","description":"Document Extract to JSON: Extract structured JSON from a document: sections, tables, key-values and caller-named fields. PDF, DOCX, PPTX, XLSX, CSV, EPUB, HTML, text. Deterministic parsing — no OCR, no LLM inference. Pay per call in USDC on Base via x402 — POST https://x402.freeq.one/tools/document_extract.","url":"https://x402.freeq.one/tools/document_extract?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"url":{"type":"string","example":"https://x402.freeq.one/samples/report.pdf","description":"Alias for document_url"},"fields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","example":"invoice_number"},"type":{"enum":["string","number","boolean","date"],"type":"string","example":"string"}}},"description":"Optional caller-named fields (max 20), each {name, type} with type string, number, boolean or date; unmatched fields return null, never guessed"},"file_b64":{"type":"string","maxLength":28000000,"description":"Base64-encoded document bytes (alternative to document_url)"},"filename":{"type":"string","example":"report.pdf","description":"Optional original filename"},"max_length":{"type":"integer","example":100000,"description":"Truncate converted text to N characters"},"document_url":{"type":"string","example":"https://x402.freeq.one/samples/report.pdf","description":"Direct URL to the document (alternative: file_b64)"}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.02","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.02/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_oerNgzwZudehManlCY_of","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.02","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Extracts structured JSON (sections, tables, key-values, and caller-named fields) from documents (PDF, DOCX, PPTX, XLSX, CSV, EPUB, HTML, text) using deterministic parsing — no OCR or LLM inference — paid per call in USDC on Base.","exampleAgentPrompt":"Extract structured JSON from this PDF invoice at https://example.com/invoices/inv-2024-001.pdf — I need the document sections, any tables, and these specific fields: invoice_number (string), total_amount (number), due_date (date), and is_paid (boolean).","exampleUseCases":[{"title":"Invoice data extraction for accounting","prompt":"Pull structured data from this PDF invoice at https://example.com/docs/invoice-4521.pdf — I need these fields: invoice_number (string), vendor_name (string), total_due (number), and invoice_date (date)."},{"title":"Contract key-value parsing","prompt":"Parse this DOCX contract at https://example.com/contracts/service-agreement.docx into JSON — extract the sections and tables, plus these named fields: effective_date (date), party_a (string), party_b (string), and contract_value (number)."},{"title":"Spreadsheet table extraction","prompt":"Extract all tables and structured data from this XLSX file at https://example.com/reports/q3-sales.xlsx and return it as JSON, including columns and row values."}],"resultDescription":"A structured JSON object containing the document's parsed sections, tables, and key-value pairs, along with any caller-named fields and their typed values (string, number, boolean, or date). Unmatched caller-named fields return null rather than guessed values. Output is deterministic — identical input always produces identical output.","failureModes":["Invalid or inaccessible document URL returns an error","Unsupported file format returns a format error","Base64-encoded file exceeding 28MB is rejected","Caller-named fields that cannot be matched return null (not an error)","More than 20 caller-named fields returns a validation error","Malformed or corrupted document may return a partial or empty extraction","Payment not received or insufficient USDC balance returns 402 Payment Required"],"whenToPreferThis":"Choose this endpoint when you need deterministic, reproducible structured extraction from common document formats (PDF, DOCX, PPTX, XLSX, CSV, EPUB, HTML) without relying on LLM inference or OCR. It is especially valuable when you need typed, named fields extracted consistently, or when you want to avoid hallucination risks from LLM-based parsers. Prefer it over LLM document tools when auditability and determinism matter, and over OCR tools when the document has parseable text layers.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-31T18:38:56.934Z","isFirstParty":false,"canonicalSlug":"x402-gateway-document-extract-to-json-860b5add"}