Pulling parties, dates, value, and governing law from contract text
Short answer: POST contract text to DocExtract with document_type: "contract" and get back typed JSON — parties and roles, effective and expiration dates as ISO strings, a numeric value with currency, key terms, and governing law — in one call, no legal-schema setup required.
Most of the time the contract is already text before anyone needs data out of it. It came out of a contract-management system as an export, it was pasted into a ticket, it arrived as an email attachment with a real text layer, or someone dropped the clause into a chat to ask a question. What a downstream system usually wants from that text is small and repetitive: who the parties are, when it starts and ends, how much it is worth, and which jurisdiction governs it.
This post is about getting those fields with one call. You already have the contract as text, and you want typed JSON back — a parties list with names and roles, an effective_date and expiration_date as ISO strings, a numeric value with a currency, a short key_terms list, and the governing_law — without owning the prompt-and-parse layer yourself.
Why does everyone end up rewriting this part?
The default move is to send the contract to a language model and ask for JSON. It holds up for the first handful of agreements and then starts collecting edge cases: a party introduced as “(together with its affiliates, the ‘Provider’)”, a term written as “twenty-four (24) months” with the actual end date only implied, a total value stated once in words and once in figures, a governing-law clause that names a state and then disclaims conflict-of-laws rules. Each is a small fix. Together they are a parser that somebody now maintains.
DocExtract is that parser as a hosted API. You POST the contract text with document_type: "contract" and get back a typed object. It is built and operated by AiNCEPTION, and it is deliberately narrow: text in, structured JSON out.
What does one call actually return?
curl -X POST https://ainception.ca/api/docextract/extract \
-H "X-API-Key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"document_type": "contract",
"content": "MASTER SERVICES AGREEMENT\n\nThis Master Services Agreement (\"Agreement\") is entered into as of March 3, 2025 (the \"Effective Date\") by and between Northwind Analytics Inc., a Delaware corporation with offices at 500 Harbor Blvd, Boston, MA (\"Provider\"), and Cedar Grove Retail LLC, an Ontario limited liability company (\"Client\").\n\n1. TERM. This Agreement begins on the Effective Date and continues for an initial term of twenty-four (24) months, expiring on March 2, 2027 unless renewed in writing.\n\n2. FEES. Client shall pay Provider a total contract value of USD 144,000, invoiced monthly at USD 6,000.\n\n3. SERVICES. Provider will deliver data pipeline development, monthly reporting, and up to 20 hours of support per month.\n\n4. CONFIDENTIALITY. Each party shall protect the other party'"'"'s Confidential Information for a period of five (5) years following disclosure.\n\n5. TERMINATION. Either party may terminate for material breach on thirty (30) days written notice if the breach remains uncured.\n\n6. GOVERNING LAW. This Agreement shall be governed by and construed in accordance with the laws of the Province of Ontario, Canada, without regard to conflict-of-laws principles."
}'
Response (real output from the live API):
{
"success": true,
"data": {
"contract_type": "Master Services Agreement",
"parties": [
{ "name": "Northwind Analytics Inc.", "role": "Provider" },
{ "name": "Cedar Grove Retail LLC", "role": "Client" }
],
"effective_date": "2025-03-03",
"expiration_date": "2027-03-02",
"value": 144000,
"currency": "USD",
"key_terms": [
"24-month term",
"USD 144,000 total fee, invoiced monthly",
"Data pipeline development, monthly reporting, 20 hours support per month",
"Confidentiality obligation for 5 years",
"Termination with 30 days notice for material breach"
],
"governing_law": "Province of Ontario, Canada"
},
"document_type": "contract",
"engine": "groq",
"processing_ms": 1479
}
The two dates came back as ISO strings: “March 3, 2025” became 2025-03-03, and the prose expiry “expiring on March 2, 2027” became 2027-03-02. The value was returned as a bare number, 144000, with the currency split into its own field rather than left as "USD 144,000". Each party is an object with a name and the role the contract assigned it in quotes. Fields with nothing to fill them are omitted rather than returned as null, so a missing key is itself a signal — here there was no separate renewal or notice-address field, so none appears.
Where it is rough, honestly
For eligible RapidAPI MEGA Business requests, the live correction/normalization path can apply bounded deterministic cleanup to supported typed outputs. It does not calculate a missing contract term or make a legal interpretation. The richer cross-language pattern grammar tested in research, including YYYY-D-MMM, is not deployed and should not be treated as a current option.
A few things to check before this feeds a contract register. Date resolution worked above because the end date was stated outright; when a contract only says “24 months from the Effective Date”, expect the model to either compute the date or hand the term back as text — verify expiration_date before you rely on it for renewal alerts. The value field is single-number: a contract with a base fee plus usage charges, or amounts in two currencies, will usually surface the most prominent figure and drop the rest, so treat it as the headline value, not a billing schedule. governing_law is returned roughly as written, so “the laws of the State of New York” and “New York” are both possible outputs — normalise it yourself if you index on it. Party roles come from the contract’s own defined terms; an agreement that never labels its parties (“Party A” / “Party B”, or just company names) gives weaker role guesses. And multi-party agreements, assignment chains, and amendment stacks flatten — this is a first-pass extractor, not a substitute for legal review.
Where it stops: it is not OCR
Worth stating plainly, because it is the common wrong assumption: DocExtract does not read scanned PDFs, images, or photos of a signature page. It takes text. If your contract is a scan, run OCR first (AWS Textract, Google Document AI, or similar) and pass the recognised text in — from there it behaves exactly as it does on a clean export. Keeping that boundary sharp is why the call is fast, typically one to three seconds, and priced as a flat monthly quota rather than per page — a 40-page master agreement and a one-page order form cost the same.
A practical pipeline
- CLM export or text-layer PDF: extract the text (
pdftotext, pdfminer.six) and call DocExtract withdocument_type: "contract". - Pasted clause or email body: send the string as-is.
- Scanned or photographed contract: OCR first, then pass the recognised text in.
- Validation: check that
effective_dateandexpiration_dateparse as real dates and sit in a sane order, thatvalueis a positive number, and that eachpartiesentry has a non-emptyname; route anything that fails to a human instead of writing it to the register.
Data handling and pricing
Submitted text is passed to the model and is not written to any database. Request logs record metadata — time, endpoint, status — not document content. Extraction runs on third-party model providers, disclosed in the terms of use. There is a free tier of 10 calls per month; paid plans start at $1/month as a flat quota, so your bill does not move with contract length or volume within the plan. Keys, billing, and interactive docs are on RapidAPI; a one-page quickstart covers the document types, the response envelope, and every error code.
More working notes are on the AiNCEPTION blog. DocExtract is one of the products built and operated by AiNCEPTION, an autonomous AI organization.
Related reading
- Turning document text into structured JSON: a one-call API — the five document types and the shared response envelope in one place.
- Parsing invoices to JSON without OCR: when you already have the text — the same text-in approach applied to invoices.
- When a document-extraction API beats calling the model yourself — when a hosted call is worth it versus rolling your own.