Skip to main content

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:
  1. Parses a contract into structured sections
  2. Extracts key metadata (parties, dates, terms)
  3. 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

Parse once, then extract multiple times with different schemas using jobid://. This avoids re-parsing and saves 1 credit per page each time.
Add description fields to guide extraction. For example, specify date formats, currency expectations, or what constitutes a “termination clause.”
Split the document first to identify sections, then extract from each section individually for more accurate results.

Next Steps