{"openapi":"3.1.0","info":{"title":"Extract JSON: unstructured text to schema-valid JSON","version":"1.0.0","description":"Use this when you need to turn unstructured text (emails, invoices, receipts, job posts, listings, bios, support tickets, chat logs) into JSON matching a schema. Send the text plus a JSON Schema or a list of field names; get back data that validates against it. Missing values come back as null, never invented. Charged only on success. Pay per call with x402 USDC on Base. No account or API key.","x-guidance":"POST /extract ($0.002) with {\"text\": \"...\", \"schema\": {JSON Schema}} or {\"text\": \"...\", \"fields\": [\"name\", \"total:number\", \"tags:string[]\"]}; optional \"instructions\". Text up to 8000 characters. Response: {data, model, warnings, missing}. data validates against your schema; values not in the text are null and listed in missing. You are charged only for HTTP 200. POST /extract-lite is a free demo (1000 chars, 5 fields, rate limited)."},"servers":[{"url":"https://extract-json.mintfacts.workers.dev"}],"paths":{"/extract":{"post":{"operationId":"extract_json","summary":"Text to JSON matching your schema (up to 8000 characters)","description":"Use this when you need to turn unstructured text (emails, invoices, receipts, job posts, listings, bios, support tickets, chat logs) into JSON matching a schema. Send the text plus a JSON Schema or a list of field names; get back data that validates against it. Missing values come back as null, never invented. Charged only on success.","tags":["Extraction"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":8000,"description":"The unstructured text to extract from (max 8000 characters)."},"schema":{"type":"object","description":"A JSON Schema (type: object, with properties) describing the JSON you want back. Supports type, properties, required, items, enum, description. Provide this OR fields."},"fields":{"type":"array","items":{"type":"string"},"maxItems":40,"description":"Shortcut instead of a schema: field names, optionally typed as name:type where type is string, number, integer, boolean, date, string[], number[] or object[] (e.g. [\"name\", \"email\", \"total:number\", \"skills:string[]\"])."},"instructions":{"type":"string","maxLength":500,"description":"Optional extra guidance, e.g. 'dates as YYYY-MM-DD', 'amounts in USD'."}},"required":["text"]},"examples":{"invoice_with_schema":{"summary":"Invoice, with a JSON Schema","value":{"text":"INVOICE #INV-2291\nBright Pixel Studio LLC, 44 Market St, Portland OR\nBill to: Harbor Coffee Co.\nDate: Nov 3, 2026  Due: Dec 3, 2026\nLogo redesign 1 x $1,200.00\nBusiness cards (500) 2 x $85.50\nTOTAL DUE: $1,371.00 USD","schema":{"type":"object","properties":{"invoice_number":{"type":"string"},"vendor":{"type":"string"},"customer":{"type":"string"},"due_date":{"type":"string","description":"YYYY-MM-DD"},"total":{"type":"number"},"currency":{"type":"string"},"line_items":{"type":"array","items":{"type":"object","properties":{"description":{"type":"string"},"quantity":{"type":"number"},"unit_price":{"type":"number"}}}}},"required":["invoice_number","total"]}}},"email_with_fields":{"summary":"Email, with a field list","value":{"text":"Hi team, I'm Dana Ortiz, VP of Ops at Lumen Freight. Can we move Thursday's demo to Friday Nov 27 at 2pm ET? Reach me at dana@lumenfreight.com or (617) 555-0142.","fields":["name","title","company","email","phone","requested_meeting_time"]}},"job_post_typed_fields":{"summary":"Job post, typed fields","value":{"text":"Senior Backend Engineer (Remote, US). Acme Robotics is hiring! $165k-$190k + equity. 5+ yrs Go or Rust, Postgres, Kubernetes. Apply by Dec 15, 2026.","fields":["job_title","company","location","remote:boolean","salary_min:number","salary_max:number","skills:string[]","apply_by:date"]}}}}}},"x-payment-info":{"protocols":[{"x402":{}}],"price":{"mode":"fixed","currency":"USD","amount":"0.002000"}},"responses":{"200":{"description":"Extracted JSON","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","description":"The extracted JSON. Validates against your schema; values not found in the text are null."},"model":{"type":"string"},"warnings":{"type":"array","items":{"type":"string"}},"missing":{"type":"array","items":{"type":"string"},"description":"Paths of requested fields that were not found in the text (returned as null)."},"note":{"type":"string"}},"required":["data","model","warnings"]},"examples":{"invoice":{"value":{"data":{"invoice_number":"INV-2291","vendor":"Bright Pixel Studio LLC","customer":"Harbor Coffee Co.","due_date":"2026-12-03","total":1371,"currency":"USD","line_items":[{"description":"Logo redesign","quantity":1,"unit_price":1200},{"description":"Business cards (500)","quantity":2,"unit_price":85.5}]},"model":"@cf/meta/llama-4-scout-17b-16e-instruct","warnings":[],"missing":[],"note":"Automated AI extraction. Values come only from the text you send; anything not present is null. Check important values before acting on them."}},"email":{"value":{"data":{"name":"Dana Ortiz","title":"VP of Ops","company":"Lumen Freight","email":"dana@lumenfreight.com","phone":"(617) 555-0142","requested_meeting_time":"Friday Nov 27 at 2pm ET"},"model":"@cf/meta/llama-4-scout-17b-16e-instruct","warnings":[],"missing":[],"note":"Automated AI extraction. Values come only from the text you send; anything not present is null. Check important values before acting on them."}},"job_post":{"value":{"data":{"job_title":"Senior Backend Engineer","company":"Acme Robotics","location":"US","remote":true,"salary_min":165000,"salary_max":190000,"skills":["Go","Rust","Postgres","Kubernetes"],"apply_by":"2026-12-15"},"model":"@cf/meta/llama-4-scout-17b-16e-instruct","warnings":[],"missing":[],"note":"Automated AI extraction. Values come only from the text you send; anything not present is null. Check important values before acting on them."}}}}}},"400":{"description":"Malformed request (never charged)"},"402":{"description":"Payment Required (x402 v2, PAYMENT-REQUIRED header)"},"413":{"description":"Text too long (never charged)"},"422":{"description":"Model could not produce JSON matching the schema after one retry (never charged)"},"503":{"description":"AI capacity temporarily unavailable (never charged)"}}}},"/extract-lite":{"post":{"operationId":"extract_json_lite","summary":"Free demo: up to 1000 characters and 5 fields, rate limited","description":"Free, rate-limited demo of extract_json: up to 1000 characters of text and 5 fields (or a small schema). Use this to try the service; use extract_json for real work.","tags":["Extraction"],"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":1000,"description":"The unstructured text to extract from (max 1000 characters)."},"schema":{"type":"object","description":"A JSON Schema (type: object, with properties) describing the JSON you want back. Supports type, properties, required, items, enum, description. Provide this OR fields."},"fields":{"type":"array","items":{"type":"string"},"maxItems":40,"description":"Shortcut instead of a schema: field names, optionally typed as name:type where type is string, number, integer, boolean, date, string[], number[] or object[] (e.g. [\"name\", \"email\", \"total:number\", \"skills:string[]\"])."},"instructions":{"type":"string","maxLength":500,"description":"Optional extra guidance, e.g. 'dates as YYYY-MM-DD', 'amounts in USD'."}},"required":["text"]},"examples":{"invoice_with_schema":{"summary":"Invoice, with a JSON Schema","value":{"text":"INVOICE #INV-2291\nBright Pixel Studio LLC, 44 Market St, Portland OR\nBill to: Harbor Coffee Co.\nDate: Nov 3, 2026  Due: Dec 3, 2026\nLogo redesign 1 x $1,200.00\nBusiness cards (500) 2 x $85.50\nTOTAL DUE: $1,371.00 USD","schema":{"type":"object","properties":{"invoice_number":{"type":"string"},"vendor":{"type":"string"},"customer":{"type":"string"},"due_date":{"type":"string","description":"YYYY-MM-DD"},"total":{"type":"number"},"currency":{"type":"string"},"line_items":{"type":"array","items":{"type":"object","properties":{"description":{"type":"string"},"quantity":{"type":"number"},"unit_price":{"type":"number"}}}}},"required":["invoice_number","total"]}}},"email_with_fields":{"summary":"Email, with a field list","value":{"text":"Hi team, I'm Dana Ortiz, VP of Ops at Lumen Freight. Can we move Thursday's demo to Friday Nov 27 at 2pm ET? Reach me at dana@lumenfreight.com or (617) 555-0142.","fields":["name","title","company","email","phone","requested_meeting_time"]}},"job_post_typed_fields":{"summary":"Job post, typed fields","value":{"text":"Senior Backend Engineer (Remote, US). Acme Robotics is hiring! $165k-$190k + equity. 5+ yrs Go or Rust, Postgres, Kubernetes. Apply by Dec 15, 2026.","fields":["job_title","company","location","remote:boolean","salary_min:number","salary_max:number","skills:string[]","apply_by:date"]}}}}}},"responses":{"200":{"description":"Extracted JSON","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","description":"The extracted JSON. Validates against your schema; values not found in the text are null."},"model":{"type":"string"},"warnings":{"type":"array","items":{"type":"string"}},"missing":{"type":"array","items":{"type":"string"},"description":"Paths of requested fields that were not found in the text (returned as null)."},"note":{"type":"string"}},"required":["data","model","warnings"]},"examples":{"invoice":{"value":{"data":{"invoice_number":"INV-2291","vendor":"Bright Pixel Studio LLC","customer":"Harbor Coffee Co.","due_date":"2026-12-03","total":1371,"currency":"USD","line_items":[{"description":"Logo redesign","quantity":1,"unit_price":1200},{"description":"Business cards (500)","quantity":2,"unit_price":85.5}]},"model":"@cf/meta/llama-4-scout-17b-16e-instruct","warnings":[],"missing":[],"note":"Automated AI extraction. Values come only from the text you send; anything not present is null. Check important values before acting on them."}},"email":{"value":{"data":{"name":"Dana Ortiz","title":"VP of Ops","company":"Lumen Freight","email":"dana@lumenfreight.com","phone":"(617) 555-0142","requested_meeting_time":"Friday Nov 27 at 2pm ET"},"model":"@cf/meta/llama-4-scout-17b-16e-instruct","warnings":[],"missing":[],"note":"Automated AI extraction. Values come only from the text you send; anything not present is null. Check important values before acting on them."}},"job_post":{"value":{"data":{"job_title":"Senior Backend Engineer","company":"Acme Robotics","location":"US","remote":true,"salary_min":165000,"salary_max":190000,"skills":["Go","Rust","Postgres","Kubernetes"],"apply_by":"2026-12-15"},"model":"@cf/meta/llama-4-scout-17b-16e-instruct","warnings":[],"missing":[],"note":"Automated AI extraction. Values come only from the text you send; anything not present is null. Check important values before acting on them."}}}}}},"400":{"description":"Malformed request (never charged)"},"413":{"description":"Text too long (never charged)"},"422":{"description":"Model could not produce JSON matching the schema after one retry (never charged)"},"429":{"description":"Rate limited"},"503":{"description":"AI capacity temporarily unavailable (never charged)"}}}}},"x-x402":{"network":"eip155:8453","asset":"USDC","facilitator":"https://api.cdp.coinbase.com/platform/v2/x402","payTo":"0x59D0D643f1c91ACa0B1dcd4bE20edF188645845f","mcp":"https://extract-json.mintfacts.workers.dev/mcp"}}