JurisFind provides a REST API built with FastAPI. Interactive documentation available at /docs when running locally or in production.
Local development:
http://localhost:8000/api
Production:
http://20.186.113.106/api
Interactive Swagger UI (production): http://20.186.113.106/docs
Interactive Swagger UI (local): http://localhost:8000/docs
- GET
/health - Response:
{"status": "healthy", "message": "Legal case search service is running", "total_cases": 46456}
- POST
/search - Body:
{"query": "breach of contract", "top_k": 5} - Response:
{ "success": true, "query": "breach of contract", "results": [ {"filename": "case_001.pdf", "score": 0.94, "similarity_percentage": 94.3} ], "total_results": 5 }
- POST
/unified/analyze - Body:
{"filename": "case_001.pdf", "source": "database"}sourceis"database"for PDFs from the main index or"uploaded"for a confidential upload. - Response:
{success, filename, text_length, embedding_status, summary, message}
- POST
/unified/ask - Body:
{"filename": "case_001.pdf", "question": "What was the ruling?", "source": "database"} - Response:
{success, filename, question, answer}
- GET
/pdf/{filename} - Response: PDF binary stream (
application/pdf). Downloads from Azure Blob Storage, or falls back to localapi/data/pdfs/.
- GET
/document-stats/{filename} - Response:
{success, filename, stats}with embedding metadata for the analyzed document.
- POST
/upload-confidential-pdf - Body:
multipart/form-datawith afilefield containing the PDF - Response:
{success, filename, message} - The file is saved to the ephemeral
confidential_tmpDocker volume and never reaches Blob Storage.
- POST
/retrieve-similar-cases?filename={name}&top_k=5 - Finds cases in the main FAISS index semantically similar to the uploaded confidential PDF.
- Response:
{success, filename, similar_cases, total_found}
- DELETE
/cleanup-confidential/{filename} - Response:
{success, message}— deletes the uploaded PDF and its embeddings.
- POST
/legal-chat - Body:
{"question": "What constitutes fair use under copyright law?"} - Response:
{success, response, is_legal, domain_filtered}is_legal:falseif the question was detected as non-legal and filtered.
- GET
/list-pdfs— list all available PDFs in Blob or local storage - POST
/analyze-document?filename={name}— analyze a single database PDF (legacy route) - POST
/ask-question{filename, question}— Q&A on a database PDF (legacy route) - DELETE
/cleanup-embeddings/{filename}— remove cached embeddings for a document - DELETE
/legal-chat/clear— reset chatbot conversation history - GET
/legal-chat/stats— chatbot session statistics - POST
/upload-pdf-to-azuremultipart/form-data— upload a PDF to Blob Storage directly - POST
/generate-embeddings-from-azure— rebuild FAISS index from Blob PDFs (admin operation)
Currently no authentication required. For production, implement API keys.
All endpoints return standard HTTP status codes:
200: Success400: Bad Request404: Not Found500: Internal Server Error
Error responses include:
{
"detail": "Error description"
}Nginx enforces 30 requests per minute per IP by default. Requests exceeding this limit receive HTTP 429. The limit is configured in nginx.conf and can be adjusted on the VM.
Configured to allow requests from frontend origin.