{"openapi":"3.1.0","info":{"title":"Document Extraction Hub","version":"1.0.0","description":"Pay-per-page document extraction and OCR for autonomous agents. PDF, PNG, JPEG or WebP in, structured JSON out, with a page and a position behind every field, plus every QR code and barcode decoded. No signup, no API key, no dashboard. Every call is settled in USDC over the x402 protocol.","contact":{"name":"Die Netzhandwerker","url":"https://netzhandwerker.de"}},"servers":[{"url":"https://doc.netzhandwerker.de"}],"paths":{"/document":{"post":{"summary":"Turn one PDF into structured JSON: header fields, tables as rows and columns, key value pairs and per page full text, each field with its page, position and confidence.","description":"The text layer is read first. Only pages without a usable text layer are rasterised and passed through OCR (German and English). With a JSON Schema the result is mapped onto that schema; without one the document is returned as header data, tables, key value pairs and per page full text. Fields that are not present in the document stay empty. Nothing is guessed. Price: 0.02 USDC per page with a text layer, 0.05 USDC per page that needs OCR, settled over x402 on Base Mainnet. The 402 answer names the exact amount for the file that was sent.","operationId":"extract_document","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"pdf_base64":{"type":"string","description":"The PDF as base64. Use this or \"url\", not both."},"url":{"type":"string","format":"uri","description":"Public http or https URL of the PDF. Use this or \"pdf_base64\", not both."},"schema":{"type":"object","description":"Optional JSON Schema. Every property is looked up in the document and returned with value, confidence and source. A property that is not in the document stays empty."},"pages":{"description":"Optional page range, for example \"1-5\", \"2,4,7\" or [1,2,3]. At most 20 pages per call.","anyOf":[{"type":"string"},{"type":"array","items":{"type":"integer","minimum":1}}]},"include_raw":{"type":"boolean","default":false,"description":"With a schema, also return header data, tables and key value pairs alongside the mapped result."}}}}}},"responses":{"200":{"description":"Structured document","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request body, page range, language or want list. Not charged."},"402":{"description":"Payment required. The body carries the exact price for this file. Retry with a PAYMENT-SIGNATURE header."},"403":{"description":"The origin refused the download or robots.txt disallows it. Not charged."},"413":{"description":"Document larger than the byte limit, or more pages requested than the per call limit. Not charged."},"415":{"description":"Not a PDF. Not charged."},"422":{"description":"Encrypted or unreadable PDF. Not charged."},"429":{"description":"Too many unsettled requests from this address."},"504":{"description":"The hard time limit was reached. Not charged."}},"x-x402":{"pricing":"per_page","price":{"model":"per_page","text_page":{"amount":"20000","display":"$0.02"},"ocr_page":{"amount":"50000","display":"$0.05"},"max_amount":"1000000","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","decimals":6,"network":"eip155:8453"}}}},"/ocr":{"post":{"summary":"Read a picture, a scan or a screenshot: full text in reading order, typed blocks with their box on the page, tables as a matrix plus markdown, and every QR code and barcode with its decoded content.","description":"PNG, JPEG, WebP or PDF goes in. Out comes the full text with paragraphs intact, every block typed as heading, paragraph, list, table, caption or footnote with its box in pixels and its confidence, tables as rows and columns plus a markdown rendering with merged cells marked, and every QR, Data Matrix, EAN-13, EAN-8, Code 128, Code 39, PDF417 and Aztec symbol with its raw value. QR payloads are parsed into URL, WLAN, vCard, EPC transfer and calendar. A URL found inside a code is reported and never opened. No face recognition, no matching of people, no reading of identity documents beyond the plain text they carry. Price: 0.006 USDC per image or first page, 0.002 USDC per further page of the same file, settled over x402 on Base Mainnet. The 402 answer names the exact amount for the file that was sent.","operationId":"ocr_read","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"image_base64":{"type":"string","description":"The picture or PDF as base64. Use this or \"url\", not both."},"url":{"type":"string","format":"uri","description":"Public http or https URL of the picture or PDF. Use this or \"image_base64\", not both."},"mime":{"type":"string","enum":["image/png","image/jpeg","image/webp","application/pdf"],"description":"Media type of the input. Checked against the actual bytes; a mismatch is refused rather than worked around."},"languages":{"type":"array","items":{"type":"string","enum":["deu","eng"]},"default":["deu","eng"],"description":"Languages to read, default deu plus eng. Installed models: deu, eng."},"want":{"type":"array","items":{"type":"string","enum":["text","tables","codes","layout"]},"default":["text","tables","codes","layout"],"description":"Which parts of the answer to compute. The price does not change with it; asking for less is simply faster."},"pages":{"description":"Optional page range for PDF input, for example \"1-5\" or \"2,4,7\". At most 50 pages per call. Not allowed for a single image.","anyOf":[{"type":"string"},{"type":"array","items":{"type":"integer","minimum":1}}]}}}}}},"responses":{"200":{"description":"Text, blocks, tables, codes and layout","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request body, page range, language or want list. Not charged."},"402":{"description":"Payment required. The body carries the exact price for this file. Retry with a PAYMENT-SIGNATURE header."},"403":{"description":"The origin refused the download or robots.txt disallows it. Not charged."},"413":{"description":"Larger than 12 MB, wider than 10000 pixels, or more than 50 pages requested. Refused before the price is named, never charged."},"415":{"description":"Not a PNG, JPEG, WebP or PDF, or the declared \"mime\" does not match the bytes. Not charged."},"422":{"description":"Encrypted PDF, or nothing at all was recognised. An empty recognition is a failure, not a paid result. Not charged."},"429":{"description":"Too many unsettled requests from this address."},"504":{"description":"The hard time limit was reached. Not charged."}},"x-x402":{"pricing":"per_page_first_higher","price":{"model":"per_page_first_higher","first_page":{"amount":"6000","display":"$0.006"},"further_page":{"amount":"2000","display":"$0.002"},"max_amount":"104000","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","decimals":6,"network":"eip155:8453"}}}},"/health":{"get":{"summary":"Service health, no payment required","responses":{"200":{"description":"ok"}}}},"/readiness":{"get":{"summary":"Readiness including the machine cost proof, no payment required","responses":{"200":{"description":"ok"}}}},"/pricing":{"get":{"summary":"Machine readable price list, no payment required","responses":{"200":{"description":"ok"}}}}},"x-service":{"slug":"doc-extract","tags":["document-extraction","pdf-to-json","ocr","barcode","qr-code","invoice-parsing","table-extraction","agent-tools","accounting","procurement","archive"],"payment_protocol":"x402","pricing_model":"per_page","endpoint_count":5,"paid_endpoint_count":2}}