Use the Markit REST API to convert PDF, Word, PowerPoint, Excel, and other documents to Markdown programmatically. Integrate document-to-Markdown conversion into your own applications, scripts, or CI/CD pipelines. For interactive use, try the free web converter instead.

CONFIG Conversion Settings Optional settings

Include any of these optional fields in multipart form data requests to control backend parsing behavior.

Field Type Default Valid Values Description
do_ocr boolean true true, false Run OCR on scanned pages or images inside the document.
force_ocr boolean false true, false Force OCR even when the document contains selectable text.
table_mode string off off, fast, accurate Table extraction mode (Docling only). accurate uses a slower ML-based pipeline.
images_scale number 0.5 Positive number (e.g. 0.5, 1, 2) Resolution scale factor for images embedded in the output.
heading_style string ATX ATX, SETEXT Markdown heading style (MarkItDown only). ATX uses # prefixes; SETEXT uses underlines.

API Endpoint Reference

POST /api/convert Convert single document

Convert a single file to Markdown. The request must be sent as multipart/form-data.

Parameters

Field Type Required Description
file file Yes The document to convert (PDF, DOCX, PPTX, XLSX, HTML, CSV, JSON, XML, …).
split_headers boolean No When true, splits the output on top-level headings and returns a ZIP archive instead of a single .md file.
Conversion Settings No See the Conversion Settings section above.
cURL Request
curl -X POST https://mitdown.ca/api/convert \
  -F "file=@report.pdf" \
  -F "split_headers=false"
JSON Response
{
  "conversion_status": "SUCCESS",
  "filename": "report.md",
  "download_url": "/api/download/a1b2c3d4/report.md?is_split=false",
  "is_split": false,
  "markdown": "# Report\n\nContent here…"
}
POST /api/convert/batch Convert multiple documents

Convert multiple files in a single request. The request must be sent as multipart/form-data.

Parameters

Field Type Required Description
files[] file[] Yes One or more files to convert. Repeat the field for each file.
split_headers boolean No When true, each converted file is split on top-level headings.
Conversion Settings No See the Conversion Settings section above.
cURL Request
curl -X POST https://mitdown.ca/api/convert/batch \
  -F "files[]=@doc1.pdf" \
  -F "files[]=@doc2.docx" \
  -F "split_headers=false"
JSON Response
{
  "batch_id": "e5f6g7h8",
  "results": [
    {
      "filename": "doc1.md",
      "status": "SUCCESS",
      "backend_used": "docling",
      "download_url": "/api/download/batch/e5f6g7h8/doc1.md"
    },
    {
      "filename": "doc2.md",
      "status": "SUCCESS",
      "backend_used": "docling",
      "download_url": "/api/download/batch/e5f6g7h8/doc2.md"
    }
  ],
  "download_all_url": "/api/download/batch/e5f6g7h8/all"
}
GET /api/convert/current-backend Get active backend

Returns the conversion backend currently active for this session and the list of formats it supports.

cURL Request
curl https://mitdown.ca/api/convert/current-backend
JSON Response
{
  "current_backend": "markit",
  "supported_formats": ["pdf", "powerpoint", "word", "excel", "html", "json", "xml", "image", "csv", "audio", "zip", "epub", "yaml"]
}
POST /api/convert/switch-backend Switch active backend

Switch the active conversion backend for the current session. Send a JSON body.

Parameters

Field Type Required Valid Values Description
backend string Yes markitdown, docling, markit The backend to activate for subsequent conversions.
cURL Request
curl -X POST https://mitdown.ca/api/convert/switch-backend \
  -H "Content-Type: application/json" \
  -d '{"backend": "docling"}'
JSON Response
{
  "message": "Successfully switched to docling backend",
  "current_backend": "docling"
}
GET /api/download/<id>/<filename> Download single conversion

Download a previously converted file by its conversion ID and filename.

Path Parameters

Parameter Description
id The 32-character `conversion_id` returned in the conversion response.
filename The filename of the generated document.

Query Parameters

Parameter Type Description
is_split boolean Set to true when downloading a split headings ZIP archive.
cURL Request
curl -O "https://mitdown.ca/api/download/a1b2c3d4/report.md"

# For split output:
curl -O "https://mitdown.ca/api/download/a1b2c3d4/report.zip?is_split=true"
GET /api/download/batch/<id>/<filename> Download batch converted file

Download a single converted file from a batch conversion result.

Path Parameters

Parameter Description
id The batch_id returned by the batch conversion route.
filename The filename of the individual converted file.
cURL Request
curl -O "https://mitdown.ca/api/download/batch/e5f6g7h8/doc1.md"
GET /api/download/batch/<id>/all Download batch zip

Download all files from a batch conversion as a single ZIP archive.

Path Parameters

Parameter Description
id The batch_id returned by the batch conversion route.
cURL Request
curl -O "https://mitdown.ca/api/download/batch/e5f6g7h8/all"
GET /api/history Get conversion history

Retrieve the conversion history for the current session.

cURL Request
curl https://mitdown.ca/api/history
JSON Response
{
  "conversion_history": [
    {
      "backend": "markitdown",
      "conversion_id": "a1b2c3d4",
      "download_url": "/api/download/a1b2c3d4/report.md?is_split=false",
      "filename": "report.md",
      "is_batch": false,
      "is_split": false,
      "timestamp": 1716499800000
    }
  ]
}
DELETE /api/history Clear conversion history

Clear all conversion history for the current session.

cURL Request
curl -X DELETE https://mitdown.ca/api/history
JSON Response
{
  "message": "Conversion history cleared successfully"
}