FastAPI backend for PDF data extraction using pdfplumber.
paste the backend URL into the frontend settings panel:
https://backendurl.com
save and test. if the dot turns green, you're good.
# install dependencies
pip install -r requirements.txt
# run server
uvicorn main:app --reload
# test
curl -X POST http://localhost:8000/extract \
-F "file=@test.pdf"GET / — api info
GET /health — health check
POST /extract — extract data from PDF
- body: multipart form with
filefield - returns: JSON with extracted rows
- pdfplumber extracts tables from PDFs
- first row of each table becomes column headers
- all data rows are returned as JSON objects
- if no tables found, falls back to text pattern matching for common fields (invoice number, date, amounts, etc.)
main.py — FastAPI application
requirements.txt — Python dependencies
Procfile — Railway start command
railway.json — Railway config
.gitignore — Git ignore rules