Documentazione API
| Metodo |
Endpoint |
Descrizione |
| GET |
/api/ocr/health |
Stato del servizio |
| POST |
/api/ocr/ocr |
Invio file per OCR tramite multipart/form-data |
| GET |
/api/ocr/files/<nome_file> |
Download del file elaborato |
Formato richiesta
POST /api/ocr/ocr
Content-Type: multipart/form-data
Campo richiesto:
file = file da elaborare
Formati ammessi:
.jpg
.jpeg
.png
.pdf
Esempio CURL PDF
curl -X POST "/api/ocr/ocr" -F "file=@/percorso/documento.pdf"
Esempio CURL immagine
curl -X POST "/api/ocr/ocr" -F "file=@/percorso/immagine.png"
Risposta di successo
{
"success": true,
"filename_originale": "file.pdf",
"filename_output": "xxx_file_ocr.pdf",
"content_type_output": "application/pdf",
"ocr_text": "testo estratto",
"download_url": "https://paddle.icpservices.eu/api/ocr/files/xxx_file_ocr.pdf"
}
Risposta di errore
{
"success": false,
"error_type": "HTTPException",
"message": "descrizione errore",
"path": "/ocr",
"details": "...",
"debug": {
"method": "POST",
"url": "...",
"client": "..."
}
}