OCR
Read Lao government documents and bank cards into structured JSON.
POST
/v1/ocr/scan API key Send the document as multipart/form-data. The type hint is optional — when omitted
the service auto‑detects the document type.
Form fields
image * file | The document image or PDF. Max 15 MB. |
type string | Document type hint (see below). Auto-detected when omitted. |
projectId uuid | Attach the result to a project. |
Headers
X-Storage-Option none | platform | byo | Opt into result storage. PRO/ENTERPRISE only. Default: none. |
Supported document types
PASSPORT · ID_CARD_NEW · ID_CARD_OLD · DRIVING_LICENSE · BANK_CARD · ENTERPRISE_REGISTRATION
Example
curl -X POST https://api-ocr.vanguardinitiative.com/v1/ocr/scan \
-H "authorization: Bearer $API_KEY" \
-F image=@passport.jpg -F type=PASSPORTconst form = new FormData();
form.append('image', file);
form.append('type', 'PASSPORT');
const res = await fetch('https://api-ocr.vanguardinitiative.com/v1/ocr/scan', {
method: 'POST',
headers: { authorization: 'Bearer ' + API_KEY },
body: form,
});
console.log(await res.json());import requests
with open('passport.jpg', 'rb') as f:
res = requests.post(
'https://api-ocr.vanguardinitiative.com/v1/ocr/scan',
headers={'authorization': f'Bearer {API_KEY}'},
files={'image': f},
data={'type': 'PASSPORT'},
)
print(res.json())200 Extraction result
{
"status": "success",
"service": "ocr",
"data": {
"documentType": "PASSPORT",
"surname": "SISOMPHONE",
"givenNames": "SOUKAN",
"passportNo": "P1234567",
"dateOfBirth": "1990-05-12",
"dateOfExpiry": "2030-05-11"
},
"credits": 1,
"latencyMs": 842,
"stored": null
}The data object’s shape depends on the detected document type. Each field is
best‑effort — always validate against your own expectations before relying on a value.