Nanonets API to upload files to your OCR model in async mode and to make predictions based on the uploaded images or documents using the file path hosted locally on your system. You can specify multiple file path, ideal for larger files with more than 3 pages.

Log in to see full request history

You can test this API on this page using the API key. First, generate the API key, upload the file stored locally on your system, set async = true, and enter the model_id in the parameter boxes below. Once you have added all the parameters, hit the “Try It!” button on the right side panel to see the response in the response box on the right side panel.


Attributes:

  • message:This indicates the overall success of the API call.
  • result: This is a list that contains objects, each representing a page of the file. These objects include the following attributes:
    • message:This indicates the overall success of the API call.
    • result: This is a list that contains objects, each representing a page of the file. These objects include the following attributes:
      • message: This indicates the success of page processed in the file.
      • input:This is the name of the file uploaded to the model using this API.
      • prediction:An empty list, meaning no predictions were made. In the case of async precessing prediction list is empty because in the async processing the file is processed at a later point in time.
      • page:The page number in the document where the label is located, with 0 representing the first page and so on.
      • request_file_id:The unique identifier of the file you uploaded to the model for prediction. You can find this ID on the extract data page of the model for each file.
      • id:This is the unique identifier for the prediction.
      • request_metadata: This is a body parameter that you include in the request when making an API call. It is returned in the API response and is typically used to uniquely identify and map the file you uploaded.
      • processing_type: This indicates how the file was processed, specifying whether it was handled async or sync. If this field in the response is empty, it means the file was processed sync. If it shows "async," the file was processed async. For more details on sync and async processing, please refer to this page.
      • size: This represent the dimension of the pages processed.
  • signed_urls: An object containing signed URLs for accessing various processed files

Path Params
string
required

Unique identifier for the model to be used for prediction or to fetch predictions.

Query Params
string
required

Determines whether the file should be processed synchronously or asynchronously. Set to true for asynchronous file processing.

Body Params
file
required

Path of the file stored locally on your system.

string

Base64 encoded version of the file urls, which can be sourced locally or from publicly available URLs.

string

Metadata to save with the document.

Responses

400

File missing. Check if you have included a file in the request

OR

Incorrect image. Check if file you included is a valid PNG or JPEG

402

Exhausted Free API Calls. You have exhausted your free API calls please change your plan here

404

Model does not exists. Check if the model id exists

Language
Credentials
:
Request