Overview
This cookbook demonstrates how to analyze contracts using Aifano’s Parse and Extract endpoints. You’ll learn to extract parties, dates, key clauses, and obligations from legal documents — turning dense PDFs into structured, queryable data.What You’ll Build
A workflow that:- Parses a contract into structured sections
- Extracts key metadata (parties, dates, terms)
- Identifies specific clauses (termination, liability, confidentiality)
Step 1: Parse the Contract
First, parse the contract to get the full text with section structure:Step 2: Extract Key Contract Data
Use the job reference from Step 1 to extract structured data without re-parsing:Python
Step 3: Example Output
Step 4: Split Multi-Section Contracts
For contracts with multiple sections (e.g., MSA + SOW + NDA), use Split first:Python
Tips
Use jobid:// to save credits
Use jobid:// to save credits
Parse once, then extract multiple times with different schemas using
jobid://. This avoids re-parsing and saves 1 credit per page each time.Be specific in your schema descriptions
Be specific in your schema descriptions
Add
description fields to guide extraction. For example, specify date formats, currency expectations, or what constitutes a “termination clause.”Combine Split + Extract for bundled contracts
Combine Split + Extract for bundled contracts
Split the document first to identify sections, then extract from each section individually for more accurate results.
Next Steps
- Invoice Processing — Extract financial data from invoices
- Multi-Document Pipelines — Build automated document workflows