fynepdf logo
Docs menu

Extract data from a PDF

Structured data, checked in code where it can be:

  • invoice: numbers, dates, parties, lines and totals; lines, subtotal, tax and total are added up and compared.
  • statement: a bank statement's transactions; totals and balances compared with the statement's own figures.
  • tables: every table, cell by cell, with its page.
  • schema: your own JSON Schema (an object, up to 20 KB). unverified lists values that couldn't be found in the document's text. Price: 2 credits per page read.

POST /v1/ai/extract

Request

curl -X POST https://api.fynepdf.com/v1/ai/extract \
  -H "Authorization: Bearer $FYNEPDF_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"file_id":"file_01jc8x4m2k9q7r3t5vwy6z","type":"invoice"}'

Body

ParameterTypeRequiredWhat it does
file_idstringyes
type"invoice" · "statement" · "tables" · "schema"yes
schemaobjectFor type schema: a JSON Schema object.
instructionsstring

Response

The data and its checks.

FieldTypeRequiredWhat it does
object"extraction"yes
typestringyes
dataobject
checksarray of objectyes
unverifiedarray of stringyes
pages_readarray of integeryes
creditsintegeryes
testboolean

Errors

Errors are problem details (RFC 9457) with a code you can branch on and a request_id for support.