LeapOCR Documentation
Transform documents into structured data using AI-powered OCR. Complete API reference, SDK guides, and examples for JavaScript, Python, and Go.
LeapOCR provides enterprise-grade document processing with AI-powered data extraction. Transform PDFs and images into structured data, markdown, or custom formats using our powerful API and SDKs.
Get Started in 5 Minutes
Getting Started
Complete walkthrough to process your first document
Choose Your SDK
Pick from JavaScript, Python, Go, or REST API
API Reference
Complete REST API documentation
Use Cases
Real-world examples and patterns
Key Features
- AI-Powered Extraction - Advanced OCR with multiple model options
- Multiple Output Formats - Structured JSON, markdown, or per-page processing
- Custom Schemas - Define your own extraction schemas with JSON Schema
- Custom Instructions - Define your own extraction instructions to guide the model
- Custom Templates - Define your own document templates with predefined schemas, instructions settings
Quick Start
Choose your language to get started:
import { LeapOCR } from "leapocr";
const client = new LeapOCR({ apiKey: process.env.LEAPOCR_API_KEY });
const job = await client.ocr.processURL("https://example.com/invoice.pdf", {
format: "structured",
instructions: "Extract invoice number, date, and total",
});
const result = await client.ocr.waitUntilDone(job.jobId);from leapocr import LeapOCR, ProcessOptions, Format
async with LeapOCR(os.getenv("LEAPOCR_API_KEY")) as client:
result = await client.ocr.process_and_wait(
"https://example.com/invoice.pdf",
options=ProcessOptions(
format=Format.STRUCTURED,
instructions="Extract invoice number, date, and total"
)
)client, _ := ocr.New(os.Getenv("LEAPOCR_API_KEY"))
job, _ := client.ProcessURL(ctx, "https://example.com/invoice.pdf",
ocr.WithFormat(ocr.FormatStructured),
ocr.WithInstructions("Extract invoice number, date, and total"),
)
result, _ := client.WaitUntilDone(ctx, job.ID)# Submit document from URL
curl -X POST https://api.leapocr.com/ocr/uploads/url \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/invoice.pdf",
"format": "structured",
"instructions": "Extract invoice number, date, and total"
}'
# Get result
curl https://api.leapocr.com/ocr/result/{job_id} \
-H "X-API-Key: your-api-key"Processing Models
LeapOCR provides three AI models for document processing:
| Model | Display Name | Description | Credits/Page |
|---|---|---|---|
standard-v1 | Standard v1 | Baseline model, handles all cases | 1 |
english-pro-v1 | English Pro v1 | Premium quality, English documents only | 2 |
pro-v1 | Pro v1 | Highest quality, handles all cases | 3 |
Learn more about Processing Models →
Core Concepts
Understand the fundamentals:
Processing Models
Choose the right AI model for your needs
Output Formats
Understand structured, markdown, and per-page formats
Custom Schemas
Define extraction requirements with JSON Schema
Common Use Cases
- Invoice Processing - Extract accounting data from invoices
- Medical Records - Process clinical documents securely
- Receipt Scanning - Capture expense data from receipts
- Contract Analysis - Extract key terms from legal contracts