Production-grade OCR REST API powered by Tesseract + FastAPI.
Supports images & PDFs, multi-language, confidence scoring, dark web UI.
Live Demo → vaexor-ocr.onrender.com
Portfolio → vaexor.netlify.app — see more projects by Ryden
- Multi-format — PNG, JPG, WEBP, BMP, TIFF, GIF, PDF
- languages — English, Hindi, French, German, Spanish, Chinese, Japanese, Arabic & more etc.
- Confidence scores — per-word + overall accuracy %
- Image preprocessing — auto contrast & sharpening for better results
- PDF support — multi-page, rendered at 200 DPI
- Base64 endpoint — send images as JSON
- Rate limiting — No Limit😺
- Web UI — dark glassmorphism test page at
/ - Auto docs — Swagger at
/docs, ReDoc at/redoc - Give star If You Like It💖
| Method | Path | Description |
|---|---|---|
GET |
/ |
Web UI |
POST |
/ocr |
Upload file → extract text |
POST |
/ocr/base64 |
Base64 image → extract text |
GET |
/languages |
List supported languages |
GET |
/health |
Health check + Tesseract version |
GET |
/docs |
Swagger UI |
curl -X POST https://vaexor-ocr.onrender.com/ocr \
-F "file=@invoice.png" \
-F "lang=eng" \
-F "psm=3" \
-F "enhance=true"curl -X POST https://vaexor-ocr.onrender.com/ocr/base64 \
-H "Content-Type: application/json" \
-d '{"image": "<base64string>", "lang": "eng"}'{
"success": true,
"request_id": "a3f1b2c4",
"filename": "invoice.png",
"lang": "eng",
"pages": 1,
"text": "Hello World\nThis is extracted text.",
"confidence": 87.4,
"word_count": 6,
"words": [
{ "word": "Hello", "confidence": 95 },
{ "word": "World", "confidence": 91 }
],
"processing_time_ms": 312.5
}| PSM | Description |
|---|---|
| 3 | Fully automatic — recommended |
| 4 | Single column of text |
| 6 | Single uniform block |
| 7 | Single text line |
| 8 | Single word |
| 11 | Sparse text |
1. Install system deps
# Ubuntu / Debian / WSL
sudo apt-get install tesseract-ocr tesseract-ocr-eng tesseract-ocr-hin poppler-utils
# macOS
brew install tesseract poppler2. Install Python deps
pip install -r requirements.txt3. Start the server
uvicorn main:app --reloadOpen → http://localhost:8000
This project uses a Dockerfile — Render detects it automatically. No build or start commands needed.
Steps:
- Push this repo to GitHub
- Go to render.com → New → Web Service
- Connect your GitHub repo
- Render auto-detects the
Dockerfile— just hit Deploy - Done ✅
The
Dockerfilehandles everything: installs Tesseract, Poppler, and all Python deps.
Port is set to10000inside the Dockerfile — Render picks it up automatically.
Optional env vars (set in Render dashboard if needed):
| Variable | Default | Description |
|---|---|---|
MAX_FILE_MB |
10 |
Max upload size in MB |
vaexor-ocr/
├── main.py ← FastAPI app
├── requirements.txt ← Python dependencies
├── Dockerfile ← Handles system deps + server start
└── templates/
└── index.html ← Web UI
MIT License — © 2026 Vaexor / Ryden
Permission is hereby granted, free of charge, to any person obtaining a copy of this software to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.