Skip to main content

Overview

Process multiple documents concurrently to significantly reduce total processing time compared to sequential requests.
These examples require the Python or TypeScript client library. Before running a script, set your API key and install the library and any required dependencies.

Python

Use AsyncLandingAIADE for async document processing

TypeScript

Use concurrent parsing with Promise.all() or p-limit

Python

Use AsyncLandingAIADE when you need to process many lightweight documents (such as invoices, receipts, or forms) efficiently. This async client allows you to send multiple parse requests concurrently using Python’s asyncio, which significantly reduces total processing time compared to sequential requests. The async approach lets you send multiple requests in parallel. While one document is being processed, another request can be sent. The API server handles the actual document processing in the background. To avoid exceeding the pages per hour limits and receiving 429 errors, use a client-side rate limiter like aiolimiter to control concurrency.

TypeScript

Use concurrent parsing when you need to process many lightweight documents (such as invoices, receipts, or forms) efficiently. The TypeScript library’s methods are already asynchronous, allowing you to send multiple parse requests concurrently using JavaScript’s Promise.all() or Promise.allSettled(). This significantly reduces total processing time compared to sequential requests. The concurrent approach lets you send multiple requests in parallel. While one document is being processed, another request can be sent. The API server handles the actual document processing in the background. To avoid exceeding the pages per hour limits and receiving 429 errors, use a concurrency control library like p-limit to limit the number of simultaneous requests.

Basic Concurrent Parsing

Concurrent Parsing with Rate Limiting

To control concurrency and avoid rate limits, use the p-limit library: