FastOCR API
Extract text from documents and structured data from bank statements. The bank statement API is private beta and allowlisted per account. Upload a file, poll for completion, and download the result.
What is the FastOCR REST API?
The FastOCR REST API is a developer platform for automated text extraction from scanned PDFs, images, and financial bank statements across more than 100 languages. Operating on an asynchronous five-step pipeline—create job, presigned S3 upload, initiate processing, poll status, and download output—the API delivers raw text, searchable PDFs with embedded text layers, or structured transaction tables in JSON, CSV, and XLSX formats. Bank statement jobs automatically calculate arithmetic balance tie-outs and source-grounding verification signals to facilitate controlled automation. Every registered developer account includes 50 free document pages per month with API keys managed directly through the developer console.
Getting access
The API is in private beta. Access is allowlisted per account — you cannot generate a key until your account is approved.
- 1Contact us to request API access for your account.
- 2Once approved, create an API key in the developer console.
- 3Pass the key as
Authorization: Bearer <key>on every request.
APIs
FastOCR offers two APIs, each with its own resource type and output formats. Both follow the same five-step flow: create a job, upload the file, start processing, poll for completion, download the result.
Document OCR
Upload a PDF, run OCR, and get extracted text or a searchable PDF. Supports 100+ languages.
Bank Statements
Extract transactions as structured data from bank statement PDFs and images. Get JSON, CSV, or best-effort XLSX, plus balance and source-grounding review signals.
Authentication
All requests require a Bearer token in the Authorization header. Keys are created in the developer console and start with fok_live_.
curl https://api.fastocr.org/v1/documents \
-H "Authorization: Bearer fok_live_abc123..."Pagination
List endpoints return a page of results and an opaque cursor for fetching the next page. Pass the cursor back to get more results.
| Parameter | Default | Description |
|---|---|---|
| limit | 20 | 1–100. Number of items per page. |
| cursor | — | Opaque string from next_cursor in the previous response. |
| status | — | Filter by job status. |
| updated_since | — | ISO 8601 timestamp. Only return jobs updated after this time. |
When next_cursor is null, there are no more pages. The results array is named after the resource — documents or bank_statements.
Idempotency
Create endpoints require an Idempotency-Key header. If a request is retried with the same key and body, the original response is returned. If the body differs, a 409 idempotency_key_conflict error is returned.
curl -X POST https://api.fastocr.org/v1/documents \
-H "Authorization: Bearer $FASTOCR_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"filename":"scan.pdf","size_bytes":1048576}'Errors
A failed job returns HTTP 200 with a terminal status and an error object. HTTP status describes the request, not the work.
{
"error": {
"type": "processing_error",
"code": "timeout",
"message": "This file took too long to process. Please try again.",
"retryable": true,
"request_id": "abc123"
}
}- Match on
code, never onmessage— messages change without notice. - New codes will be added. Treat any unrecognised code as
processing_failed. - Only
buy_pagesreopens a failed job — buy credits, then call/startagain on the same job.
| Code | Type | When | Retryable |
|---|---|---|---|
| buy_pages | insufficient_credits | Out of page credits. | No — buy a pack, then call /start again on the same job. |
| unreadable_statement | invalid_request | Bank statement could not be read. | No |
| unsupported_statement_type | invalid_request | Credit card or loan statement, not a bank account statement. | No |
| password_protected | invalid_request | File is password-protected. | No |
| unreadable_document | invalid_request | PDF could not be read. | No |
| no_text_detected | invalid_request | No readable text was detected in the input. | No |
| corrupted_file | invalid_request | Input is corrupted or unsupported. | No |
| too_many_pages | invalid_request | File exceeds the page cap. | No |
| empty_file | invalid_request | File has no pages. | No |
| timeout | processing_error | Processing ran out of time. | Yes |
| out_of_memory | processing_error | Processing ran out of memory. | Yes |
| processing_failed | processing_error | Anything else. | Yes |
Ready to get started?
Request access, create a key, and try the quickstart.