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
| Key | Type | Description |
|---|---|---|
| image* | String | Input image encoded in base64 format |
Response Keys
Success
| Key | Type | Description |
|---|---|---|
| result | String | Response status |
| data | List[Result] | A list of dictionaries, containing health-check fields and its corresponding value |
Error
| Key | Type | Description |
|---|---|---|
| status | String | Response status |
| message | String | The error message |
Response Schema
Result
| Key | Type | Description |
|---|---|---|
| key | String | Health check field names such as BP, LDL, and HDL. |
| value | Union[float, String] | The health check result, corresponding to the health check field. |
| score | float | The confidence score. |
| found | boolean | A boolean indicating whether the health check field is present in the document. |
| rect | List[int] | The bounding box of the extracted text. In this API, an empty list ([]) is returned for every instance. |
Response Code
| HTTP status | Code | Message | Description |
|---|---|---|---|
| 200 | OK | - | Document information extraction successfully. |
| 500 | INTERNAL_SERVER_ERROR | Internal server error. | Internal server error. |
- 200: OK Successful response
- 500: 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": []
}
]
}
{
"status": "INTERNAL_SERVER_ERROR",
"message": "Internal server error."
}
Example code
- Python
- Nodejs
- PHP
- cURL
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())
const axios = require("axios");
const api = "https://api.aigen.online/aiscript/healthcheck-form/v2";
const headers = {
"x-aigen-key": "<key>",
};
const data = { image: "<base64_string>" };
axios
.post(api, data, { headers: headers })
.then((res) => {
console.log(res.data);
})
.catch((err) => {
console.error(err.response.data);
});
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.aigen.online/aiscript/healthcheck-form/v2',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => json_encode(array(
"image" => "<base64_string>"
)),
CURLOPT_HTTPHEADER => array(
'X-AIGEN-KEY: <aigen-key>',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
curl --location 'https://api.aigen.online/aiscript/healthcheck-form/v2' \
--header 'X-AIGEN-KEY: <aigen-key>' \
--header 'Content-Type: application/json' \
--data '{
"image": "<base64_string>"
}'
HTTP Status Codes
The API uses the following HTTP status codes to indicate the result of a request.
| HTTP status | Message | Description |
|---|---|---|
| 200 | - | OCR success. |
| 206 | Partial content | Some page of request is invalid. |
| 400 | Bad request | The API cannot recognize the request with an unspecified cause. |
| 401 | Unauthorized | Authentication credentials are missing or invalid. Verify your API key or token. |
| 403 | Forbidden | The authenticated user does not have permission to access this resource. |
| 404 | Not found | The requested resource or endpoint does not exist. |
| 413 | Payload too large | The uploaded file or request body exceeds the maximum allowed size limit. |
| 415 | Unsupported media type | The file format or content type is not supported by the OCR engine. |
| 429 | Too many requests | Rate 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. |
| 500 | Internal server error | An unexpected error occurred on the server. The request may be retried after a short delay. |
| 503 | Service unavailable | The server is temporarily unable to handle the request due to maintenance or overload. Retry after the period indicated in the Retry-After header. |
| 504 | Gateway timeout | The server did not receive a timely response from an upstream service while processing the OCR request. Retry with a smaller payload or fewer pages. |