Nanonets API to obtain the prediction results for a specific file using model_id and request_file_id. The response includes the initial model prediction, modifications applied to the file, and its final processed outcome.


You can test this API on this page using the API key. First, generate the API key, enter the model_id and request_file_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.


Basic Structure:

  • moderated_images_count (integer): When file is approved, the “moderated_images_count” will be equals to the total no of pages in the file and all the pages will be there in the “moderated_images” and “unmoderated_images_count” will be 0.
    Otherwise, “moderated_images_count” will be 0 and “unmoderated_images” will have the data.
  • unmoderated_images_count (integer): The total number of images/pages that have not yet been moderated.
  • moderated_images (array): An array containing details of images/pages that have been moderated.
  • unmoderated_images (array): An array containing details of images/pages that have not been moderated.
  • signed_urls: Object containing URLs with signed access for different versions of the images.

Note: Approval in Nanonets operates at the file level, where "moderated" signifies "approved." In the example below, the file contains 2 pages, and since the file has not been approved, the unmoderated_images_count is displayed as 2.

{
  "moderated_images_count": 0,
  "unmoderated_images_count": 2,
  "moderated_images": [],
  "unmoderated_images": [],
  "signed_urls": {
  }
}

Description of each field inside the Json Response:

  • model_id: Represents the specific model_id used for making predictions.
  • day_since_epoch: The number of days since January 1, 1970 (GMT), representing the upload date of the file.
  • is_moderated: A boolean value indicating whether the file is approved or not.
    • 'TRUE' means file is approved.
    • ‘FALSE’ means file is rejected or not approved.
  • id: This represent the specific page inside the file
  • url: Path to the uploaded image file.
  • predicted_boxes: An array containing details of predicted bounding boxes on the image/page.
    • id: Unique identifier of the bounding box.
    • label: The label name, which corresponds to the field or table header as configured in the model.
    • xmin, ymin, xmax, ymax: This represents the minimum and maximum x,y-coordinate of the bounding box used to predict the value for the specified label.
    • score: A confidence score in prediction represents the model's certainty in its output. It's a numerical value, usually between 0 and 1, indicating the probability that the prediction is correct. A higher score means greater confidence in the prediction's accuracy.
    • ocr_text: This is the predicted value associated with the label
    • status: This field represent the status of the label predicted, it’s always correctly_predicted.
    • type: This represent if the label is field or table header. Possible values are field and table.
    • page: The page number in the document where the label is located, with 0 representing the first page and so on.
    • label_id: A unique identifier associated with each label as defined in the model.
    • cells: An array of cell predictions within the identified table.
      • id: This is the unique identifier for the cell prediction.
      • row, col: This represent the row and column numbers where the cell is located.
      • label: The label name, which corresponds to the table header as configured in the model.
      • xmin, ymin, xmax, ymax: This represents the minimum and maximum x,y-coordinate of the bounding box used to predict the value for the specified label.
      • score: A confidence score in prediction represents the model's certainty in its output. It's a numerical value, usually between 0 and 1, indicating the probability that the prediction is correct. A higher score means greater confidence in the prediction's accuracy.
      • text : This represent the predicted value associated with the cell within the table.
      • verification_status:Indicates the moderation status of a document or a specific field. It can take the values "moderated" if the item has been manually reviewed and modified as necessary, or "correctly_predicted" if the model's initial prediction was accurate and required no further modifications. If the file is approved the verification_status` inside the moderated_box for each cell will change to “moderated”.
      • status: This represent the status of the cell based on validation rules configured in the workflow section. Indicates whether the initial prediction for the cell within the table passed validation checks. Possible values are "success" if all checks passed, or “failed” if any validation failed.
      • failed_validation: This represent the specific reason for the validation failure of a cell within the table. It is only populated if the validation_status for the cell is "failed." For instance, "Content Length is greater than or equal to 2" could be a reason indicating that the cell content did not meet the required content length criteria set by the validation rules.
      • label_id: A unique identifier associated with each label as defined in the model.
  • moderated_boxes: An array containing details of bounding boxes that have been modified.
  • size: Dimensions of the image/page (width and height).
  • page: The page number within the document associated with the image/page.
  • 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.
  • original_file_name: This is the name of the file for which you fetched predictions using the API.
  • assigned_member: The team member assigned to review or moderate the file.
  • no_of_fields: The number of fields configured in the “AI Training” section.
  • export_status: Status of exporting the file data (e.g., "failed", “success”).
  • exported_at: This column represent the UUID (timestamp) at which export of the extracted data triggered.
  • updated_at: Timestamp indicating when the image details were last updated.
  • verified_at: UUID(Timestamp) indicating when the image was approved/unapproved.
  • verified_by: Identifier of the user who verified the image.
  • current_stage_id: Unique identifier of the current processing stage. (e.g., “ffffffff-ffff-ffff-ffff-ffffffffffff” represent the approved stage)
  • uploaded_by: Email of the user who uploaded the image.
  • upload_channel: The channel through which the image was uploaded (e.g., "ui").
  • file_url: Path to the original uploaded file.
  • 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.
  • raw_ocr: An array containing raw OCR data before moderation or correction.
  • approval_status: This represent the approval status of the file, it will be black if file is not approved, “approved” if file is approved, and “rejected” if file is rejected.
  • 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.
  • assigned_members: This represents the list of user emails assigned to the file for review/approval.
Language
Authorization
Basic
base64
:
Click Try It! to start a request and see the response here!