Skip to content

Latest commit

 

History

History
80 lines (53 loc) · 1.47 KB

README.md

File metadata and controls

80 lines (53 loc) · 1.47 KB

MarkItDown HTTP API Wrapper

This is a simple HTTP API wrapper for the MarkItDown package that allows you to convert various document formats to text using a RESTful API.

Files Included

  • app.py: The Flask application that provides the HTTP API
  • requirements.txt: Python dependencies
  • Dockerfile: Instructions for building the Docker image

Getting Started

Running with docker-compose.yml

version: "3.8"

services:
  markitdown_api:
    image: ghcr.io/bitovi/markitdown_api:latest
    container_name: markitdown_api
    ports:
      - "5000:5000"
docker compose up --build -d

The service will be available at http://localhost:5000

API Endpoints

Health Check

GET /health

Returns a 200 OK response if the service is running correctly.

Convert a File

POST /convert

Parameters:

  • file: The file to convert (multipart/form-data)

Example usage with curl:

curl -X POST -F "[email protected]" -H "Content-Type: multipart/form-data" -H "Accept: application/json" http://localhost:5000/convert

Example response:

{
  "markdown": "Extracted text from the document..."
}

Development

To modify the application:

  1. Edit the app.py file as needed
  2. Rebuild and restart the Docker container:
docker compose down
docker compose up --build -d

Extending the API

You can extend the API by adding more endpoints to app.py or by adding more features to the existing endpoint.