Custom Extraction API
CUSTOM EXTRACTION — POST {content, schema} and get structured JSON back. Define fields as {"company":"string","total":"number","due_date":"date"} (types or plain-language descriptions) and the engine pulls them from any unstructured text: emails, invoices, job posts, resumes, chat logs. Missing fields return null — never invented. Content up to 16,000 chars, 40 fields max. Parsing a PDF/DOCX/CSV by URL first? GET /api/extract ($0.02).
Parameters
| Name | In | Description | |
|---|---|---|---|
content | body | required | The unstructured text to extract from, up to 16,000 characters |
schema | body | required | Fields to extract: {name: type-or-description}. Types: string, number, boolean, date, string[], number[] — or a plain-language description ('the total in USD') |
instructions | body | Optional extra guidance, e.g. 'dates are DD/MM/YYYY in this document' |
Example request
curl -X POST "https://api.webbersites.com/api/extract/custom" \
-H "Content-Type: application/json" \
-d '{"content":"Hi \u2014 invoice INV-2041 from Acme Corp is attached. Total is $1,284.50, due August 15th. Thanks, Dana","schema":{"company":"string","invoice_number":"string","total":"number","due_date":"date"}}'
# first call returns 402 + payment requirements; an x402 client pays and retries automaticallyExample response
{
"data": {
"company": "Acme Corp",
"invoice_number": "INV-2041",
"total": 1284.5,
"due_date": "2026-08-15"
},
"missing": [],
"model": "gemini-2.5-flash-lite"
}How payment works
There is no signup and no API key. Call the endpoint; it replies 402 Payment Required with machine-readable payment requirements. Your client signs a USDC transfer authorization (EIP-3009, gasless) and retries with the X-PAYMENT header — @x402/fetch does this automatically. See the overview for a working snippet.