Skip to main content

Health Check Report OCR

API Documentation for Health Check Report OCR

Extract medical examination report information from image or PDF file

Extract medical examination report information from image or PDF file

POST https://api.aigen.online/aiscript/healthcheck-form/v2

Request Body Parameters

KeyTypeDescription
image*StringInput image encoded in base64 format

Response Keys

Success

KeyTypeDescription
resultStringResponse status
dataList[Result]A list of dictionaries, containing health-check fields and its corresponding value

Error

KeyTypeDescription
statusStringResponse status
messageStringThe error message

Response Schema

Result
KeyTypeDescription
keyStringHealth check field names such as BP, LDL, and HDL.
valueUnion[float, String]The health check result, corresponding to the health check field.
scorefloatThe confidence score.
foundbooleanA boolean indicating whether the health check field is present in the document.
rectList[int]The bounding box of the extracted text. In this API, an empty list ([]) is returned for every instance.

Response Code

HTTP statusCodeMessageDescription
200OK-Document information extraction successfully.
500INTERNAL_SERVER_ERRORInternal server error.Internal server error.
{
"result": "Success",
"data": [
{
"key": "bp",
"value": "106/71",
"score": 0.9982,
"found": true,
"rect": []
},
{
"key": "Weight",
"value": 73.1,
"score": 0.9982,
"found": true,
"rect": []
},
{
"key": "Height",
"value": 179.5,
"score": 0.9982,
"found": true,
"rect": []
},
{
"key": "BMI",
"value": 22.69,
"score": 0.9372,
"found": true,
"rect": []
},
{
"key": "BP-Systolic",
"value": 106.0,
"score": 0.9982,
"found": true,
"rect": []
},
{
"key": "BP-Diastolic",
"value": 71.0,
"score": 0.9982,
"found": true,
"rect": []
},
{
"key": "Date",
"value": "02 ก.ค. 68",
"score": 0.9919,
"found": true,
"rect": []
},
{
"key": "Date_reformatted",
"value": "02/07/2025",
"score": 0.9919,
"found": true,
"rect": []
},
{
"key": "Name",
"value": "n/a",
"score": 0.0,
"found": false,
"rect": []
},
{
"key": "FBS",
"value": "n/a",
"score": 0.0,
"found": false,
"rect": []
},
{
"key": "Hospital_name",
"value": "n/a",
"score": 0.0,
"found": false,
"rect": []
},
{
"key": "Age",
"value": "n/a",
"score": 0.0,
"found": false,
"rect": []
},
{
"key": "LDL",
"value": "n/a",
"score": 0.0,
"found": false,
"rect": []
},
{
"key": "Cholesterol",
"value": "n/a",
"score": 0.0,
"found": false,
"rect": []
},
{
"key": "HDL",
"value": "n/a",
"score": 0.0,
"found": false,
"rect": []
},
{
"key": "DOB",
"value": "n/a",
"score": 0.0,
"found": false,
"rect": []
}
]
}

Example code

import requests
import json

api = "https://api.aigen.online/aiscript/healthcheck-form/v2"
headers = {
"x-aigen-key": "<key>",
"content-type": "application/json"
}
data = json.dumps({"image": "<base64_string>"})

res = requests.post(api, data=data, headers=headers)
print(res.json())

HTTP Status Codes

The API uses the following HTTP status codes to indicate the result of a request.

HTTP statusMessageDescription
200-OCR success.
206Partial contentSome page of request is invalid.
400Bad requestThe API cannot recognize the request with an unspecified cause.
401UnauthorizedAuthentication credentials are missing or invalid. Verify your API key or token.
403ForbiddenThe authenticated user does not have permission to access this resource.
404Not foundThe requested resource or endpoint does not exist.
413Payload too largeThe uploaded file or request body exceeds the maximum allowed size limit.
415Unsupported media typeThe file format or content type is not supported by the OCR engine.
429Too many requestsRate limit exceeded or API credit has run out. The client has sent too many requests in a given time window, or the account's remaining credit has been exhausted. Implement exponential backoff and retry, or top up your credit.
500Internal server errorAn unexpected error occurred on the server. The request may be retried after a short delay.
503Service unavailableThe server is temporarily unable to handle the request due to maintenance or overload. Retry after the period indicated in the Retry-After header.
504Gateway timeoutThe server did not receive a timely response from an upstream service while processing the OCR request. Retry with a smaller payload or fewer pages.