Skip to main content
POST
/
api
/
v1
/
marker
Marker
curl --request POST \
  --url https://www.datalab.to/api/v1/marker \
  --header 'Content-Type: multipart/form-data' \
  --header 'X-API-Key: <api-key>' \
  --form 'file_url=<string>' \
  --form mode=fast \
  --form max_pages=123 \
  --form 'page_range=<string>' \
  --form 'langs=<string>' \
  --form force_ocr=false \
  --form format_lines=false \
  --form paginate=false \
  --form add_block_ids=false \
  --form strip_existing_ocr=false \
  --form disable_image_extraction=false \
  --form disable_image_captions=false \
  --form disable_ocr_math=false \
  --form use_llm=false \
  --form 'output_format=<string>' \
  --form skip_cache=false \
  --form save_checkpoint=false \
  --form 'block_correction_prompt=<string>' \
  --form 'page_schema=<string>' \
  --form 'segmentation_schema=<string>' \
  --form 'additional_config=<string>' \
  --form workflowstepdata_id=123 \
  --form 'extras=<string>' \
  --form 'webhook_url=<string>' \
  --form 'file=<string>' \
  --form file.0='@example-file'
{
  "request_id": "<string>",
  "request_check_url": "<string>",
  "success": true,
  "error": "<string>",
  "versions": {}
}

Authorizations

X-API-Key
string
header
required

Cookies

wos-session
string
access_token
string
datalab_active_team
string

Body

multipart/form-data
file_url
string | null

Optional file URL (http/https). If provided, the server will download and process it.

mode
string
default:fast

Which output mode to use. Valid values: 'fast' (lowest latency, great for real-time use cases), 'balanced' (balanced accuracy and latency, works well with most documents), 'accurate' (highest accuracy and latency, good on the most complex documents).

max_pages
integer | null

The maximum number of pages in the PDF to convert.

page_range
string | null

The page range to parse, comma separated like 0,5-10,20. This will override max_pages if provided. Example: '0,2-4' will process pages 0, 2, 3, and 4.

langs
string | null

Note: This parameter has been deprecated, and will be ignored in the current version. The languages to use if OCR is needed, comma separated. Must be either the names or codes from https://github.com/datalab-to/surya/blob/master/surya/languages.py. Any other inputs will be ignored.

force_ocr
boolean
default:false
deprecated

[DEPRECATED] This parameter is deprecated and has no effect. OCR is handled automatically by the parsing pipeline.

format_lines
boolean
default:false
deprecated

[DEPRECATED] This parameter is deprecated and has no effect. Line formatting is handled automatically by the parsing pipeline.

paginate
boolean
default:false

Whether to paginate the output. Defaults to False. If set to True, each page of the output will be separated by a horizontal rule that contains the page number (2 newlines, {PAGE_NUMBER}, 48 - characters, 2 newlines).

add_block_ids
boolean
default:false

Add data-block-id attributes to HTML elements for citation tracking. Only applies when output_format includes 'html'.

strip_existing_ocr
boolean
default:false
deprecated

[DEPRECATED] This parameter is deprecated and has no effect. OCR handling is managed automatically by the parsing pipeline.

disable_image_extraction
boolean
default:false

Disable image extraction from the PDF. If use_llm is also set, then images will be automatically captioned. Defaults to False.

disable_image_captions
boolean
default:false

Disable synthetic image captions/descriptions in output. Images will be rendered as plain img tags without alt text or the img-description wrapper div. Defaults to False.

disable_ocr_math
boolean
default:false
deprecated

[DEPRECATED] This parameter is deprecated and has no effect. Math recognition is handled automatically by the parsing pipeline.

use_llm
boolean
default:false
deprecated

[DEPRECATED] This parameter is deprecated. Use the 'mode' parameter instead: 'balanced' or 'accurate' modes.

output_format
string | null

The output format for the text. Can be 'json', 'html', 'markdown', or 'chunks'. Defaults to 'markdown'. You can comma separate multiple formats, like markdown,html.

skip_cache
boolean
default:false

Skip the cache and re-run the inference. Defaults to False. If set to True, the cache will be skipped and the inference will be re-run.

save_checkpoint
boolean
default:false

Save the checkpoint after processing. Defaults to False. This is only useful if you're applying custom rules iteratively.

block_correction_prompt
string | null
deprecated

[DEPRECATED] This parameter is deprecated and has no effect. Block correction is not currently supported.

page_schema
string | null

The schema to use for structured extraction (only used with structured extraction endpoint). The ideal way to generate this is to create a Pydantic schema, then convert to JSON with .model_dump_json().

segmentation_schema
string | null

The schema to use for document segmentation. Should be a JSON string containing segment names and descriptions for identifying page ranges of different document sections.

additional_config
string | null

Additional configuration options as a JSON string. Only these keys have effect: 'keep_pageheader_in_output' (bool), 'keep_pagefooter_in_output' (bool), 'keep_spreadsheet_formatting' (bool).

workflowstepdata_id
integer | null

Optional workflow step data ID. If provided, this request will be associated with the specified workflow step execution.

extras
string | null

Comma-separated list of extra features to enable. Currently supports: 'track_changes', 'chart_understanding', 'table_row_bboxes', 'extract_links', 'infographic', 'new_block_types'.

webhook_url
string | null

Optional webhook URL to call when the request is complete. If provided, this will override the webhook URL stored in your account settings for this specific request.

file
file | null

Input PDF, word document, powerpoint, or image file, uploaded as multipart form data. Images must be png, jpg, or webp format.

Response

Successful Response

request_id
string
required

The ID of the request. This ID can be used to check the status of the request.

request_check_url
string
required

The URL to check the status of the request and get results.

success
boolean
default:true

Whether the request was successful.

error
string | null

If the request was not successful, this will contain an error message.

versions

A dictionary of the versions of the libraries used in the request.