ð āļĢāļ°āļāļāļāļĢāļ§āļāļŠāļāļāđāļĨāļ°āđāļĒāļāļāđāļāļĄāļđāļĨāļāļēāļāļāļ°āđāļāļĩāļĒāļāļāđāļēāļāļ āļēāļĐāļēāđāļāļĒāļāđāļ§āļĒāđāļāļāđāļāđāļĨāļĒāļĩ OCR ð
ð āđāļāļāļĢāļąāļāļĢāļāļāļĢāļēāļĒāļāļēāļĢāļāļ°āđāļāļĩāļĒāļāļĢāļēāļĐāļāļĢ
āļĒāļīāļāļāļĩāļāđāļāļāļĢāļąāļāļŠāļđāđ API āļĢāļ°āļāļāļāļĢāļ§āļāļŠāļāļāđāļĨāļ°āđāļĒāļāļāđāļāļĄāļđāļĨāļāļēāļāđāļāļāļĢāļąāļāļĢāļāļāļĢāļēāļĒāļāļēāļĢāļāļ°āđāļāļĩāļĒāļāļĢāļēāļĐāļāļĢāļ āļēāļĐāļēāđāļāļĒāļāđāļ§āļĒāđāļāļāđāļāđāļĨāļĒāļĩ AI āļāļķāđāļāļāļąāļāļāļēāđāļāļĒāļāļĢāļīāļĐāļąāļ āđāļāđāļāļāļāđāđāļāļāđāļāđāļĨāļĒāļĩ āļāļģāļāļąāļ āļŠāļģāļŦāļĢāļąāļāļāļēāļĢāļāļķāļāļāđāļāļĄāļđāļĨāļāļēāļāđāļāļāļĢāļąāļāļĢāļāļāļĢāļēāļĒāļāļēāļĢāļāļ°āđāļāļĩāļĒāļāļĢāļēāļĐāļāļĢāđāļāļāļŠāļēāļĢāļāļāļąāļāļāļĩāđāļāļ°āļāđāļ§āļĒāđāļŦāđāļāļļāļāļŠāļēāļĄāļēāļĢāļāļāļŠāļēāļāļĢāļ§āļĄāđāļĨāļ°āđāļāđāļāļēāļāļāļĢāļīāļāļēāļĢ OCR āļāļāļāđāļĢāļēāđāļāđāļāļĒāđāļēāļāļĄāļĩāļāļĢāļ°āļŠāļīāļāļāļīāļ āļēāļ
āļāļāļĨāļāļāđāļĨāļĒ!â
Example Images (Click to try)

