Let’s run a sample extraction with the Documind open-source package.
Copy
import { extract } from 'documind';const result = await extract({ file: 'https://example.com/bank_statement.pdf', schema: [ { "name": "accountNumber", "type": "string", "description": "The account number of the bank statement." }, { "name": "openingBalance", "type": "number", "description": "The opening balance in the account." }, { "name": "transactions", "type": "array", "description": "A list of transactions in the account.", "children": [ { "name": "date", "type": "string", "description": "The date of the transaction." }, { "name": "creditAmount", "type": "number", "description": "The amount credited in the transaction." }, { "name": "debitAmount", "type": "number", "description": "The amount debited in the transaction." }, { "name": "description", "type": "string", "description": "A short note about the transaction." } ] }, { "name": "closingBalance", "type": "number", "description": "The closing balance in the account." }, { name: "highValueAccount", type: "boolean", description: "Closing balance is more than 50000 ." }, { name: "statementType", type: "enum", description: "The type of document", values: ["Current Account", "Savings Account"] } ]});console.log(result);