FastOCR
v0.3.0OCR scanned PDFs and extract bank statements to Excel, CSV and QuickBooks with FastOCR.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
ocr_file
OCR a local PDF or image with FastOCR and return its text or save a searchable PDF. Uploads the file, runs OCR and waits up to 45 seconds. With output='text' the text is returned; text longer than 20,000 characters is cut, and the full text is written to output_path or to <file>.ocr.txt next to the input file. With output='pdf' the searchable PDF is saved to output_path or to <file>.searchable.pdf next to the input file. Either default file replaces an earlier result with the same name. Each processed page uses one page of the account's balance;…
| Parameter | Type | Description |
|---|---|---|
path * | string | Absolute path to a local PDF, PNG, JPG, JPEG, GIF, WebP or BMP file. |
output | string | 'text' returns the extracted text; 'pdf' saves a searchable PDF with a text layer. |
output_path | Optional absolute path for the result file. An existing file there is replaced. |
ocr_pdf
The same tool as ocr_file, kept under its earlier name. Prefer ocr_file.
| Parameter | Type | Description |
|---|---|---|
path * | string | Absolute path to a local PDF, PNG, JPG, JPEG, GIF, WebP or BMP file. |
output | string | 'text' returns the extracted text; 'pdf' saves a searchable PDF with a text layer. |
output_path | Optional absolute path for the result file. An existing file there is replaced. |
get_document
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.
| Parameter | Type | Description |
|---|---|---|
document_id * | string | The document id returned by ocr_file or list_documents. |
output | string | 'status' (default) returns the status at once; 'text' or 'pdf' waits for the document to finish and fetches the result. |
output_path | Optional absolute path for the result file. An existing file there is replaced. |
list_documents
List the most recent documents in the FastOCR account with their status and page counts.
| Parameter | Type | Description |
|---|---|---|
limit | integer | How many documents to return, newest first (1 to 100). |
get_balance
Get how many pages the FastOCR account can still process. Costs no pages. Documents spend free pages first (they reset monthly), then contract pages, then Page Packs. pages_remaining counts the Page Packs only, so add the free and contract pages for the total. contract_* are omitted without an API contract. statement_pages_remaining is a separate balance that OCR does not spend. Check this before OCRing a large PDF; buy_pages_url is where to add pages.
delete_document
Permanently delete a FastOCR document and its stored files (original, text, searchable PDF). A document that is still processing cannot be deleted. Local files are not touched.
| Parameter | Type | Description |
|---|---|---|
document_id * | string | The document id returned by ocr_file or list_documents. |
extract_bank_statement
Extract the transactions of a bank statement with FastOCR and save them as a file. Uploads the statement, waits up to 45 seconds, saves the file (default <statement>.transactions.xlsx beside the input, replacing an earlier one) and returns JSON: the bank, each account with opening and closing balance, totals and whether the printed balances reconcile with the transactions, needs_review, the transaction count and the first transactions. needs_review true means some figures should be checked by a person. Each statement page uses one page of the ac…
| Parameter | Type | Description |
|---|---|---|
path * | string | Absolute path to a local bank statement: PDF, PNG, JPG, JPEG or WebP. |
account | For qbo, quickbooks_csv, qfx and ofx: save only this account (1 is the first). Default: one file per account. | |
format | string | File to save: xlsx (default), csv, json (full structured data), or an accounting file: qbo, quickbooks_csv, qfx, ofx. |
output_path | Optional absolute path for the result file. An existing file there is replaced. | |
transactions | integer | How many of the first transactions to include in the reply (0 to 50). |
get_bank_statement
Wait up to 45 seconds for a bank statement to finish, then save its file and return its summary. Use it after extract_bank_statement returned a statement id. Fetching again costs no pages. If the statement is still processing, call it again with the same arguments. Without output_path the file is saved in the system temp directory.
| Parameter | Type | Description |
|---|---|---|
statement_id * | string | The statement id returned by extract_bank_statement. |
account | For qbo, quickbooks_csv, qfx and ofx: save only this account (1 is the first). Default: one file per account. | |
format | string | File to save: xlsx (default), csv, json (full structured data), or an accounting file: qbo, quickbooks_csv, qfx, ofx. |
output_path | Optional absolute path for the result file. An existing file there is replaced. | |
transactions | integer | How many of the first transactions to include in the reply (0 to 50). |