Scrub API
POST/v1/tools/read_fieldspriced

Read documents into a table

Reads photos, scans or PDFs into a table (data extraction), one row per item found, with the columns asked for or chosen from what is printed.

Takes documents (a list of files, up to 200). Returns rows (the table read, one row per item found, with the file and page each came from).

$0.05 a page, up to 200 pages.

Afterwards, change fields or row with adjust; quote_adjustment prices the change.

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 14 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.
fieldsarray[]What to read, each a column of the table. A field has a name, what it means when the name is not enough, and the kind of value it is (text, number, amount, currency, date, or one of a list of choices). Left empty, the columns are chosen from what is printed on the documents.
rowstringdocumentLeft as document, every document is read, and each row says what kind it is. Name a kind, such as invoice, or several joined by or, and anything else is left out and not charged. Several on one page, or one running over several pages, are each one row.

Call it

Request

curl -X POST https://app.scrub.app/v1/tools/read_fields \
  -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.