Skip to main content
Before you begin, make sure you have:
  1. A Datalab account with an API key
  2. Python 3.11+ installed
  3. The Datalab SDK: pip install datalab-python-sdk
  4. Your DATALAB_API_KEY environment variable set
Process directories of documents with the SDK or CLI. Both handle rate limiting and retries automatically.

SDK Batch Processing

Process multiple files using Python’s async capabilities:

Async Batch Processing

For higher throughput:

CLI Batch Processing

The CLI handles directory processing automatically:
See CLI Reference for all options.

REST API Batch Processing

Start with the complete Python requests example for submitting a document, checking failures, and retrieving inline or downloaded results. Use a bounded worker pool to process multiple documents and reuse a session within each worker.
A timed-out submission may have been accepted. Avoid automatically replaying a POST after a connection error or timeout: it can create another job. Poll a known request ID when available. See SDK retry behavior.

Rate Limits

  • Request rate limit: 25 requests per minute on Free, 400 on Launch and Team (429 on exceed)
  • Concurrent request limit: 25 on Free, 400 on Launch and Team (429 on exceed)
  • Page concurrency limit: 5,000 pages in flight across all requests — this is enforced during processing, not at submission. Results return with success: false if exceeded. Always check the success field when polling for results.
  • The SDK and CLI retry supported transient submission and polling errors; retry behavior depends on the request type
  • For higher limits, contact support@datalab.to
See API Limits for details.

Tips

  1. Use async for high throughput - Async processing handles many concurrent requests efficiently
  2. Limit concurrency - Start with 5-10 concurrent requests and adjust based on your rate limits
  3. Handle failures gracefully - Check success for each result and record failed files so you can retry them selectively
  4. Save progress - Write results incrementally to avoid losing work on long batches

Next Steps

Document Conversion

Learn more about Marker’s conversion API and output formats.

API Limits

Understand rate limits and how to optimize throughput.

Pipelines

Chain processors into versioned, reusable pipelines.

Webhooks

Get notified when batch conversions complete via webhooks.