PHP OCR SDK

Mindee API Helper Library for PHP

Quickly and easily connect to Mindee's API services using PHP.

Quick Start

Here's the TL;DR of getting started.

First, get an API Key

If you do not have them, you'll need the following packages on your system:

Then, install this library:

composer require mindee/mindee

Finally, PHP away!

Loading a File and Parsing It

Global Documents

<?php

use Mindee\Client;
use Mindee\Product\Invoice\InvoiceV4;

// Init a new client
$mindeeClient = new Client("my-api-key");

// Load a file from disk
$inputSource = $mindeeClient->sourceFromPath("/path/to/the/file.ext");

// Parse the file
$apiResponse = $mindeeClient->parse(InvoiceV4::class, $inputSource);

// Print a brief summary of the parsed data
echo strval($apiResponse->document);

Note: Files can also be loaded from:

A PHP File compatible file:

A URL (HTTPS only):

A base64-encoded string, making sure to specify the extension of the file name:

Raw bytes, making sure to specify the extension of the file name:

Region-Specific Documents

Custom Document (API Builder)

Further Reading

You can view the source code on GitHub.

You can also take a look at the Reference Documentation.

License

Copyright © Mindee

Available as open source under the terms of the MIT License.

Last updated

Was this helpful?