Demo key is limited to 10 requests per day per IP
Click here to get your API key
āđāļĢāļīāđāļĄāļāđāļāđāļāđāļāļēāļâ
-
āļāđāļāļāļģāļŦāļāļāđāļāļ·āđāļāļāļāđāļ
- API key āļāļēāļ āđāļāđāļāļāļāđāđāļāļāđāļāđāļĨāļĒāļĩ
- āļĢāļđāļāļ āļēāļāđāļāļāļŠāļēāļĢāļāļ°āđāļāļĩāļĒāļāļāđāļēāļ
- āļĢāļđāļāđāļāļāđāļāļĨāđāļāļĩāđāļĢāļāļāļĢāļąāļ: JPEG, JPG, PNG, PDF
- āļāļāļēāļāđāļāļĨāđāļŠāļđāļāļŠāļļāļ: 10MB
-
āļāļēāļĢāđāļĢāļīāđāļĄāļāđāļāđāļāđāļāļēāļāļāļĒāđāļēāļāļĢāļ§āļāđāļĢāđāļ§
- āļāļēāļĢāļāļĢāļ°āļĄāļ§āļĨāļāļĨāļāļĩāđāļĢāļ§āļāđāļĢāđāļ§ (5-10 āļ§āļīāļāļēāļāļĩāļāđāļāđāļāļāļŠāļēāļĢ)
- āļāļ§āļēāļĄāđāļĄāđāļāļĒāļģāļŠāļđāļāđāļāļāļēāļĢāđāļĒāļāļāđāļāļāļ§āļēāļĄ
- āļĢāļāļāļĢāļąāļāļĢāļđāļāđāļāļāđāļāļĨāđāļŦāļĨāļēāļĒāļĢāļđāļāđāļāļ
-
āļāļļāļāļŠāļĄāļāļąāļāļīāļŦāļĨāļąāļ
- āļāļēāļĢāđāļĒāļāļ āđāļāļĄāļđāļĨāļĢāļēāļĒāļĨāļ°āđāļāļĩāļĒāļāļāđāļēāļāđ āļĢāļ§āļĄāļāļķāļ:
- āļāđāļāļĄāļđāļĨāļŠāđāļ§āļāļāļļāļāļāļĨ (āļāļ·āđāļ, āđāļĨāļāļāļąāļāļĢāļāļĢāļ°āļāļēāļāļ, āđāļāļĻ, āļŠāļąāļāļāļēāļāļī)
- āļĢāļēāļĒāļĨāļ°āđāļāļĩāļĒāļāļ§āļąāļāđāļāļīāļ (āļ§āļąāļāļāļĩāđ, āļāļēāļĒāļļ)
- āļāđāļāļĄāļđāļĨāļāļĢāļāļāļāļĢāļąāļ§ (āļāļ·āđāļāđāļĨāļ°āļŠāļąāļāļāļēāļāļīāļāļāļāļāļīāļāļēāđāļĨāļ°āļĄāļēāļĢāļāļē)
- āļĢāļēāļĒāļĨāļ°āđāļāļĩāļĒāļāļāļĩāđāļāļĒāļđāđ (āļāļĩāđāļāļĒāļđāđ, āļŠāļāļēāļāļ°, āļāļēāļĢāļĨāļāļāļ°āđāļāļĩāļĒāļ)
- āļāđāļāļĄāļđāļĨāđāļĄāļāļēāļāļāļāđāļāļāļŠāļēāļĢ (āļ§āļąāļāļāļĩāđ, āļŦāļĄāļēāļĒāđāļŦāļāļļ, āļāđāļāļĄāļđāļĨāđāļāđāļēāļŦāļāđāļēāļāļĩāđāļĨāļāļāļ°āđāļāļĩāļĒāļ)
- āļĢāļāļāļĢāļąāļāđāļāļāļŠāļēāļĢāđāļāļāļŦāļāđāļēāđāļāļĩāļĒāļ§
- āļāļąāļ§āđāļĨāļ·āļāļāđāļāļāļēāļĢāļŠāđāļāļāļ·āļāļāđāļāļāļ§āļēāļĄ OCR āļāđāļāļāļāļąāļāđāļĨāļ°āļĢāļđāļāļ āļēāļāļāļĩāđāļāđāļēāļāļāļēāļĢāļāļĢāļ°āļĄāļ§āļĨāļāļĨāđāļĨāđāļ§
- āļĢāļđāļāđāļāļāļāļēāļĢāļāļāļāļŠāļāļāļ JSON āļāļĩāđāļĒāļ·āļāļŦāļĒāļļāđāļ
- āļāļēāļĢāđāļĒāļāļ āđāļāļĄāļđāļĨāļĢāļēāļĒāļĨāļ°āđāļāļĩāļĒāļāļāđāļēāļāđ āļĢāļ§āļĄāļāļķāļ:
-
āļāļ§āļēāļĄāļāļĨāļāļāļ āļąāļĒāđāļĨāļ°āļāļēāļĢāļāļāļīāļāļąāļāļīāļāļēāļĄāļāļāļŦāļĄāļēāļĒ
- āļāļāļīāļāļąāļāļīāļāļēāļĄ GDPR āđāļĨāļ° PDPA
- āļāļļāļāļŠāļīāđāļāļŠāļļāļ API āļāļĩāđāļāļĨāļāļāļ āļąāļĒ
- āđāļĄāđāļĄāļĩāļāļēāļĢāđāļāđāļāļĢāļąāļāļĐāļēāļāđāļāļĄāļđāļĨāļŦāļĨāļąāļāļāļēāļāļāļēāļĢāļāļĢāļ°āļĄāļ§āļĨāļāļĨāđāļŠāļĢāđāļāļŠāļīāđāļ
āļāļĢāļļāļāļēāđāļĒāļĩāđāļĒāļĄāļāļĄ API Portal āđāļāļ·āđāļāļāļđ API key āļāļĩāđāļĄāļĩāļāļĒāļđāđāļāļāļāļāļļāļāļŦāļĢāļ·āļāļāļ API key āđāļŦāļĄāđ
āļāļąāļ§āļāļĒāđāļēāļâ
āļāļĩāđāļāļ·āļāļāļąāļ§āļāļĒāđāļēāļāđāļāļāļŠāļēāļĢāļāļ°āđāļāļĩāļĒāļāļāđāļēāļāđāļĨāļ°āļāđāļāļĄāļđāļĨāļāļĩāđāđāļĒāļāđāļāđ:

