A simple web interface for testing the OCR and Markdown Conversion API.
docker-compose up -dhttp://localhost:9000The OCR and Markdown Conversion API allows you to convert image files and documents into Markdown format. It provides the following endpoints:
Upload one or more files to be processed by the OCR engine.
Endpoint: POST /upload/
Parameters:
files (required): Array of files to uploadforce_ocr (optional): Boolean to force OCR processing even if text is detected (default: true)Response:
{
"total_processing_time_seconds": 1.39,
"results": [
{
"file_name": "text-image-title.png",
"page_count": 1,
"processing_time_seconds": 1.39,
"status": "Success",
"content_preview": "# Page 1\n\n```\nHOW TO COMBINE\nTEXT AND IMAGE\nIN ELEARNING DESIGN\n\n```\n\n-----\n\n---",
"markdown_content": "# Page 1\n\n```\nHOW TO COMBINE\nTEXT AND IMAGE\nIN ELEARNING DESIGN\n\n```\n\n-----\n\n---",
"ocr_pdf_id": null,
"markdown_id": "7f8f10c8-d51b-4773-9db8-5e748f12aa3d",
"file_id": "413a9347-79ce-434e-bfac-27eab54db928"
}
]
}
Check the processing status of an uploaded file.
Endpoint: GET /progress/{file_id}
Parameters:
file_id (required): ID of the file to checkResponse:
A string containing the progress information.
Download the converted Markdown file.
Endpoint: GET /download-markdown/{md_id}
Parameters:
md_id (required): ID of the Markdown file to downloadResponse:
A string containing the Markdown content.
Remove a stored file from the server.
Endpoint: DELETE /cleanup/{file_id}
Parameters:
file_id (required): ID of the file to clean upResponse:
A string confirming the cleanup operation.
Check the health status of the API.
Endpoint: GET /health
Response:
A string containing the health status information.
When you upload a file, the API returns a JSON response with the following information:
total_processing_time_seconds: Total time taken to process all filesresults: Array of processing results for each file
file_name: Original name of the uploaded filepage_count: Number of pages in the documentprocessing_time_seconds: Time taken to process this specific filestatus: Processing status (Success, Failed, etc.)content_preview: A preview of the extracted contentmarkdown_content: The full Markdown content of the processed fileocr_pdf_id: ID for the OCR processed PDF (if applicable)markdown_id: ID for the Markdown content (used for downloading)file_id: ID for the uploaded file (used for progress checking and cleanup)The API URL is set to http://192.168.1.151:8000 by default. You can change this by clicking the "Change" button next to the API URL at the top of the interface.
This interface is containerized using Docker. To run it:
docker-compose up -d in the directory containing the docker-compose.yml filehttp://localhost:9000To stop the container, run docker-compose down.