Text in Image (OCR)

Instantpay's OCR API lets businesses add text recognition to their apps. This advanced API extracts text from images and scanned documents. It converts the text into machine-readable data, with high accuracy and efficiency.

The OCR API automates text conversion. It supports many apps, from document management to content analysis. Businesses can improve workflows and data access. They can turn visual content into actionable insights for better decision-making.

Use Instantpay's OCR API to digitise printed and handwritten text. It will convert valuable information rapidly for use in your digital ecosystem.

Header Parameters

NameTypeDescriptionMandatory (M) , Optional (O)Provided by INSTANTPAY (Y/N)
X-Ipay-Auth-CodeStringAuth Code -1 (Fixed)MY
X-Ipay-Client-IdStringUnique Client IDMY
X-Ipay-Client-SecretStringUnique secret keyMY
X-Ipay-Endpoint-IpStringEnd Customer IP AddressMN

Request Parameters

NameTypeMandatory (M) , Optional (O)Description
imagemultipart/form-dataMUpload single image. It must be .jpeg or .png and no larger than 5mb.
latitudeStringMCurrent location latitude
longitudeStringMCurrent location longitude
externalRefStringMYour Unique Transaction Id

Sample Request

curl --location 'https://api.instantpay.in/identity/ocr' \
--header 'X-Ipay-Auth-Code: {{authCode}}' \
--header 'X-Ipay-Client-Id: {{clientId}}' \
--header 'X-Ipay-Client-Secret: {{clientSecret}}' \
--header 'X-Ipay-Endpoint-Ip: {{endPointIP}}' \
--form 'image=@"/Users/rajvir/Desktop/Screenshot 2024-03-05 at 12.23.54 PM.png"' \
--form 'latitude="0"' \
--form 'longitude="0"' \
--form 'externalRef="1709632804"'
POST /identity/ocr HTTP/1.1
Host: api.instantpay.in
X-Ipay-Auth-Code: {{authCode}}
X-Ipay-Client-Id: {{clientId}}
X-Ipay-Client-Secret: {{clientSecret}}
X-Ipay-Endpoint-Ip: {{endPointIP}}
Content-Length: 515
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW

------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="image"; filename="Screenshot 2024-03-05 at 12.23.54 PM.png"
Content-Type: <Content-Type header here>

(data)
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="latitude"

0
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="longitude"

0
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="externalRef"

1709632834
------WebKitFormBoundary7MA4YWxkTrZu0gW--

Response Parameters

NameTypeDescription
statuscodeStringInstantPay Status Code
actcodeStringAction Code
statusStringStatus message
dataArrayResponse Data (If Present)
timestampStringCurrent time (YYYY-MM-DD HH:II:SS)
ipay_uuidStringRequest reference number
orderidStringTransaction Id ( If transaction otherwise it is null )
environmentStringLive/Sandbox

📘

Note :

  • externalRef must be unique and in alpha numeric characters.
  • Click here for guidelines for entering data in latitude/ longitude parameter.

Sample Response

{
    "statuscode": "TXN",
    "actcode": null,
    "status": "Sucesses",
    "data": {
        "ocr": {
            "textDetections": [
                {
                    "DetectedText": "Messages . CP-YESBNK . 2m",
                    "Type": "LINE",
                    "Id": 0,
                    "Confidence": 84.50886535644531,
                    "Geometry": {
                        "BoundingBox": {
                            "Width": 0.7612181305885315,
                            "Height": 0.36458325386047363,
                            "Left": 0.1449061930179596,
                            "Top": 0.390625
                        },
                        "Polygon": [
                            {
                                "X": 0.1449061930179596,
                                "Y": 0.390625
                            },
                            {
                                "X": 0.9061243534088135,
                                "Y": 0.390625
                            },
                            {
                                "X": 0.9061243534088135,
                                "Y": 0.7552082538604736
                            },
                            {
                                "X": 0.1449061930179596,
                                "Y": 0.7552082538604736
                            }
                        ]
                    }
                },
                {
                    "DetectedText": "Messages",
                    "Type": "WORD",
                    "Id": 1,
                    "ParentId": 0,
                    "Confidence": 99.70155334472656,
                    "Geometry": {
                        "BoundingBox": {
                            "Width": 0.24932646751403809,
                            "Height": 0.29555296897888184,
                            "Left": 0.14490622282028198,
                            "Top": 0.44989317655563354
                        },
                        "Polygon": [
                            {
                                "X": 0.14490622282028198,
                                "Y": 0.45640164613723755
                            },
                            {
                                "X": 0.39395201206207275,
                                "Y": 0.44989317655563354
                            },
                            {
                                "X": 0.39423269033432007,
                                "Y": 0.7389376759529114
                            },
                            {
                                "X": 0.14518693089485168,
                                "Y": 0.7454461455345154
                            }
                        ]
                    }
                },
                {
                    "DetectedText": ".",
                    "Type": "WORD",
                    "Id": 2,
                    "ParentId": 0,
                    "Confidence": 92.1365966796875,
                    "Geometry": {
                        "BoundingBox": {
                            "Width": 0.017570311203598976,
                            "Height": 0.08854162693023682,
                            "Left": 0.4151606261730194,
                            "Top": 0.5364583730697632
                        },
                        "Polygon": [
                            {
                                "X": 0.4151606261730194,
                                "Y": 0.5364583730697632
                            },
                            {
                                "X": 0.43273094296455383,
                                "Y": 0.5364583730697632
                            },
                            {
                                "X": 0.43273094296455383,
                                "Y": 0.625
                            },
                            {
                                "X": 0.4151606261730194,
                                "Y": 0.625
                            }
                        ]
                    }
                },
                {
                    "DetectedText": "CP-YESBNK . 2m",
                    "Type": "WORD",
                    "Id": 3,
                    "ParentId": 0,
                    "Confidence": 61.688446044921875,
                    "Geometry": {
                        "BoundingBox": {
                            "Width": 0.4643573462963104,
                            "Height": 0.3645833730697632,
                            "Left": 0.4417670965194702,
                            "Top": 0.390625
                        },
                        "Polygon": [
                            {
                                "X": 0.4417670965194702,
                                "Y": 0.390625
                            },
                            {
                                "X": 0.9061244130134583,
                                "Y": 0.390625
                            },
                            {
                                "X": 0.9061244130134583,
                                "Y": 0.7552083730697632
                            },
                            {
                                "X": 0.4417670965194702,
                                "Y": 0.7552083730697632
                            }
                        ]
                    }
                }
            ]
        },
        "pool": {
            "referenceId": "1240305122434SNQJB",
            "openingBalance": "25.10",
            "paymentAmount": "0.00",
            "mode": "DR",
            "closingBalance": "25.10"
        }
    },
    "timestamp": "2024-03-05 12:24:34",
    "ipay_uuid": "h0689b7d3b42-166e-47c3-8f84-ee853199f26d-gKsrbfTGyTdl",
    "orderid": "1240305122434SNQJB",
    "environment": "LIVE",
    "internalCode": null
}
Language
Click Try It! to start a request and see the response here!