Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vaexor OCR API 🔍

Production-grade OCR REST API powered by Tesseract + FastAPI.
Supports images & PDFs, multi-language, confidence scoring, dark web UI.

Live Demovaexor-ocr.onrender.com
Portfoliovaexor.netlify.app — see more projects by Ryden


Features

  • 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💖

API Endpoints

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

Usage

File Upload

curl -X POST https://vaexor-ocr.onrender.com/ocr \
  -F "file=@invoice.png" \
  -F "lang=eng" \
  -F "psm=3" \
  -F "enhance=true"

Base64 Image

curl -X POST https://vaexor-ocr.onrender.com/ocr/base64 \
  -H "Content-Type: application/json" \
  -d '{"image": "<base64string>", "lang": "eng"}'

Response Format

{
  "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 Modes

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

Run Locally

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 poppler

2. Install Python deps

pip install -r requirements.txt

3. Start the server

uvicorn main:app --reload

Open → http://localhost:8000


Deploy to Render (Free Tier) 🚀

This project uses a Dockerfile — Render detects it automatically. No build or start commands needed.

Steps:

  1. Push this repo to GitHub
  2. Go to render.comNew → Web Service
  3. Connect your GitHub repo
  4. Render auto-detects the Dockerfile — just hit Deploy
  5. Done ✅

The Dockerfile handles everything: installs Tesseract, Poppler, and all Python deps.
Port is set to 10000 inside 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

Project Structure

vaexor-ocr/
├── main.py            ← FastAPI app
├── requirements.txt   ← Python dependencies
├── Dockerfile         ← Handles system deps + server start
└── templates/
    └── index.html     ← Web UI

License

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.

About

OCR API By Vaexor.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages