An AI-powered web application that automatically extracts structured information from Bill of Lading (B/L) PDF documents using Google Gemini AI, Tesseract OCR, PyMuPDF, FastAPI, and React. The extracted shipment information is displayed through an interactive dashboard and can be exported as Excel or JSON.
The AI Bill of Lading Extractor is designed to automate the extraction of shipment information from Bill of Lading documents used in the logistics and shipping industry.
Traditional document processing requires manual reading and data entry, which is time-consuming and prone to errors. This project uses Artificial Intelligence and OCR to automatically extract structured information from both digital and scanned Bill of Lading PDFs.
If the uploaded PDF contains embedded text, the application extracts it using PyMuPDF. If the PDF is scanned, it automatically switches to Tesseract OCR. The extracted text is then analyzed by Google Gemini AI, which converts the unstructured text into structured shipment information.
The extracted information is displayed in a responsive React dashboard and can be downloaded as Excel or JSON.
- π Upload Bill of Lading PDF
- π€ AI-powered data extraction using Google Gemini AI
- π Automatic OCR for scanned PDFs
- π Multi-page PDF support
- π’ Shipment Header extraction
- π¦ Container Details extraction
- π Shipment Summary generation
- π₯ Export extracted data to Excel
- π Export extracted data to JSON
- β‘ FastAPI backend
- β React frontend
- π± Responsive user interface
- Supports both digital and scanned Bill of Lading PDFs.
- Automatically detects when OCR is required.
- Uses Google Gemini AI for intelligent document understanding.
- Extracts structured shipment information with high accuracy.
- Generates Excel and JSON reports.
- Clean and responsive React dashboard.
- REST API developed using FastAPI.
- Modular and scalable project architecture.
- React (Vite)
- JavaScript (ES6)
- CSS3
- Axios
- Python
- FastAPI
- Uvicorn
- Google Gemini AI
- Tesseract OCR
- PyMuPDF (fitz)
- Pandas
- OpenPyXL
AI-BL-Extractor/
β
βββ backend/
β βββ app/
β β βββ routes/
β β βββ services/
β β βββ models/
β β βββ utils/
β β βββ main.py
β β
β βββ uploads/
β βββ output/
β βββ requirements.txt
β βββ .env
β
βββ frontend/
β βββ src/
β β βββ api/
β β βββ components/
β β βββ pages/
β β βββ styles/
β β βββ App.jsx
β β βββ main.jsx
β β
β βββ package.json
β βββ vite.config.js
β
βββ screenshots/
β
βββ README.md
βββ API_DOCUMENTATION.md
βββ LICENSE
git clone https://github.com/MdNvD/AI-BL-Extractor.gitcd backend
python -m venv venv
venv\Scripts\activate
pip install -r requirements.txtCreate a .env file:
GEMINI_API_KEY=YOUR_GEMINI_API_KEYRun the backend:
uvicorn app.main:app --reloadBackend URL
http://127.0.0.1:8000
cd frontend
npm install
npm run devFrontend URL
http://localhost:5173
Upload Bill of Lading PDF
β
βΌ
Detect PDF Type
β
ββββββββββββββββ
β β
βΌ βΌ
Digital PDF Scanned PDF
β β
βΌ βΌ
PyMuPDF Tesseract OCR
β β
ββββββββ¬ββββββββ
βΌ
Extracted Text
βΌ
Google Gemini AI
βΌ
Structured Shipment Data
βΌ
Display in React Dashboard
βΌ
Excel / JSON Export
- Carrier
- Bill of Lading Number
- Vessel
- Voyage
- Port of Loading
- Port of Discharge
- Place of Receipt
- Place of Delivery
- Freight
- Shipper
- Consignee
- Notify Party
- Container Number
- Seal Number
- Container Size
- Cartons
- Weight
- CBM
- Total Containers
- Total Cartons
- Total Weight
- Total CBM
The application successfully extracts:
- β Shipment Header
- β Carrier Details
- β Bill of Lading Number
- β Vessel & Voyage
- β Shipper Information
- β Consignee Information
- β Notify Party
- β Container Details
- β Shipment Summary
- β Excel Report
- β JSON Report
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/upload |
Upload Bill of Lading PDF |
| GET | /api/bl-extract/{filename} |
Extract shipment information |
| GET | /api/download/excel/{filename} |
Download Excel report |
| GET | /api/download/json/{filename} |
Download JSON report |
For detailed API documentation, see API_DOCUMENTATION.md.
- User Authentication
- Batch PDF Processing
- Cloud Deployment
- Database Integration
- AI Confidence Score
- Dashboard Analytics
- Search & Filter
- Support for Invoice, Packing List and Commercial Invoice
- Docker Deployment
Mohamed Navith
B.Tech β Computer Science and Engineering
Passionate about Full Stack Development, Artificial Intelligence, and Cloud Technologies.
This project is licensed under the MIT License.
If you found this project helpful, consider giving it a β on GitHub.









