Laigo Docs
  • GET STARTED
    • Welcome to smartTools
    • Setup your Account
    • Make your first Request
    • Smart Table Extraction
  • smartTools API
    • smartICR
    • smartClassify
    • smartInvoice
    • smartReceipt
    • smartTableExtraction
    • smartPaperFlow
    • Results
    • Delete
  • Tools
    • Laigo Postman
    • Laigo SDK
  • Account
    • My Account
Powered by GitBook
On this page
  • Limitations
  • Licenses
  • API Call
  • Upload file to smartICR
  • Code snippets
  • Example (Step by Step)
  • Credits (Laigos)
  1. smartTools API

smartICR

Revolutionize your text extraction process with smartICR, a leading tool in the industry. Utilizing cutting-edge deep learning techniques in computer vision and natural language processing, the software is capable of accurately extracting text from images and videos in over 100 languages. Its use of an LSTM neural network allows for unparalleled performance in sequence prediction, making it impervious to repeated text within image sequences. Experience the efficiency and effectiveness of smartICR today.

Limitations

Max File Size is 10 MB Max requests per second: 1 Processing Time: Up to the number of characters in an image

Licenses

All rights reserved by Laigo

API Call

Upload file to smartICR

POST https://use.laigo.io/api/FileUpload/v1/Upload/smartICR

Query Parameters

Name
Type
Description

languageHint

String

Define language of the file content with ISO code (ISO-639-1)

outputFormats

String

Define output format(s) like PDF, TXT, JSON. Default is PDF

email

String

Define receiver email address

threshold

String

Set minimum probability to be reached by model

Headers

Name
Type
Description

accessToken*

String

A JWT issued to your application by the Laigo identity provider.

Request Body

Name
Type
Description

file*

String

The file for uploading

Code snippets

curl -X POST "https://use.laigo.io/api/FileUpload/v1/Upload/smartICR" \
     -H "Authorization: Bearer my-accessToken-here" \
     -F "email=my-email-here" \
     -F "outputFormats=PDF,TEXT" \
     -F "languageHint=EN" \
     -F "file=@my-file-location-here"
string baseUrl = "https://use.laigo.io/api/FileUpload/v1/Upload/smartICR";
string email = "my-email-here";
string outputFormats = "PDF,TEXT";
string languageHint = "EN";
string token = "Bearer my-accessToken-here";

using (HttpClient client = new HttpClient())
{
 string url = $"{baseUrl}?email={email}&outputFormats={outputFormats}&languageHint={languageHint}";
 var request = new HttpRequestMessage(HttpMethod.Post, url);
 request.Headers.Add("Authorization", token);
 var content = new MultipartFormDataContent();
 content.Add(new StreamContent(File.OpenRead("/my-file-location-here")), "file", "/my-file-location-here");
 request.Content = content;
 var response = await client.SendAsync(request);
 response.EnsureSuccessStatusCode();
 Console.WriteLine(await response.Content.ReadAsStringAsync());
}
import requests

url = "https://use.laigo.io/api/FileUpload/v1/Upload/smartICR"
headers = {
    "Authorization": "Bearer my-accessToken-here"
}
data = {
    "email": "my-email-here",
    "outputFormats": "PDF,TEXT",
    "languageHint": "EN"
}
files = {
    "file": open("my-file-location-here", "rb")
}
response = requests.post(url, headers=headers, data=data, files=files)
response.raise_for_status()
print(response.text)
//note that running this code directly from the local file system might not work due to security restrictions.
<input type="file" id="fileInput">
<button id="uploadButton">Upload</button>

<script>
  document.getElementById('uploadButton').addEventListener('click', () => {
    const url = 'https://use.laigo.io/api/FileUpload/v1/Upload/smartICR';
    const token = 'Bearer my-email-here';

    const email = 'my-email-here';
    const outputFormats = 'PDF,TEXT';
    const languageHint = 'EN';

    const fileInput = document.getElementById('fileInput');
    const file = fileInput.files[0];

    const formData = new FormData();
    formData.append('email', email);
    formData.append('outputFormats', outputFormats);
    formData.append('languageHint', languageHint);
    formData.append('file', file);

    const xhr = new XMLHttpRequest();
    xhr.open('POST', url);
    xhr.setRequestHeader('Authorization', token);

    xhr.onload = () => {
      if (xhr.status === 200) {
        console.log(xhr.responseText);
      } else {
        console.error('Request failed:', xhr.statusText);
      }
    };

    xhr.onerror = () => {
      console.error('Request failed');
    };

    xhr.send(formData);
  });
</script>
<?php
$curl = curl_init();

$url = "https://use.laigo.io/api/FileUpload/v1/Upload/smartICR";
$headers = array(
    "Authorization: Bearer my-accessToken-here"
);

$fields = array(
    "email" => "my-email-here",
    "outputFormats" => "PDF,TEXT",
    "languageHint" => "EN",
    "file" => "@my-file-location-here"
);

curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $fields);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);

$response = curl_exec($curl);

if (curl_errno($curl)) {
    echo "Error: " . curl_error($curl);
}

curl_close($curl);

echo $response;
?>

Example (Step by Step)

  1. First you need to have a document sample that you want to use with smartICR. It can be any document type such as: invoice, receipt, letter, email etc. For e.g you can use the invoice sample below:

  1. Run your code. You will receive a JSON response with the invoice details.

Credits (Laigos)

The calcualtion of processing a page:

Page
Laigos

1

1

PreviousSmart Table ExtractionNextsmartClassify

Last updated 5 months ago

Inorder to use our smartICR tool you need to have an API key which can be generated from .

If you don’t have an account, first you need to set up your account then you can generate the API key.

After you have generated your API key, then you can use smartICR in any popular programming language, where you can find the code snippets .

here
Create an account here.
here