āļāļģāļāļ:â
cURL
curl -X POST https://api.iapp.co.th/ocr/v3/civil-registeration-certificate/file \
-H apikey: YOUR_API_KEY \
-F file=@/path/to/document.jpg \
-F return_image=false \
-F return_ocr=false
āļāļēāļĢāļāļāļāļŠāļāļāļ:â
{
"message": "success",
"processed": {
"header": "(āļāđāļāļāļāļīāđāļāđāļāļāļĒāļēāļāļāļēāļ§āļē) āļ.āļĢ. 14/1",
"title": "āđāļāļāļĢāļąāļāļĢāļāļāļĢāļēāļĒāļāļēāļĢāļāļ°āđāļāļĩāļĒāļāļĢāļēāļĐāļāļĢ āļāļēāļāļāļēāļāļāđāļāļĄāļđāļĨāļāļēāļĢāļāļ°āđāļāļĩāļĒāļ\nāļŠāļģāļāļąāļāļāļ°āđāļāļĩāļĒāļāļāļĨāļēāļ āļāļĢāļĄāļāļēāļĢāļāļāļāļĢāļāļ āļāļĢāļ°āļāļĢāļ§āļāļĄāļŦāļēāļāđāļāļĒ",
"nationalIdNumber": "X-XXXX-XXXXX-XX-X",
"houseRegistrationNumber": "XXXX-XXXXXX-X",
"name": "āļāļēāļĒāļŠXXXXX XXXXXXXXXXX",
"gender": "āļāļēāļĒ",
"nationality": "āđāļāļĒ",
"dateOfBirth": "8 XXXXXXX 2498",
"age": 64,
"residentialStatus": "āđāļāđāļēāļāđāļēāļ",
"mothersName": "XXXXX",
"mothersNationality": "āļāļĩāļ",
"fathersName": "XXXXX",
"fathersNationality": "āļāļĩāļ",
"address": "XXX XXXXXXX XXX āđāļāļ§āļāļāļĨāļīāđāļāļāļąāļ āđāļāļāļāļĨāļīāđāļāļāļąāļ āļāļĢāļļāļāđāļāļāļĄāļŦāļēāļāļāļĢ",
"registrationOffice": "āļāđāļāļāļāļīāđāļāđāļāļāļāļĨāļīāđāļāļāļąāļ",
"moveInDate": "28 āđāļāļ·āļāļ XXXXXXX āļ.āļĻ. 2537",
"additionalNotes": "āļāļļāļāļāļĨāļāļĩāđāļāļđāļāļāļģāļŦāļāđāļēāļĒāļāļ·āđāļāļāļēāļāļāļ°āđāļāļĩāļĒāļāļāđāļēāļāđāļāļ·āđāļāļāļāļēāļāļāļēāļĒ āđāļĄāļ·āđāļ 14 XXXXXXXX 2562",
"remarks": "āļāļąāļāļĢāļąāļāļĢāļāļāļāļēāļĄāļāļģāļĢāđāļāļāļāļĩāđ āđāđāđāđ/āđāđāđāđ āļĨāļāļ§āļąāļāļāļĩāđ āđ āļāļąāļāļĒāļēāļĒāļ āđāđāđāđ",
"lastUpdated": "āļ§āļąāļāļāļĩāđ 2 āđāļāļ·āļāļ āļāļąāļāļĒāļēāļĒāļ āļ.āļĻ. 2567",
"footer": {
"text": "āļĢāļąāļāļĢāļāļāļ§āđāļēāđāļāđāļāļĢāļēāļĒāļāļēāļĢāļāļēāļāļāļēāļāļāđāļāļĄāļđāļĨāļāļēāļĢāļāļ°āđāļāļĩāļĒāļāļĢāļēāļĐāļāļĢ",
"date": "2 āđāļāļ·āļāļ āļāļąāļāļĒāļēāļĒāļ āļ.āļĻ. 2567",
"registrar": "āļāļēāļĒāļāļīāļāļāļīāļāļąāļāļāđ āđāļĨāđāļāļāļĨāļĒāļļāļāļ"
}
},
"process_ms": 8115
}
āļāļļāļāļŠāļĄāļāļąāļāļīāđāļĨāļ°āļāļ§āļēāļĄāļŠāļēāļĄāļēāļĢāļâ
āļāļļāļāļŠāļĄāļāļąāļāļīāļŦāļĨāļąāļâ
-
āļāļēāļĢāļāļĢāļ°āļĄāļ§āļĨāļāļĨāđāļāļāļŠāļēāļĢ
- āļāļēāļĢāđāļĒāļāļāđāļāļāļ§āļēāļĄāđāļĨāļ°āļāļēāļĢāļāļāļāļģāļāđāļāļĄāļđāļĨāļāđāļ§āļĒāļāļ§āļēāļĄāđāļĄāđāļāļĒāļģāļŠāļđāļ
- āļĢāļāļāļĢāļąāļāļ āļēāļĐāļēāđāļāļĒ
- āļĢāļāļāļĢāļąāļāļĢāļđāļāđāļāļāđāļāļāļŠāļēāļĢāļāļĩāđāļāļīāļĄāļāđ
- āđāļ§āļĨāļēāđāļāļāļēāļĢāļāļĢāļ°āļĄāļ§āļĨāļāļĨāļāļĩāđāļĢāļ§āļāđāļĢāđāļ§ 5-10 āļ§āļīāļāļēāļāļĩāļāđāļāđāļāļāļŠāļēāļĢ
- āļĢāļāļāļĢāļąāļāļŦāļĨāļēāļĒāļĢāļđāļāđāļāļ (JPEG, JPG, PNG, PDF)
- āļāļēāļĢāļāļąāļāļāļēāļĢāđāļāļāļŠāļēāļĢāđāļāļāļŦāļāđāļēāđāļāļĩāļĒāļ§
- āļāļąāļ§āđāļĨāļ·āļāļāđāļāļāļēāļĢāļŠāđāļāļāļ·āļāļāđāļāļāļ§āļēāļĄ OCR āļāđāļāļāļāļąāļāđāļĨāļ°āļĢāļđāļāļ āļēāļāļāļĩāđāļāđāļēāļāļāļēāļĢāļāļĢāļ°āļĄāļ§āļĨāļāļĨāđāļĨāđāļ§
- āļāļēāļĢāļāļĢāļ°āļĄāļ§āļĨāļāļĨāļāļĩāđāļŠāļāļāļāļĨāđāļāļāļāļąāļ GDPR āđāļĨāļ° PDPA
-
āļāļēāļĢāđāļĒāļāļāđāļāļĄāļđāļĨ
- āļĢāļđāļāđāļāļāļāļēāļĢāļāļāļāļŠāļāļāļ JSON āļāļĩāđāļĒāļ·āļāļŦāļĒāļļāđāļāļāļĢāđāļāļĄāļāļēāļĢāđāļĒāļāļāđāļāļĄāļđāļĨāļĢāļēāļĒāļĨāļ°āđāļāļĩāļĒāļ
āļāļīāļĨāļāđāļāļĩāđāļĢāļāļāļĢāļąāļâ
āļāļīāļĨāļāđ | āļāļāļīāļ | āļāļģāļāļāļīāļāļēāļĒ |
---|---|---|
header | String | āļāļĢāļ°āđāļ āļāđāļāļāļŠāļēāļĢāđāļĨāļ°āđāļĨāļāļāļĩāđāđāļāļāļāļāļĢāđāļĄ |
title | String | āļāļ·āđāļāđāļāļāļŠāļēāļĢāļāļĒāđāļēāļāđāļāđāļāļāļēāļāļāļēāļĢ |
nationalIdNumber | String | āđāļĨāļāļāļąāļāļĢāļāļĢāļ°āļāļēāļāļ 13 āļŦāļĨāļąāļ |
houseRegistrationNumber | String | āđāļĨāļāļāļĩāđāļāđāļēāļ |
name | String | āļāļ·āđāļāđāļāđāļĄāļāļāļāļāļļāļāļāļĨ |
gender | String | āđāļāļĻāļāļāļāļāļļāļāļāļĨ |
nationality | String | āļŠāļąāļāļāļēāļāļīāļāļāļāļāļļāļāļāļĨ |
dateOfBirth | String | āļ§āļąāļāđāļāļ·āļāļāļāļĩāđāļāļīāļāđāļāļĢāļđāļāđāļāļāļ āļēāļĐāļēāđāļāļĒ |
age | Number | āļāļēāļĒāļļāļāļąāļāļāļļāļāļąāļ |
residentialStatus | String | āļŠāļāļēāļāļ°āđāļāļāļĢāļąāļ§āđāļĢāļ·āļāļ |
mothersName | String | āļāļ·āđāļāđāļāđāļĄāļāļāļāļĄāļēāļĢāļāļē |
mothersNationality | String | āļŠāļąāļāļāļēāļāļīāļāļāļāļĄāļēāļĢāļāļē |
fathersName | String | āļāļ·āđāļāđāļāđāļĄāļāļāļāļāļīāļāļē |
fathersNationality | String | āļŠāļąāļāļāļēāļāļīāļāļāļāļāļīāļāļē |
address | String | āļāļĩāđāļāļĒāļđāđāļāļąāļāļāļļāļāļąāļ |
registrationOffice | String | āļāļ·āđāļāļŠāļģāļāļąāļāļāļēāļāļāļ°āđāļāļĩāļĒāļ |
moveInDate | String | āļ§āļąāļāļāļĩāđāļĒāđāļēāļĒāđāļāđāļēāļĄāļēāļāļĒāļđāđāļāļĩāđāļāļĒāļđāđāļāļąāļāļāļļāļāļąāļ |
additionalNotes | String | āļāđāļāļĄāļđāļĨāđāļāļīāđāļĄāđāļāļīāļĄ |
remarks | String | āļŦāļĄāļēāļĒāđāļŦāļāļļāļāļĒāđāļēāļāđāļāđāļāļāļēāļāļāļēāļĢ |
lastUpdated | String | āļ§āļąāļāļāļĩāđāļāļąāļāđāļāļāļĨāđāļēāļŠāļļāļ |
footer | Object | āļāļĢāļ°āļāļāļāļāđāļ§āļĒāļāđāļāļāļ§āļēāļĄāļĢāļąāļāļĢāļāļ āļ§āļąāļāļāļĩāđ āđāļĨāļ°āļāđāļāļĄāļđāļĨāđāļāđāļēāļŦāļāđāļēāļ āļĩāđāļĨāļāļāļ°āđāļāļĩāļĒāļ |
āļāđāļāļĄāļđāļĨāļāđāļēāļāļāļīāļ APIâ
āļāļēāļĢāļāļāļāļģāđāļāļāļŠāļēāļĢāļāļ°āđāļāļĩāļĒāļāļāđāļēāļâ
āļĄāļĩāļāļļāļāļŠāļīāđāļāļŠāļļāļāļŠāļāļāļāļļāļāļŠāļģāļŦāļĢāļąāļāļāļēāļĢāļāļĢāļ°āļĄāļ§āļĨāļāļĨāđāļāļāļŠāļēāļĢāļāļ°āđāļāļĩāļĒāļāļāđāļēāļ:
1. āļāļēāļĢāļāļąāļāđāļŦāļĨāļāđāļāļĨāđâ
POST https://api.iapp.co.th/ocr/v3/civil-registeration-certificate/file
āļŠāđāļ§āļāļŦāļąāļ§āļāļāļāļāļģāļāļâ
āļāļ·āđāļ | āļāļāļīāļ | āļāļģāđāļāđāļ | āļāļģāļāļāļīāļāļēāļĒ |
---|---|---|---|
apikey | string | āđāļāđ | API key āļāļāļāļāļļāļ |
āđāļāļ·āđāļāļŦāļēāļāļāļāļāļģāļāļ (multipart/form-data)â
āļāļēāļĢāļēāļĄāļīāđāļāļāļĢāđ | āļāļāļīāļ | āļāļģāđāļāđāļ | āļāļģāļāļāļīāļāļēāļĒ |
---|---|---|---|
file | file | āđāļāđ | āļĢāļđāļāļ āļēāļāđāļāļāļŠāļēāļĢ (JPEG, PNG) āļŦāļĢāļ·āļāđāļāļāļŠāļēāļĢ PDF |
return_image | boolean | āđāļĄāđāđāļāđ | āļĢāļ§āļĄāļĢāļđāļāļ āļēāļāļāļĩāđāđāļāđāļēāļĢāļŦāļąāļŠ base64 āđāļāļāļēāļĢāļāļāļāļŠāļāļāļ (āļāđāļēāđāļĢāļīāđāļĄāļāđāļ: false) |
return_ocr | boolean | āđāļĄāđāđāļāđ | āļĢāļ§āļĄāļāđāļāļāļ§āļēāļĄ OCR āļāļīāļāđāļāļāļēāļĢāļāļāļāļŠāļāļāļ (āļāđāļēāđāļĢāļīāđāļĄāļāđāļ: false) |
āļĢāļđāļāđāļāļāļāļēāļĢāļāļāļāļŠāļāļāļâ
{
"message": "success",
"raw": {
"image": "string", // Base64 encoded, only if return_image=true
"text": "string" // Only if return_ocr=true
},
"processed": {
"header": "string",
"title": "string",
"nationalIdNumber": "string",
"houseRegistrationNumber": "string",
"name": "string",
"gender": "string",
"nationality": "string",
"dateOfBirth": "string",
"age": "number",
"residentialStatus": "string",
"mothersName": "string",
"mothersNationality": "string",
"fathersName": "string",
"fathersNationality": "string",
"address": "string",
"registrationOffice": "string",
"moveInDate": "string",
"additionalNotes": "string",
"remarks": "string",
"lastUpdated": "string",
"footer": {
"text": "string",
"date": "string",
"registrar": "string"
}
},
"process_ms": "number"
}
āļāļēāļĢāļāļąāļāļāļēāļĢāļāđāļāļāļīāļāļāļĨāļēāļâ
āļŠāļāļēāļāļ° | āļĢāļŦāļąāļŠ | āļāļģāļāļāļīāļāļēāļĒ |
---|---|---|
400 | BAD_REQUEST | āļāļēāļĢāļēāļĄāļīāđāļāļāļĢāđāļŦāļĢāļ·āļāļĢāļđāļāđāļāļāđāļāļĨāđāđāļĄāđāļāļđāļāļāđāļāļ |
401 | UNAUTHORIZED | API key āđāļĄāđāļāļđāļāļāđāļāļāļŦāļĢāļ·āļāļŦāļēāļĒāđāļ |
404 | NOT_FOUND | āļāļļāļāļŠāļīāđāļāļŠāļļāļāđāļĄāđāļāļđāļāļāđāļāļ |
500 | INTERNAL_SERVER_ERROR | āļāļēāļĢāļāļĢāļ°āļĄāļ§āļĨāļāļĨāļĨāđāļĄāđāļŦāļĨāļ§ |
2. āļĢāļđāļāļ āļēāļ Base64â
POST https://api.iapp.co.th/ocr/v3/civil-registeration-certificate/base64
āļŠāđāļ§āļāļŦāļąāļ§āļāļāļāļāļģāļāļâ
āļāļ·āđāļ | āļāļāļīāļ | āļāļģāđāļāđāļ | āļāļģāļāļāļīāļāļēāļĒ |
---|---|---|---|
apikey | string | āđāļāđ | API key āļāļāļāļāļļāļ |
āđāļāļ·āđāļāļŦāļēāļāļāļāļāļģāļāļâ
āļāļļāļāļŠāļēāļĄāļēāļĢāļāļŠāđāļāļāđāļāļĄāļđāļĨ base64 āđāļāđāļ JSON āļŦāļĢāļ·āļāļāđāļāļĄāļđāļĨāđāļāļāļāļāļĢāđāļĄ:
āļĢāļđāļāđāļāļ JSON:
{
"base64_string": "string", // āļāđāļāļĄāļđāļĨāļĢāļđāļāļ āļēāļāļāļĩāđāđāļāđāļēāļĢāļŦāļąāļŠ base64
"return_image": false, // Optional
"return_ocr": false // Optional
}
āļĢāļđāļāđāļāļāļāđāļāļĄāļđāļĨāđāļāļāļāļāļĢāđāļĄ:
āļāļēāļĢāļēāļĄāļīāđāļāļāļĢāđ | āļāļāļīāļ | āļāļģāđāļāđāļ | āļāļģāļāļāļīāļāļēāļĒ |
---|---|---|---|
base64_string | string | āđāļāđ | āļāđāļāļĄāļđāļĨāļĢāļđāļāļ āļēāļāļāļĩāđāđāļāđāļēāļĢāļŦāļąāļŠ base64 |
return_image | boolean | āđāļĄāđāđāļāđ | āļĢāļ§āļĄāļĢāļđāļāļ āļēāļāļāļĩāđāđāļāđāļēāļĢāļŦāļąāļŠ base64 āđāļāļāļēāļĢāļāļāļāļŠāļāļāļ (āļāđāļēāđāļĢāļīāđāļĄāļāđāļ: false) |
return_ocr | boolean | āđāļĄāđāđāļāđ | āļĢāļ§āļĄāļāđāļāļāļ§āļēāļĄ OCR āļāļīāļāđāļāļāļēāļĢāļāļāļāļŠāļāļāļ (āļāđāļēāđāļĢāļīāđāļĄāļāđāļ: false) |
āļĢāļđāļāđāļāļāļāļēāļĢāļāļāļāļŠāļāļāļâ
āđāļŦāļĄāļ·āļāļāļāļąāļāļāļļāļāļŠāļīāđāļāļŠāļļāļāļāļēāļĢāļāļąāļāđāļŦāļĨāļāđāļāļĨāđ
āļāļąāļ§āļāļĒāđāļēāļāđāļāđāļâ
Python (āļāļēāļĢāļāļąāļāđāļŦāļĨāļāđāļāļĨāđ)â
import requests
apiKey = 'YOUR_API_KEY'
filePath = '/path/to/civil-registeration-certificate.jpg'
url = "https://api.iapp.co.th/ocr/v3/civil-registeration-certificate/file"
headers = {'apikey': apiKey}
files = {'file': ('civil-registeration-certificate.jpg', open(filePath, 'rb'), 'image/jpeg')}
data = {'return_image': 'false', 'return_ocr': 'false'}
response = requests.post(url, headers=headers, files=files, data=data)
print(response.json())
Python (Base64)â
import requests
import base64
apiKey = 'YOUR_API_KEY'
filePath = '/path/to/civil-registeration-certificate.jpg'
url = "https://api.iapp.co.th/ocr/v3/civil-registeration-certificate/base64"
# Read image file and convert to base64
with open(filePath, 'rb') as image_file:
base64_string = base64.b64encode(image_file.read()).decode()
headers = {
'apikey': apiKey,
'Content-Type': 'application/json'
}
data = {
'base64_string': base64_string,
'return_image': False,
'return_ocr': False
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
Javascript (āļāļēāļĢāļāļąāļāđāļŦāļĨāļāđāļāļĨāđ)â
const axios = require('axios');
const FormData = require('form-data');
const fs = require('fs');
const apiKey = 'YOUR_API_KEY';
const filePath = '/path/to/civil-registeration-certificate.jpg';
const url = 'https://api.iapp.co.th/ocr/v3/civil-registeration-certificate/file';
const form = new FormData();
form.append('file', fs.createReadStream(filePath));
form.append('return_image', 'false');
form.append('return_ocr', 'false');
try {
const response = await axios.post(
url,
form,
{
headers: {
...form.getHeaders(),
'apikey': apiKey
}
}
);
return response.data;
} catch (error) {
throw error;
}
Javascript (Base64)â
const axios = require('axios');
const fs = require('fs');
const apiKey = 'YOUR_API_KEY';
const filePath = '/path/to/civil-registeration-certificate.jpg';
const url = 'https://api.iapp.co.th/ocr/v3/civil-registeration-certificate/base64';
// Read image file and convert to base64
const base64String = fs.readFileSync(filePath, {encoding: 'base64'});
const data = {
base64_string: base64String,
return_image: false,
return_ocr: false
};
try {
const response = await axios.post(url, data, {
headers: {
'Content-Type': 'application/json',
'apikey': apiKey
}
});
return response.data;
} catch (error) {
throw error;
}
PHP (āļāļēāļĢāļāļąāļāđāļŦāļĨāļāđāļāļĨāđ)â
$url = 'https://api.iapp.co.th/ocr/v3/civil-registeration-certificate/file';
$apiKey = 'YOUR_API_KEY';
$filePath = '/path/to/civil-registeration-certificate.jpg';
$headers = array(
'apikey: ' . $apiKey
);
$postFields = array(
'file' => new CURLFile($filePath),
'return_image' => 'false',
'return_ocr' => 'false'
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postFields);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
PHP (Base64)â
$url = 'https://api.iapp.co.th/ocr/v3/civil-registeration-certificate/base64';
$apiKey = 'YOUR_API_KEY';
$filePath = '/path/to/civil-registeration-certificate.jpg';
// Read image file and convert to base64
$base64String = base64_encode(file_get_contents($filePath));
$data = array(
'base64_string' => $base64String,
'return_image' => false,
'return_ocr' => false
);
$headers = array(
'Content-Type: application/json',
'apikey: ' . $apiKey
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Swift (āļāļēāļĢāļāļąāļāđāļŦāļĨāļāđāļāļĨāđ)â
import Foundation
let url = URL(string: "https://api.iapp.co.th/ocr/v3/civil-registeration-certificate/file")!
let filePath = "/path/to/civil-registeration-certificate.jpg"
let apiKey = "YOUR_API_KEY"
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.setValue(apiKey, forHTTPHeaderField: "apikey")
let boundary = UUID().uuidString
request.setValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type")
var body = Data()
body.append("--\(boundary)\r\n".data(using: .utf8)!)
body.append("Content-Disposition: form-data; name=\"file\"; filename=\"civil-registeration-certificate.jpg\"\r\n".data(using: .utf8)!)
body.append("Content-Type: image/jpeg\r\n\r\n".data(using: .utf8)!)
body.append(try! Data(contentsOf: URL(fileURLWithPath: filePath)))
body.append("\r\n--\(boundary)\r\n".data(using: .utf8)!)
body.append("Content-Disposition: form-data; name=\"return_image\"\r\n\r\nfalse\r\n".data(using: .utf8)!)
body.append("--\(boundary)\r\n".data(using: .utf8)!)
body.append("Content-Disposition: form-data; name=\"return_ocr\"\r\n\r\nfalse\r\n".data(using: .utf8)!)
body.append("--\(boundary)--\r\n".data(using: .utf8)!)
request.httpBody = body
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data, error == nil else {
print("Error: \(error?.localizedDescription ?? "Unknown error")")
return
}
print(String(data: data, encoding: .utf8)!)
}
task.resume()
Swift (Base64)â
import Foundation
let url = URL(string: "https://api.iapp.co.th/ocr/v3/civil-registeration-certificate/base64")!
let filePath = "/path/to/civil-registeration-certificate.jpg"
let apiKey = "YOUR_API_KEY"
// Read image file and convert to base64
guard let imageData = try? Data(contentsOf: URL(fileURLWithPath: filePath)) else {
print("Error reading file")
return
}
let base64String = imageData.base64EncodedString()
let parameters: [String: Any] = [
"base64_string": base64String,
"return_image": false,
"return_ocr": false
]
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
request.setValue(apiKey, forHTTPHeaderField: "apikey")
request.httpBody = try? JSONSerialization.data(withJSONObject: parameters)
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data, error == nil else {
print("Error: \(error?.localizedDescription ?? "Unknown error")")
return
}
print(String(data: data, encoding: .utf8)!)
}
task.resume()
Kotlin (āļāļēāļĢāļāļąāļāđāļŦāļĨāļāđāļāļĨāđ)â
import okhttp3.*
import java.io.File
val client = OkHttpClient()
val apiKey = "YOUR_API_KEY"
val filePath = "/path/to/civil-registeration-certificate.jpg"
val url = "https://api.iapp.co.th/ocr/v3/civil-registeration-certificate/file"
val file = File(filePath)
val requestBody = MultipartBody.Builder()
.setType(MultipartBody.FORM)
.addFormDataPart("file", file.name, RequestBody.create(MediaType.parse("image/jpeg"), file))
.addFormDataPart("return_image", "false")
.addFormDataPart("return_ocr", "false")
.build()
val request = Request.Builder()
.url(url)
.post(requestBody)
.addHeader("apikey", apiKey)
.build()
client.newCall(request).enqueue(object : Callback {
override fun onFailure(call: Call, e: IOException) {
e.printStackTrace()
}
override fun onResponse(call: Call, response: Response) {
response.use {
if (!response.isSuccessful) throw IOException("Unexpected code $response")
println(response.body()?.string())
}
}
})
Kotlin (Base64)â
import okhttp3.*
import java.io.File
import android.util.Base64
import org.json.JSONObject
fun processBase64Image() {
val client = OkHttpClient()
val apiKey = "YOUR_API_KEY"
val filePath = "/path/to/civil-registeration-certificate.jpg"
val url = "https://api.iapp.co.th/ocr/v3/civil-registeration-certificate/base64"
// Read file and convert to base64
val file = File(filePath)
val bytes = file.readBytes()
val base64String = Base64.encodeToString(bytes, Base64.DEFAULT)
val json = JSONObject()
json.put("base64_string", base64String)
json.put("return_image", false)
json.put("return_ocr", false)
val requestBody = RequestBody.create(
MediaType.parse("application/json"),
json.toString()
)
val request = Request.Builder()
.url(url)
.post(requestBody)
.addHeader("Content-Type", "application/json")
.addHeader("apikey", apiKey)
.build()
client.newCall(request).enqueue(object : Callback {
override fun onFailure(call: Call, e: IOException) {
e.printStackTrace()
}
override fun onResponse(call: Call, response: Response) {
response.use {
if (!response.isSuccessful) throw IOException("Unexpected code $response")
println(response.body()?.string())
}
}
})
}
Java (āļāļēāļĢāļāļąāļāđāļŦāļĨāļāđāļāļĨāđ)â
import okhttp3.*;
import java.io.File;
import java.io.IOException;
public class Main {
public static void main(String[] args) {
OkHttpClient client = new OkHttpClient();
String apiKey = "YOUR_API_KEY";
String url = "https://api.iapp.co.th/ocr/v3/civil-registeration-certificate/file";
String filePath = "/path/to/civil-registeration-certificate.jpg";
File file = new File(filePath);
RequestBody requestBody = new MultipartBody.Builder()
.setType(MultipartBody.FORM)
.addFormDataPart("file", file.getName(), RequestBody.create(MediaType.parse("image/jpeg"), file))
.addFormDataPart("return_image", "false")
.addFormDataPart("return_ocr", "false")
.build();
Request request = new Request.Builder()
.url(url)
.post(requestBody)
.addHeader("apikey", apiKey)
.build();
client.newCall(request).enqueue(new Callback() {
@Override
public void onFailure(Call call, IOException e) {
e.printStackTrace();
}
@Override
public void onResponse(Call call, Response response) throws IOException {
if (!response.isSuccessful()) throw new IOException("Unexpected code " + response);
System.out.println(response.body().string());
}
});
}
}
Java (Base64)â
import okhttp3.*;
import java.io.File;
import java.io.IOException;
import java.util.Base64;
import java.nio.file.Files;
import org.json.JSONObject;
public class Main {
public static void main(String[] args) {
OkHttpClient client = new OkHttpClient();
String apiKey = "YOUR_API_KEY";
String url = "https://api.iapp.co.th/ocr/v3/civil-registeration-certificate/base64";
String filePath = "/path/to/civil-registeration-certificate.jpg";
try {
// Read file and convert to base64
byte[] fileContent = Files.readAllBytes(new File(filePath).toPath());
String base64String = Base64.getEncoder().encodeToString(fileContent);
JSONObject json = new JSONObject();
json.put("base64_string", base64String);
json.put("return_image", false);
json.put("return_ocr", false);
RequestBody requestBody = RequestBody.create(
MediaType.parse("application/json"),
json.toString()
);
Request request = new Request.Builder()
.url(url)
.post(requestBody)
.addHeader("Content-Type", "application/json")
.addHeader("apikey", apiKey)
.build();
client.newCall(request).enqueue(new Callback() {
@Override
public void onFailure(Call call, IOException e) {
e.printStackTrace();
}
@Override
public void onResponse(Call call, Response response) throws IOException {
if (!response.isSuccessful()) throw new IOException("Unexpected code " + response);
System.out.println(response.body().string());
}
});
} catch (Exception e) {
e.printStackTrace();
}
}
}
Dart (āļāļēāļĢāļāļąāļāđāļŦāļĨāļāđāļāļĨāđ)â
import 'dart:convert';
import 'dart:io';
import 'package:http/http.dart' as http;
String url = 'https://api.iapp.co.th/ocr/v3/civil-registeration-certificate/file';
String filePath = '/path/to/civil-registeration-certificate.jpg';
String apiKey = 'YOUR_API_KEY';
void main() async {
var url = Uri.parse(url);
var request = http.MultipartRequest('POST', url)
..headers['apikey'] = apiKey
..files.add(await http.MultipartFile.fromPath('file', filePath))
..fields['return_image'] = 'false'
..fields['return_ocr'] = 'false';
var response = await request.send();
if (response.statusCode == 200) {
var responseData = await response.stream.bytesToString();
print(responseData);
} else {
print('Error: ${response.statusCode}');
}
}
Dart (Base64)â
import 'dart:convert';
import 'dart:io';
import 'package:http/http.dart' as http;
String url = 'https://api.iapp.co.th/ocr/v3/civil-registeration-certificate/base64';
String filePath = '/path/to/civil-registeration-certificate.jpg';
String apiKey = 'YOUR_API_KEY';
void main() async {
var url = Uri.parse(url);
var request = http.MultipartRequest('POST', url)
..headers['apikey'] = apiKey
..fields['return_image'] = 'false'
..fields['return_ocr'] = 'false';
// Read image file and convert to base64
File file = File(filePath);
List<int> fileBytes = await file.readAsBytes();
String base64String = base64Encode(fileBytes);
request.fields['base64_string'] = base64String;
var response = await request.send();
if (response.statusCode == 200) {
var responseData = await response.stream.bytesToString();
print(responseData);
} else {
print('Error: ${response.statusCode}');
}
}
āļāđāļāļāļģāļāļąāļāđāļĨāļ°āđāļāļ§āļāļēāļāļāļāļīāļāļąāļāļīāļāļĩāđāļāļĩāļāļĩāđāļŠāļļāļâ
āļāđāļāļāļģāļāļąāļâ
- āļāļāļēāļāđāļāļĨāđāļŠāļđāļāļŠāļļāļ: 10MB
- āļ āļēāļĐāļēāļāļĩāđāļĢāļāļāļĢāļąāļ: āđāļāļĒ
- āđāļāļĨāđ PDF: āļŦāļāđāļēāđāļāļĩāļĒāļ§āđāļāđāļēāļāļąāđāļ
- āļāļĩāļāļāļģāļāļąāļāļāļąāļāļĢāļē: 10 āļāļģāļāļāļāđāļāļ§āļīāļāļēāļāļĩāļāđāļ API key