get_document
Check an OCR document's processing status, then retrieve its extracted text or searchable PDF once ready. Use the document ID from an upload or document list.
Instructions
Get a FastOCR document's status, and optionally its text or searchable PDF.
Statuses: awaiting_upload, processing, completed, partial (the account ran out of pages partway), failed. With output='text' or 'pdf' this waits up to 45 seconds; if the document is still processing, call it again. Fetching a result again costs no pages. Without output_path, long text and PDFs are saved in the system temp directory.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| output | No | 'status' (default) returns the status at once; 'text' or 'pdf' waits for the document to finish and fetches the result. | status |
| document_id | Yes | The document id returned by ocr_file or list_documents. | |
| output_path | No | Optional absolute path for the result file. An existing file there is replaced. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |