For the complete documentation index, see llms.txt. This page is also available as Markdown.

Extraction Quick Start

Quickest way to get started using the client libraries.

Installation Instructions

Requires Python ≥ 3.9. Python ≥ 3.11 is recommended.

Simply install the PyPi package using pip:

pip install -U mindee~=5.3

Requires Node.js ≥ 20.1. Node.js ≥ 22 is recommended.

Simply install the NPM package:

npm install mindee@^5.5.0

Requires PHP ≥ 8.1. PHP ≥ 8.3 is recommended.

Simply install the Packagist package using composer:

php composer.phar require "mindee/mindee:>=3.2"

Requires Ruby ≥ 3.2.

Simply install the gem using:

gem install mindee -v '~> 5.4'

Requires Java ≥ 11. Java ≥ 17 is recommended.

Group ID: com.mindee.sdk Artifact ID: mindee-api-java Version: 5.5.0 or greater

There are various installation methods, Maven, Gradle, etc:

Installation Details

.NET ≥ 8.0 is recommended.

Simply install the NuGet package using dotnet add:

dotnet add package Mindee --version 4.8

Don't see support for your favorite language or framework? Make a feature request!

Send a File and Poll

Make a note of your model's ID for use in the API.

When getting started, we recommend using the polling method which will be quickest (unless you happen to already have access to a public-facing Web server).

Here are basic code examples, these are self-contained and can be run as-is:

Requires Python ≥ 3.10. Python ≥ 3.12 is recommended. Requires the Mindee Python client library version 5.3.1 or greater.

from mindee import PathInput
from mindee.v2 import (
    Client,
    ExtractionParameters,
    ExtractionResponse,
)

input_path = "/path/to/the/file.ext"
api_key = "MY_API_KEY"
model_id = "MY_MODEL_ID"

# Init a new client
mindee_client = Client(api_key)

# Set Extraction parameters
model_params = ExtractionParameters(
    # ID of the model, required.
    model_id=model_id,

    # Options: set to `True` or `False` to override defaults

    # Enhance extraction accuracy with Retrieval-Augmented Generation.
    rag=None,
    # Extract the full text content from the document as strings.
    raw_text=None,
    # Calculate bounding box polygons for all fields.
    polygon=None,
    # Boost the precision and accuracy of all extractions.
    # Calculate confidence scores for all fields.
    confidence=None,
)

# Load a file from disk
input_source = PathInput(input_path)

# Send for processing
response = mindee_client.enqueue_and_get_result(
    ExtractionResponse,
    input_source,
    model_params,
)

# Print a brief summary of the parsed data
print(response.inference)

# Access the result fields
fields: dict = response.inference.result.fields

Also take a look at the Extraction Result documentation.

Requires Node.js ≥ 20.1. Node.js ≥ 22 is recommended. Requires the Mindee Node.js client library version 5.7.1 or greater.

Also take a look at the Processing Results documentation.

Requires PHP ≥ 8.1. PHP ≥ 8.3 is recommended. Requires the Mindee PHP client library version 3.2.0 or greater.

Also take a look at the Processing Results documentation.

Requires Ruby ≥ 3.2. Requires the Mindee Ruby client library version 5.4.0 or greater.

Also take a look at the Processing Results documentation.

Requires Java ≥ 11. Java ≥ 21 is recommended. Requires the Mindee Java SDK version 5.5.0 or greater.

Also take a look at the Processing Results documentation.

.NET ≥ 8.0 is recommended. Requires the Mindee .NET client library version 4.8.1 or greater.

Also take a look at the Processing Results documentation.

Details on Sending

For details on available options and advanced usage, check the following sections:

Process Extraction Results

Once you've sent the file and retrieved the response, you can start accessing the results.

The Extraction model's fields will be in the fields object in the return (the response variable returned from the above step).

Each key in the fields object corresponds to the field's name in your Data Schema.

You'll want to adapt your processing depending on the type of field, for example when looping over lists or accessing sub-fields.

Accessing simple values, using the name of the field in the Data Schema.

You can (should!) specify the type of value, the possible types are str , bool , float . Note that all types may be None.

Accessing a list of simple values, where my_list_field is the name of the field in the Model.

Accessing an object field and its sub-fields, where my_object_field is the name of the field in the Model. In this hypothetical case, the object has a sub-field named subfield_1 .

Accessing a list of objects, where my_object_list_field is the name of the field in the Model.

Accessing simple values, using the name of the field in the Data Schema.

Access fields as SimpleField instances when retrieving their value.

Accessing a list of values, where my_simple_list_field is the name of the field in the Model.

We need to specify that the field is a ListField in order to access its items.

Accessing an object field and its sub-fields, where my_object_field is the name of the field in the Model. In this hypothetical case, the object has a sub-field named subfield_1 .

Accessing a list of objects, where my_object_list_field is the name of the field in the Model.

We need to specify that the field is a ListField in order to access its items.

Accessing simple values, using the name of the field in the Data Schema.

Access fields as SimpleField instances when retrieving their value.

Accessing a list of values, where my_simple_list_field is the name of the field in the Model.

We need to specify that the field is a ListField in order to access its items.

Accessing an object field and its sub-fields, where my_object_field is the name of the field in the Model. In this hypothetical case, the object has a sub-field named subfield_1 .

Accessing a list of objects, where my_object_list_field is the name of the field in the Model.

We need to specify that the field is a ListField in order to access its items.

Accessing simple values, using the name of the field in the Data Schema.

Access fields as SimpleField instances when retrieving their value.

Accessing a list of values, where my_simple_list_field is the name of the field in the Model.

Access the list as a ListField instance, and the items as SimpleField instances.

Accessing an object field and its sub-fields, where my_object_field is the name of the field in the Model. In this hypothetical case, the object has a sub-field named subfield_1 .

Accessing a list of objects, where my_object_list_field is the name of the field in the Model.

Access the list as a ListField instance, and the items as ObjectField instances.

You can technically access all field types by their index: fields['field_name']

This is heavily discouraged and unsupported.

Accessing simple values, using the name of the field in the Data Schema.

Access fields as SimpleField instances when retrieving their value.

We also need to specify the type of value, the possible types are String , Boolean , Double . Note that all types may be null.

Accessing a list of simple values, where my_simple_list_field is the name of the field in the Model.

We need to specify that the field is a ListField in order to access its SimpleItems.

For each item in the list, we also need to specify the correct field and value type, as described above.

Accessing an object field and its sub-fields, where my_object_field is the name of the field in the Model. In this hypothetical case, the object has a sub-field named subfield_1 .

Accessing a list of objects, where my_object_list_field is the name of the field in the Model.

Depending on your requirements, this can be simplified using various custom methods.

Accessing simple values, using the name of the field in the Data Schema.

Access fields as SimpleField instances when retrieving their value.

We also need to specify the type of value, the possible types are string , Boolean , Double . Note that all types may be null.

Accessing a list of simple values, where my_list_field is the name of the field in the Model.

We need to specify that the field is a ListField in order to access its SimpleItems.

Accessing an object field and its sub-fields, where my_object_field is the name of the field in the Model. In this hypothetical case, the object has a sub-field named subfield_1 .

Accessing a list of objects, where my_object_list_field is the name of the field in the Model.

Details on Response Processing

For more details on using the result fields in your application: Extraction Result

For details on response metadata: Response Processing

Last updated

Was this helpful?