Skip to main content

🪪 AI CV and Information Extraction API 🆕

🪪 AI to extract structured data from CVs in PDF or image formats using OCR and Thai language model

Version Status New

This project provides a FastAPI application that processes Curriculum Vitae (CV) documents (PDF, JPG, PNG). Using the iApp OCR service, it extracts raw text from the CV and then employs the OpenThaiGPT model to parse the text into structured JSON data. The structured data includes personal details, education history, work experience, skills, and AI-suggested potential skills, which can be utilized for further analysis or recruitment purposes.

Try Demo

Example Images (Click to try)

Example 1

Demo key is limited to 10 requests per day per IP
Click here to get your API key

How to get API Key?

Please visit API Portal to view your existing API key or request a new one.

Code Examples

CV Sample

CV Example

Request:

    curl -X POST https://api.iapp.co.th/ocr/cv
-H "apikey: YOUR_API_KEY"
-F "file=@/path/to/sample_cv_2.jpg"

Response:

{
"personalInformation": {
"name": "นางสาวอุไรวรรณ เจียมบุญศรี",
"address": "317 ถ.นครวรรค์ แขวงวัดโสมนัส เขตป้อมปราศัตรูพ่าย กทม. 10100",
"phoneNumbers": ["082-996-5168"],
"email": "uraiwan91790@gmail.com",
"religion": "พุทธ",
"nationality": "ไทย",
"age": "43"
},
"education": [
{
"school": "โรงเรียนราชวินิต มัธยม",
"level": "มัธยมศึกษาปีที่ 6",
"year": "2538-2540"
}
],
"workExperience": [
{
"title": "Recruitment officer",
"company": "Apex medical center",
"startDate": "May 2022",
"endDate": "December 2022",
"roles": ["สรรหาพนักงานตำแหน่ง consultant, beauty therapist, nurse"]
},
{
"title": "Recruitment officer",
"company": "GMI Market",
"startDate": "April 2022",
"endDate": "June 2022",
"roles": ["สรรหาบุคลากร ตำแหน่ง sale เกี่ยวกับการเทรดเดอร์"]
},
{
"title": "Senior recruitment",
"company": "บริษัท รักษาความปลอดภัย RGH",
"startDate": "January 2022",
"endDate": "March 2022",
"roles": ["สรรหาพนักงานตำแหน่ง รปภ.,แม่บ้าน"]
}
],
"skillsAndQualifications": {
"languages": {
"english": "พูด เขียน สื่อสาร ภาษาอังกฤษได้เป็นอย่างดี"
},
"computerSkills": ["สามารถใช้โปรแกนมคอมพิวเตอร์"],
"communicationSkills": []
},
"possibleSkillAndQualificationsByAI": [
"Recruiting",
"Applicant Tracking Systems (ATS)",
"Interviewing",
"Talent Acquisition",
"Onboarding",
"HRIS",
"Performance Management",
"Employee Relations",
"Sales",
"Trading",
"Security",
"Customer Service",
"Teamwork",
"Communication"
],
"additionalInformation": {
"customerServiceSkills": null,
"assessment": null
}
}

Features

  • CV Processing: Extracts structured information from CVs, including personal details, education, work experience, skills, and AI-suggested potential skills.

  • Supported Formats: Accepts PDF, JPG, PNG, and JPEG files.

Code Examples

Python

import requests

url = "https://api.iapp.co.th/ocr/cv"

payload = {}
files=[
('file',('sample_cv_2.jpg',open('sample_cv_2.jpg','rb'),'application/pdf'))
]
headers = {"apikey": "YOUR_API_KEY"}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)

JavaScript

const axios = require("axios")
const FormData = require("form-data")
const fs = require("fs")

let data = new FormData()
data.append("file", fs.createReadStream("sample_cv_2.jpg"))

let config = {
method: "post",
maxBodyLength: Infinity,
url: "https://api.iapp.co.th/ocr/cv",
headers: {
apikey: "YOUR_API_KEY",
...data.getHeaders(),
},
data: data,
}

axios
.request(config)
.then((response) => {
console.log(JSON.stringify(response.data))
})
.catch((error) => {
console.log(error)
})

PHP

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.iapp.co.th/ocr/cv',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => array('file'=> new CURLFILE('sample_cv_2.jpg')),
CURLOPT_HTTPHEADER => array(
'apikey: YOUR_API_KEY'
),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;


Swift

let parameters = [
[
"key": "file",
"src": "sample_cv_2.jpg",
"type": "file"
]] as [[String: Any]]

let boundary = "Boundary-\(UUID().uuidString)"
var body = Data()
var error: Error? = nil
for param in parameters {
if param["disabled"] != nil { continue }
let paramName = param["key"]!
body += Data("--\(boundary)\r\n".utf8)
body += Data("Content-Disposition:form-data; name=\"\(paramName)\"".utf8)
if param["contentType"] != nil {
body += Data("\r\nContent-Type: \(param["contentType"] as! String)".utf8)
}
let paramType = param["type"] as! String
if paramType == "text" {
let paramValue = param["value"] as! String
body += Data("\r\n\r\n\(paramValue)\r\n".utf8)
} else {
let paramSrc = param["src"] as! String
let fileURL = URL(fileURLWithPath: paramSrc)
if let fileContent = try? Data(contentsOf: fileURL) {
body += Data("; filename=\"\(paramSrc)\"\r\n".utf8)
body += Data("Content-Type: \"content-type header\"\r\n".utf8)
body += Data("\r\n".utf8)
body += fileContent
body += Data("\r\n".utf8)
}
}
}
body += Data("--\(boundary)--\r\n".utf8);
let postData = body


var request = URLRequest(url: URL(string: "https://api.iapp.co.th/ocr/cv")!,timeoutInterval: Double.infinity)
request.addValue("YOUR_API_KEY", forHTTPHeaderField: "apikey")
request.addValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type")

request.httpMethod = "POST"
request.httpBody = postData

let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data else {
print(String(describing: error))
return
}
print(String(data: data, encoding: .utf8)!)
}

task.resume()


Kotlin

val client = OkHttpClient()
val mediaType = "text/plain".toMediaType()
val body = MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("file","sample_cv_2.jpg",
File("sample_cv_2.jpg").asRequestBody("application/octet-stream".toMediaType()))
.build()
val request = Request.Builder()
.url("https://api.iapp.co.th/ocr/cv")
.post(body)
.addHeader("apikey", "YOUR_API_KEY")
.build()
val response = client.newCall(request).execute()

Java

OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("file","sample_cv_2.jpg",
RequestBody.create(MediaType.parse("application/octet-stream"),
new File("sample_cv_2.jpg")))
.build();
Request request = new Request.Builder()
.url("https://api.iapp.co.th/ocr/cv")
.method("POST", body)
.addHeader("apikey", "YOUR_API_KEY")
.build();
Response response = client.newCall(request).execute();

Dart

var headers = {
'apikey': 'YOUR_API_KEY'
};
var request = http.MultipartRequest('POST', Uri.parse('https://api.iapp.co.th/ocr/cv'));
request.files.add(await http.MultipartFile.fromPath('file', 'sample_cv_2.jpg'));
request.headers.addAll(headers);

http.StreamedResponse response = await request.send();

if (response.statusCode == 200) {
print(await response.stream.bytesToString());
}
else {
print(response.reasonPhrase);
}

Pricing

AI API Service NameEndpointIC Per PageOn-Premise
AI CV OCR and Information Extraction APIiapp_cv_ocr1 IC/PageContact