Skip to main content
Three steps: create a workflow, run a document through it, read the values. The invoice extractor below pulls invoice_number, total_amount, and issue_date.
Prefer to click? The Quickstart builds the same workflow at app.anyformat.ai with no code. Building your first workflow there is faster, and you can call it from the API afterwards with its workflow ID.

Before you start

Get an API key from app.anyformat.ai/api-key. The snippets below read it from the environment. Both SDKs also take the key as a constructor argument. The Python SDK page carries the Python version pin.

1. Create a workflow

A workflow is a typed graph of nodes. The smallest extraction shape is a parse node feeding an extract node: two nodes, one edge. Both SDKs expose a fluent builder over that same graph. Nodes covers the other node types, including Classify and Split.
Keep the workflow ID. Over HTTP it arrives as id, alongside the name, description, and timestamps:

2. Run a document

Upload and run uploads the file and starts a run in one call. Replace WORKFLOW_ID with the ID from step 1.
The 202 response carries the run_id. Keep it to poll for results. status: "queued" means the run was accepted, not that extraction has finished.

3. Read the values

Poll the run. It always returns 200. results is null until status is processed, and then the results envelope arrives inline on the same read. Stop polling when status is processed, error, or cancelled.
A finished run reports status: "processed", and each extracted field carries a value and a confidence:
  • results holds one section per node type that ran. This workflow has a parse node and an extract node, so parse and extractions are filled.
  • extractions is a list. One entry per extraction the run produced.
  • fields is keyed by the field names you defined in step 1.
  • value is a string on the wire, including for float and date fields. confidence is a number from 0 to 100.
  • parse is trimmed above. It holds the parsed markdown, the plain text, per-page blocks, and their bounding boxes.
Each field also carries evidence: the snippet and page number the value came from. Runs & results is the full envelope, section by section, and Get run lists every field.
TypeScript
Python

Where to go next

API reference

Every endpoint, every response, every error code

Runs & results

The full results envelope, confidence, and evidence

Recipes

End-to-end examples: invoices, resumes, contracts, receipts, and more

Coding assistant

Let Claude Code build and run anyformat workflows from your editor