Skip to main content

OCR - Thai ID Card

OCR - Thai ID Card​

OCR Thaiid API service that can Extract information from Thai id photo both front and back side.

HTTP Request​

POST /aiqube/thaiid-ocr/v1/thaiid

HTTP Header​

ParameterDescription
X-API-KEYAPI key authentication

POST data example​

{
"image": base64_encoded(data),
"side": "front"
}

POST data parameter​

ParameterDescription
imageimage contain thai id card that encode with base64 method
sideSpecific side for recognition front for font side, back for back side (default is front)

Example request​

import base64
import requests

with open("image.jpg", "rb") as image_file:
img_data = base64.b64encode(image_file.read())

headers = {
'X-API-KEY': 'XXXX',
'Content-Type': 'application/json'
}
url = API_ENDPOINT

payload = {'image': img_data.decode('utf-8'), 'side': 'front'}
response = requests.request("POST", url, headers=headers, json=payload)
data = response.json()