Install the Python SDK:
pip install anyformat. See SDKs for all available SDKs.Get Your API Key
First, you’ll need an API key to authenticate your requests:- Sign up or log in to anyformat
- Navigate to the API Key page
- Generate a new API key
- Keep your API key secure - you’ll use it in the
Authorization: Bearerheader
Create Your First Workflow
A workflow defines what data to extract from your documents. Let’s create a simple invoice processing workflow:List Your Workflows
You can retrieve your workflows in the standard paginated format:Process a Document
Upload a document to extract data using your workflow:Get Results
Poll for results using the fileid from the previous step. The endpoint returns 412 while processing and 200 when results are ready:
Handle Errors Gracefully
The API provides structured error responses to help you handle different scenarios:Next Steps
Now that you’ve completed the quickstart, explore the API Reference for detailed documentation:Response Formats
Learn about response format options for workflow results
Error Handling
Implement robust error handling with structured error codes
Field Types
Define fields with objects, enums, and more
Run Workflow
Process files and text content
Key Concepts to Remember
- Always include trailing slashes in your API endpoints (
/v2/workflows/not/v2/workflows) - Use
Authorization: Bearerfor authentication - Check HTTP status codes before parsing responses
- Handle errors using
error_codefor programmatic error handling - Poll
/v2/files/{id}/extraction/— returns 412 while processing, 200 when complete - Prefer webhooks over polling for production integrations
