Overview
Pulse API is designed to handle documents of any size, from single-page memos to thousand-page reports. This guide covers strategies for efficiently processing large documents while maintaining accuracy and minimizing costs. Very large files are defined as documents with 100+ pages, which require special handling for optimal performance.Size Thresholds
Understanding these thresholds helps you choose the right processing strategy:
Automatic Optimizations
Smart Async Switching
The production client automatically switches to async mode for large files:Large Result Download Links
For documents over 70 pages, spreadsheet extractions, or any response payload above the 5 MB inline threshold, results are returned as a one-time download link of the formhttps://api.runpulse.com/results/{job_id}. Fetching the link returns the complete result JSON with the same shape as an inline response:
Processing Strategies
1. Full Document Processing
Process entire documents when you need complete context:2. Page Range Processing
Extract specific sections to reduce processing time:- Single page:
"5"— extracts the 5th page - Range:
"10-20"— extracts pages 10 through 20 (inclusive) - Multiple ranges:
"1-5,10-15,20"— extracts pages 1-5, 10-15, and page 20 - Mixed:
"1,3,5-10,15"— extracts pages 1, 3, 5-10, and 15
3. Chunked Processing
For very large documents, process in chunks:4. Selective Extraction
Extract only what you need to minimize processing:Async Processing Deep Dive
Starting Async Jobs
Polling for Completion
Parallel Processing
Process multiple large documents simultaneously:Optimization Techniques
1. Memory Management
For very large responses:2. Cost Optimization
Minimize pages processed to reduce costs:3. Performance Monitoring
Track processing performance:Common Patterns
Legal Document Processing
Financial Report Analysis
Error Handling
Handling Large Document Errors
Best Practices Summary
Use Async for Large Files
Use Async for Large Files
- Always use async processing for files > 50 pages
- Let the client auto-detect when to use async
- Implement proper polling with backoff
Optimize Page Ranges
Optimize Page Ranges
- Process only the pages you need
- Extract TOC first to navigate large documents
- Use chunking for very large documents
Handle Large Result Download Links
Handle Large Result Download Links
- Check for
is_urlin responses and readurl(ahttps://api.runpulse.com/results/{job_id}link) - Treat the link as one-time use: download and persist on the first read
- The link expires 1 hour after job completion — fetch promptly
- Authenticate the GET with your
x-api-keyheader
Monitor Performance
Monitor Performance
- Track processing times and costs
- Adjust chunk sizes based on document type
- Use concurrent processing for multiple files
Next Steps
Async Processing
Async flag, polling, and webhooks
Error Handling
Handle errors in large documents