Scrub API
POST/v1/tools/read_textpriced

Read documents as text

Reads the text of photos, scans and PDFs (OCR), every page, each headed by its file and page.

Takes documents (a list of files, up to 200). Returns text (the text of every page, each headed by its file and page), pages.

$0.01 a page, up to 200 pages.

Fields

FieldTypeDefaultWhat it is
documentsarrayRequiredA list: A file_id from create_upload, accepting image/jpeg, image/png, image/webp, image/heic, image/heif, application/pdf, up to 20 MB a photo, 30 MB a PDF. Get one with create_upload. Or the job_id of a finished job that made a file of this kind: that file is used. Pass the job_id rather than retyping its result. All of them are one job.

Call it

Request

curl -X POST https://app.scrub.app/v1/tools/read_text \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{"documents":["w/…/file_id"]}'

Answer

{
  "ok": true,
  "result": {
    "job_id": "job_…",
    "status": "running",
    "price_usd": "$…"
  }
}

It starts at once and answers running. Ask job_status with the job_id for its result. quote gives its price first, free.

Every call can also answer an error: what comes back. Try it with your key from Account.