{"uid":"cap_didE7-RV3DU4lHu8tpAjZ","slug":"schemalock-custom-schema-document-extraction-70e23ded","name":"SchemaLock Custom Schema Document Extraction","description":"SchemaLock — extract structured JSON data from any PDF/image or raw text/HTML, converting it into a JSON Schema you supply, not limited to invoice/receipt/contract/resume. Unlike the fixed invoice/receipt/contract/resume endpoints, this accepts any JSON Schema — you define the fields. Takes a PDF/image file OR raw text/HTML you already have (e.g. a scraped page). Schema-conformance, not fact-checking. A rejected schema is a 400 and costs nothing.","url":"https://doc-extract-api.thestarboy9696-4ef.workers.dev/extract/custom","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method","bodyType","body"],"properties":{"body":{"properties":{}},"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"bodyType":{"enum":["json","form-data","text"],"type":"string"}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"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_TEJRp4cvlfGJDtulzHSHR","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 from any PDF or image file according to a user-supplied JSON Schema, supporting arbitrary field definitions beyond fixed document types.","exampleAgentPrompt":"I have a scanned lab report PDF — can you extract the patient name, test names, result values, and reference ranges into structured JSON using this schema I've defined: {\"type\":\"object\",\"properties\":{\"patient_name\":{\"type\":\"string\"},\"tests\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"name\":{\"type\":\"string\"},\"result\":{\"type\":\"string\"},\"reference_range\":{\"type\":\"string\"}}}}}}?","exampleUseCases":[{"title":"Medical report data extraction","prompt":"I have a PDF of a patient discharge summary and I need to pull out the diagnosis codes, attending physician name, admission date, and discharge date into structured JSON — here's the schema I want it to conform to."},{"title":"Academic transcript parsing","prompt":"Can you extract the student name, institution, graduation year, GPA, and a list of courses with grades from this university transcript image? I'll give you the JSON Schema for exactly what fields I need."},{"title":"Custom form digitization","prompt":"I've got scanned paper survey forms as images — I need to extract the respondent's answers to five specific questions into a structured JSON object matching my custom schema. Can you process this image with my schema?"}],"resultDescription":"Returns a JSON object whose keys and value types are determined by the caller-supplied JSON Schema. Each field in the schema is populated with the corresponding data extracted from the provided PDF or image. The extraction uses forced tool-use against the schema, so the output is guaranteed to be schema-conformant in structure, though semantic accuracy depends on document readability. No fact-checking or semantic validation is performed beyond schema conformance.","failureModes":["400 error if the supplied JSON Schema exceeds 6000 characters — no charge incurred","400 error if the schema is malformed or invalid JSON Schema","Extraction inaccuracy if the source document is low quality, poorly scanned, or handwritten","Missing or null field values if the requested fields are not present in the document","Timeout or processing error for very large or complex PDF files","Payment failure if the x402 USDC payment of $0.08 cannot be processed"],"whenToPreferThis":"Choose this endpoint when you need to extract structured data from a PDF or image into a custom, arbitrary schema that doesn't fit the predefined invoice, receipt, resume, or contract templates. Ideal when your document type is niche (lab reports, permits, forms, certificates, custom business documents) or when you need a non-standard set of fields. Use the fixed-template endpoints instead if your document is a standard invoice, receipt, contract, or resume, as those are optimized for their respective formats. This endpoint gives maximum flexibility at the same price point.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T12:39:40.562Z","isFirstParty":false}