Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.anyformat.ai/llms.txt

Use this file to discover all available pages before exploring further.

Run multiple statements through the same workflow and collect transactions row-by-row.

Workflow fields

We recommend creating this workflow in the anyformat platform where you can test with sample statements and iterate on field descriptions. Copy the workflow ID to use with the API.
FieldTypeDescription
account_holderstringName on the account
account_numberstringAccount number (masked or full)
statement_period_startdateStart of statement period
statement_period_enddateEnd of statement period
opening_balancefloatBalance at start of period
closing_balancefloatBalance at end of period
total_depositsfloatSum of all deposits
total_withdrawalsfloatSum of all withdrawals
transaction_countintegerNumber of transactions
transactionsobjectIndividual transactions (date / description / amount / type)

End-to-end

Python package + class names are provisional. pip install anyformat-sdk and from anyformat.sdk import Client work today, but both are expected to change before the official launch — pin the version you ship with.
# 1. Create the workflow
curl -X POST 'https://api.anyformat.ai/v2/workflows/' \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer $ANYFORMAT_API_KEY" \
  -d '{
    "name": "Bank Statement Processor",
    "description": "Extract statement summary and transactions",
    "nodes": [
      {"id": "parse_1", "type": "parse"},
      {
        "id": "extract_1",
        "type": "extract",
        "extraction_schema": {
          "fields": [
            {"name": "account_holder",         "description": "Name of the account holder as shown on the statement", "data_type": "string"},
            {"name": "account_number",         "description": "Bank account number, may be partially masked",         "data_type": "string"},
            {"name": "statement_period_start", "description": "First day of the statement period",                    "data_type": "date"},
            {"name": "statement_period_end",   "description": "Last day of the statement period",                     "data_type": "date"},
            {"name": "opening_balance",        "description": "Account balance at the start of the period",           "data_type": "float"},
            {"name": "closing_balance",        "description": "Account balance at the end of the period",             "data_type": "float"},
            {"name": "total_deposits",         "description": "Total amount deposited during the statement period",    "data_type": "float"},
            {"name": "total_withdrawals",      "description": "Total amount withdrawn during the statement period",    "data_type": "float"},
            {"name": "transaction_count",      "description": "Total number of transactions in the statement period",  "data_type": "integer"},
            {
              "name": "transactions",
              "description": "Individual transactions listed on the statement",
              "data_type": "object",
              "nested_fields": [
                {"name": "date",        "description": "Date of the transaction",                                                "data_type": "date"},
                {"name": "description", "description": "Transaction description or memo",                                        "data_type": "string"},
                {"name": "amount",      "description": "Transaction amount (positive for deposits, negative for withdrawals)",  "data_type": "float"},
                {
                  "name": "type",
                  "description": "Type of transaction",
                  "data_type": "enum",
                  "enum_options": [
                    {"name": "deposit",    "description": "Incoming deposit"},
                    {"name": "withdrawal", "description": "Outgoing withdrawal"},
                    {"name": "fee",        "description": "Bank fee or charge"},
                    {"name": "transfer",   "description": "Transfer between accounts"},
                    {"name": "interest",   "description": "Interest earned or charged"}
                  ]
                }
              ]
            }
          ]
        }
      }
    ],
    "edges": [{"source": "parse_1", "target": "extract_1"}]
  }'

# 2. Run each statement (stay under the 60 req/min file-submission limit)
for f in statement-jan.pdf statement-feb.pdf statement-mar.xlsx; do
  curl -X POST 'https://api.anyformat.ai/v2/workflows/WORKFLOW_ID/run/' \
    -H "Authorization: Bearer $ANYFORMAT_API_KEY" \
    -F "file=@$f"
  sleep 1
done

# 3. Poll each collection_id for results
curl -H "Authorization: Bearer $ANYFORMAT_API_KEY" \
  'https://api.anyformat.ai/v2/workflows/WORKFLOW_ID/files/COLLECTION_ID/results/'

Tips

XLSX statements yield better results than scanned PDFs — the data is structured in cells rather than requiring OCR.
  • Describe amount as “positive for deposits, negative for withdrawals” to get a consistent sign convention.
  • Submit serially with a small delay (or run multiple workflows in parallel) to stay under the 60 req/min file-submission limit.
  • integer transaction_count is a quick sanity check against the length of the extracted rows.

Next steps

Response formats

The unified JSON response shape

List files

Enumerate all processed files in a workflow