API endpoint documentation

Sync Document OCR

Extracts all the text present in the given document.

The table shows the required values:

Component Description
API Method /ocrsvc/v{ver}/DocumentOCR
Input
  • ver - The version of the IDP
  • ocrDocument - the input file to the OCR engine(.jpg, .jpeg & .png)
Output The response is of JSON type

Async Document OCR

Extracts all the text present in the given document.

The table shows the required values:

Component Description
API Method /ocrsvc/v{ver}/AsyncDocumentOCR
Input
  • ver - The version of the IDP
  • pageNot - PageNo can be, for example, for pdf with page size 10, values could be 1,2,3 or 1-3 or 1-3, 7-10
  • ocrDocument - the input file to the OCR engine(.Pdf)
Output Task ID will be generated

Using the Task ID, user need to submit the Task ID in /ocrsvc/v{ver}/GetJobResult

This API returns the job result for all the Async API for the given TaskID. The JSON file code below is a sample for Async OCR Document Extract:

{
  "data": [
    {
      "OCR_text": "amazon business Invoice Invoice # 1KJY-DVF3-FDFW I June 04, 2023 For customer support, visit www.amazon.com/contact-us. Invoice summary Payment due by July 04, 2023 Account # AT957TX0QOFFI Payment terms Net 30 Item subtotal before tax $ 190.10 Shipping & handling $ 0.00 Purchase date 01-Jun-2023 Promos & discounts $ 0.00 Purchased by Rachael Bailey PO # 2023120302074-SPEC Total before tax $ 190.10 Tax $ 0.00 Registered business name Amount due $ 190.10 USD Memorial Health System Bill to Taylorville Memorial Hospital Pay by AP Electronic funds transfer (EFT/ACH/Wire) Check PO Box 19288 Account name Amazon Capital Services, Inc. Amazon Capital Services Springfield, IL 62794 Bank name Wells Fargo Bank PO Box 035184 Ship to ACH routing # (ABA) 121000248 Seattle, WA 98124-5184 Bank account # (DDA) 41630410238186269 Melody Meyer 201 E PLEASANT ST SWIFT code (wire transfer) WFBIUS6S TAYLORVILLE, IL 62568-1562 Include Amazon invoice number(s) in the descriptive field of your electronic funds transfer payment, or Email ar-businessinvoicing@amazon.com to submit your remittance detail. Invoice details Item subtotal Description Qty Unit price before tax Tax 1 Fluke TLK289 Industrial Master Test Lead Set 1 $190.10 $190.10 0.000% ASIN: B002IKE1KU Sold by: Amazon.com Services LLC Order # 114-3020893-6189058 Total before tax $190.10 Tax $0.00 Amount due $190.10 FAQs Page 1 of 2",
      "PageNo": "1"
    }
  ],
  "_metadata": {
    "TotalWords": 209,
    "TotalLine": 84,
    "Confidence": 99.15915661766415,
    "TaskID": "507fb3c6-53e1-4acd-ada5-013342d059b8",
    "OcrProvider": "AWS_TEXTRACT",
    "TenantID": "IDDPDEV_TST",
    "NumberOfPages": 1
  }
}