REST API for converting documents and web pages to Markdown, powered by microsoft/markitdown.
| Format | Extensions |
|---|---|
.pdf |
|
| Word | .docx |
| PowerPoint | .pptx |
| Excel | .xlsx, .xls |
| HTML | .html, .htm |
| Text / CSV / JSON / XML | .txt, .csv, .json, .xml |
| Images | .jpg, .png, .gif, .webp |
| Audio | .mp3, .wav |
| URL | any web page |
docker compose up --buildAPI will be available at http://localhost:8000.
Swagger UI — http://localhost:8000/docs.
Service health check.
curl http://localhost:8000/health
# {"status":"ok"}Converts a file or URL to Markdown.
Parameters (multipart/form-data, provide one):
| Parameter | Type | Description |
|---|---|---|
file |
file | File to upload |
url |
string | URL of a page or document |
Response:
{
"markdown": "# Title\n\nContent...",
"source": "document.pdf"
}# Convert a file
curl -X POST http://localhost:8000/convert \
-F "[email protected]"
# Convert a URL
curl -X POST http://localhost:8000/convert \
-F "url=https://example.com"
# Markdown only via jq
curl -s -X POST http://localhost:8000/convert \
-F "url=https://example.com" | jq -r .markdownPowerShell:
# File
Invoke-RestMethod -Uri http://localhost:8000/convert `
-Method POST -Form @{ file = Get-Item "document.pdf" }
# URL
Invoke-RestMethod -Uri http://localhost:8000/convert `
-Method POST -Form @{ url = "https://example.com" }python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -e "markitdown/packages/markitdown[all]"
pip install fastapi "uvicorn[standard]" python-multipart pytest httpxuvicorn app.main:app --reload# Unit tests only (no network required)
pytest
# Including integration tests (requires internet)
pytest -m integrationmarkitdown-service/
├── app/
│ └── main.py # FastAPI application
├── tests/
│ ├── fixtures/ # Test files
│ │ ├── sample.html
│ │ └── sample.txt
│ └── test_api.py # Tests
├── markitdown/ # microsoft/markitdown source (git submodule)
├── Dockerfile
├── docker-compose.yml
├── pyproject.toml
├── .gitignore
└── README.md
MIT — see LICENSE.