Skip to main content
Convert PDFs, Word documents, spreadsheets, and images to machine-readable formats. Marker handles complex layouts, tables, math, and images. Before you begin, make sure you have:
  1. A Datalab account with an API key (new accounts include $5 in free credits)
  2. Python 3.10+ installed
  3. The Datalab SDK: pip install datalab-python-sdk
  4. Your DATALAB_API_KEY environment variable set
Building for production? Use Pipelines to chain processors, version your configuration, and deploy with a single API call.

Quick Start

The SDK handles polling automatically. For the REST API, submit a request and poll request_check_url. A status of complete means processing has ended; check success before reading the output. Failed jobs can return status="complete" with success=false and an error message. See SDK Conversion for complete SDK documentation.
File limits: Maximum file size is 200 MB, with up to 7,000 pages per request. See API Limits for the full list.

Regional Result Downloads

Convert, Extract, and Segment requests processed in the EU return a signed result_url when complete. Document content is downloaded from that URL instead of being included inline in the polling response. Check for result_url regardless of the requested region. The Python requests example above handles both forms. Download the URL without an X-API-Key header: the URL itself authorizes access. expires_in gives its lifetime in seconds; poll request_check_url again for a fresh URL if needed while the result remains retained. Downloaded extraction results can contain extraction_schema_json as an object, while the API response encodes it as a JSON string. Decode it with json.loads() only when it is a string. Keep the non-null fields from the polling response when combining it with the downloaded JSON, since billing and confidence scores can be updated after the document result was stored. Continue polling request_check_url, rather than the download URL, for these updates.
Python SDK 0.5.0 does not follow result_url for convert(), extract(), or segment(). Use the REST polling and download flow for EU results; an empty SDK content field does not establish that the document was empty.

Parameters

Core Parameters

Which output format should I use?
  • LLM/RAG pipelines → markdown (default, most compatible)
  • Web display → html (preserves visual structure)
  • Programmatic access to blocks → json (includes bounding boxes and block types)
  • Embedding and search → chunks (pre-chunked for vector databases)

Processing Modes

Which mode should I use?
  • Most use cases → balanced (recommended default)
  • Simple, clean PDFs at high throughput → fast
  • Scanned documents, complex tables, or dense layouts → accurate

Page Control

Image Handling

Advanced Options

For structured extraction, use the Extract API. For document segmentation, use the Segment API.
The track_changes extra is supported on this endpoint. You can also use the dedicated Track Changes endpoint.

Bounding Box Add-ons

Three add-ons annotate HTML output with spatial coordinates and confidence scores. At standard rates, word prediction costs 3per1Kpages∗∗,andeachstructuraladd−oncostsanother∗∗3 per 1K pages**, and each structural add-on costs another **3 per 1K pages. These charges are added to conversion. Use html output to expose the attributes. Regional and account pricing can change these rates; see Billing.
table_cell_bboxes and list_item_bboxes run and bill word prediction internally, but do not emit per-word spans unless you also set word_bboxes=True. Adding that flag to a request with structural boxes exposes the word spans without charging word prediction twice.

Additional Config Options

Pass as JSON string in additional_config: Example:

PDF Bookmarks

Use extras="extract_bookmarks" to read the PDF’s stored outline. metadata.pdf_bookmarks is a tree of objects with title, page, and children. page is an original, 0-indexed page number, or null when the destination cannot be resolved. These are the PDF’s authored bookmarks, not headings inferred from its content.
Check metadata.pdf_bookmarks_truncated: true means extraction was incomplete because of a safety limit or extraction failure. An empty bookmark list with this flag set does not establish that the PDF has no bookmarks.

Response Fields

Examples

Convert with High Accuracy

HTML with Block IDs for Citations

Process Specific Pages

Process Specific Sheets from a Spreadsheet

For spreadsheet files, page_range filters by sheet index (0-based):

Extract Track Changes

Parse Quality Score

Every conversion response includes a parse_quality_score (0-5) that indicates how well the document was parsed: Use quality scores to build automated quality gates:
Use quality scores to gate pipeline execution or route documents to different processing configurations.

Checkpoints

Save a processing checkpoint to reuse parsed results for extraction or segmentation without re-processing:
Checkpoints save time and cost when you need to run multiple operations (extraction, segmentation) on the same document.
Results are deleted from Datalab servers about one day after processing completes, or sooner if you delete them with DELETE /api/v1/results/{request_id}. Retrieve your results promptly.

Next Steps

Structured Extraction

Extract structured data from documents using JSON schemas

Batch Processing

Process multiple documents concurrently

Document Segmentation

Split multi-document PDFs into segments

Webhooks

Get notified when conversions complete