For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
DashboardSign Up
GuidesAPI Reference
  • Getting Started
    • Introduction
    • Authentication
    • Quickstart
  • Concepts
    • Extractors
    • Schemas
LogoLogo
DashboardSign Up
On this page
  • Prerequisites
  • Step 1: Create an Extractor
  • Step 2: Make Your First API Request
  • Using cURL
  • Using fetch (TypeScript)
  • Using requests (Python)
  • Step 3: Handle the Response
  • Alternative Input Methods
  • Extract from URL
  • Extract from Base64
  • Error Handling
  • Next Steps
Getting Started

Quickstart

Extract data from your first document in under 5 minutes
Was this page helpful?
Previous

Extractors

Configure what data to extract from your documents
Next
Built with

Prerequisites

Before you begin, you’ll need:

  • An Automat account (sign up here)
  • An API key (see Authentication)
  • An extractor configured in your dashboard

Step 1: Create an Extractor

1

Go to Extractors

Navigate to your project in the Automat Dashboard and click Create Extractor

2

Define Your Schema

Use the visual editor to define what fields you want to extract. For example, for an invoice:

1{
2 "invoice_number": "string",
3 "date": "string",
4 "total_amount": "number",
5 "vendor_name": "string",
6 "line_items": [{
7 "description": "string",
8 "quantity": "number",
9 "unit_price": "number"
10 }]
11}
3

Test in Playground

Upload a sample document to test your extractor before using the API

4

Copy Extractor ID

Once satisfied, copy the extractor ID (e.g., ext_abc123) for API use

Step 2: Make Your First API Request

File Size Limits

Binary, Base64, and Data URL inputs are limited to 4.5 MB on the Pay As You Go plan. For larger files up to 35 MB, use the URL option instead. Need higher limits? Contact our sales team to discuss enterprise options.

Using cURL

$curl -X POST https://studio.runautomat.com/api/extract \
> -H "Authorization: Bearer YOUR_API_KEY" \
> -F "extractorId=YOUR_EXTRACTOR_ID" \
> -F "file=@path/to/your/document.pdf"

Using fetch (TypeScript)

1const formData = new FormData();
2formData.append('extractorId', 'ext_abc123');
3formData.append('file', fs.createReadStream('invoice.pdf'));
4
5const response = await fetch('https://studio.runautomat.com/api/extract', {
6 method: 'POST',
7 headers: {
8 Authorization: `Bearer ${process.env.AUTOMAT_API_KEY}`,
9 },
10 body: formData,
11});
12
13const result = await response.json();
14console.log('Extracted data:', result.data);

Using requests (Python)

1import requests
2import os
3
4with open("invoice.pdf", "rb") as f:
5 response = requests.post(
6 "https://studio.runautomat.com/api/extract",
7 headers={"Authorization": f"Bearer {os.environ['AUTOMAT_API_KEY']}"},
8 files={"file": f},
9 data={"extractorId": "ext_abc123"},
10 )
11
12result = response.json()
13print("Extracted data:", result["data"])

Step 3: Handle the Response

A successful response looks like:

1{
2 "data": {
3 "invoice_number": "INV-2024-001",
4 "date": "2024-01-15",
5 "total_amount": 1250.0,
6 "vendor_name": "Acme Corp",
7 "line_items": [
8 {
9 "description": "Widget A",
10 "quantity": 10,
11 "unit_price": 100.0
12 },
13 {
14 "description": "Widget B",
15 "quantity": 5,
16 "unit_price": 50.0
17 }
18 ]
19 }
20}

The data field contains the extracted information matching your extractor’s schema.

Alternative Input Methods

Extract from URL

URL is the only method that supports files up to 35 MB — ideal for larger documents that exceed the 4.5 MB limit of binary, Base64, and Data URL uploads.

If your document is publicly accessible, you can pass a URL instead of uploading:

$curl -X POST https://studio.runautomat.com/api/extract \
> -H "Authorization: Bearer YOUR_API_KEY" \
> -F "extractorId=ext_abc123" \
> -F "file=https://example.com/invoice.pdf" \
> -F "mimeType=application/pdf"
When using a URL, you must also provide the mimeType field.

Extract from Base64

For base64-encoded documents:

$curl -X POST https://studio.runautomat.com/api/extract \
> -H "Authorization: Bearer YOUR_API_KEY" \
> -F "extractorId=ext_abc123" \
> -F "file=<base64-encoded-content>" \
> -F "mimeType=application/pdf"

Error Handling

Always handle potential errors in your integration:

1const response = await fetch('https://studio.runautomat.com/api/extract', {
2 method: 'POST',
3 headers: { Authorization: `Bearer ${apiKey}` },
4 body: formData,
5});
6
7if (!response.ok) {
8 const error = await response.json();
9 console.error(`Error (${response.status}):`, error.message);
10} else {
11 const result = await response.json();
12 processData(result.data);
13}

Next Steps

Extractors

Learn more about creating and managing extractors

Schemas

Advanced schema configuration options

API Reference

Complete API documentation