Skip to main content
Private Beta

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.

  1. 1Contact us to request API access for your account.
  2. 2Once approved, create an API key in the developer console.
  3. 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.

Authentication

All requests require a Bearer token in the Authorization header. Keys are created in the developer console and start with fok_live_.

Authentication
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.

ParameterDefaultDescription
limit201–100. Number of items per page.
cursorOpaque string from next_cursor in the previous response.
statusFilter by job status.
updated_sinceISO 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.

Idempotency-Key header
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 object
{
  "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 on message — messages change without notice.
  • New codes will be added. Treat any unrecognised code as processing_failed.
  • Only buy_pages reopens a failed job — buy credits, then call /start again on the same job.
CodeTypeWhenRetryable
buy_pagesinsufficient_creditsOut of page credits.No — buy a pack, then call /start again on the same job.
unreadable_statementinvalid_requestBank statement could not be read.No
unsupported_statement_typeinvalid_requestCredit card or loan statement, not a bank account statement.No
password_protectedinvalid_requestFile is password-protected.No
unreadable_documentinvalid_requestPDF could not be read.No
no_text_detectedinvalid_requestNo readable text was detected in the input.No
corrupted_fileinvalid_requestInput is corrupted or unsupported.No
too_many_pagesinvalid_requestFile exceeds the page cap.No
empty_fileinvalid_requestFile has no pages.No
timeoutprocessing_errorProcessing ran out of time.Yes
out_of_memoryprocessing_errorProcessing ran out of memory.Yes
processing_failedprocessing_errorAnything else.Yes

Ready to get started?

Request access, create a key, and try the quickstart.