Jamaican Passport OCR API with Node.js
Extract passport number, names, nationality, and validity dates from Jamaican passports with the StructOCR Node.js SDK, reading both MRZ and printed fields.
Extracting Data from Jamaican Passports
Passports issued by Jamaica follow the ICAO Doc 9303 data page layout with a two-line MRZ, and the issuing authority and place of birth appear only in the printed zone. Glare on the laminate and perspective make manual entry or plain-text OCR unreliable.
MRZ and Visual Zone in One Call
The Passport OCR API reads the MRZ and the printed visual zone and returns normalized fields, including place of birth and issuing authority where printed. Try it with the free passport scanner.
Common Integration Scenarios
- Travel onboarding: Pre-fill passport details before the traveller confirms them.
- Hotel and rental check-in: Capture guest passport data for local registration rules.
- KYC intake: Feed extracted fields into your own verification steps.
Jamaican Passport OCR API with Node.js
The official Node.js SDK reads a local file and calls /v1/passport from your backend.
Prerequisite: `npm install structocr`; set the server-side `STRUCTOCR_API_KEY` environment variable.
Prefer another stack? Open the Python SDK + FastAPI integration.
const StructOCR = require("structocr");
const client = new StructOCR(process.env.STRUCTOCR_API_KEY);
async function main() {
const result = await client.scanPassport("passport.jpg");
if (result.success) {
const data = result.data;
console.log(data.document_number || data.passport_number);
console.log(data.given_names, data.surname);
} else {
console.error(result.error);
}
}
main().catch(console.error);Technical Specs
- •Endpoint: POST /v1/passport
- •Input: Base64-encoded JPG, PNG, WebP, or PDF in JSON (Max 4.5MB)
- •Authentication: Server-side x-api-key header handled by the SDK
- •Cost: 2 credits per successful scan; failed requests are not billed
- •Output: Structured JSON
Key Features
- •MRZ plus visual zone: Returns fields the MRZ truncates or omits, such as place of birth.
- •ICAO country codes: country_code uses the three-letter code printed on the passport.
- •Validity dates: Issue and expiry dates as YYYY-MM-DD.
- •Server-side SDK: Encodes the file and sends the request from your backend.
JSON Response Example
Fictional values showing the normalized fields for a readable Jamaican passport; unavailable fields are null.
{
"success": true,
"data": {
"type": "passport",
"country_code": "JAM",
"nationality": "JAMAICAN",
"passport_number": "P0000000",
"surname": "DOE",
"given_names": "ALEX",
"sex": "X",
"date_of_birth": "1990-01-01",
"place_of_birth": "KINGSTON",
"date_of_issue": "2024-05-10",
"date_of_expiry": "2034-05-09",
"issuing_authority": "PASSPORT, IMMIGRATION AND CITIZENSHIP AGENCY"
}
}Frequently Asked Questions
Can I scan a PDF of a Jamaican passport?
Yes. The endpoint accepts a Base64-encoded JPG, PNG, WebP, or PDF up to 4.5MB.
Does OCR verify the passport?
No. OCR extracts readable fields; authenticity and eligibility decisions need separate controls.
Is there a version for the other SDK language?
Yes. A paired Python version of this tutorial covers the same document.
You May Also Like
Related tutorials, platform guides, and comparisons
Jamaican Passport OCR API with Python
Extract passport number, names, nationality, and validity dates from Jamaican passports with the StructOCR Python SDK, reading both MRZ and printed fields.
Node.js Passport OCR API
High-accuracy Node.js Passport OCR API for parsing the MRZ. Upload an image for a free test! Get structured JSON output in seconds using our official Node.js SDK. Stop fighting Tesseract.
Kazakhstan Passport OCR with Node.js SDK
Use the official StructOCR Node.js SDK with TypeScript and Express to extract structured MRZ and VIZ data from Kazakhstan passports.
Jordanian Passport OCR API with Node.js
Extract passport number, names, nationality, and validity dates from Jordanian passports with the StructOCR Node.js SDK, reading both MRZ and printed fields.
Mongolian Passport OCR API with Node.js
Extract passport number, names, nationality, and validity dates from Mongolian passports with the StructOCR Node.js SDK, reading both MRZ and printed fields.
Thailand Passport OCR with Node.js SDK
Use the official StructOCR Node.js SDK with TypeScript and Express to extract structured MRZ and VIZ data from Thailand passports.
Mexico Passport OCR with Node.js SDK
Use the official StructOCR Node.js SDK with TypeScript and Express to extract structured MRZ and VIZ data from Mexico passports.
Malaysia Passport OCR with Node.js SDK
Use the official StructOCR Node.js SDK with TypeScript and Express to extract structured MRZ and VIZ data from Malaysia passports.
Malaysia Passport OCR with Python SDK
Use the official StructOCR Python SDK and FastAPI to extract structured MRZ and VIZ data from Malaysia passports with a server-side integration.
Kenya Passport OCR with Python SDK
Use the official StructOCR Python SDK and FastAPI to extract structured MRZ and VIZ data from Kenya passports with a server-side integration.
Technical Comparisons & Integrations
Explore platform integrations and competitive analysis
Extracting ECR Status & File Numbers: Generic OCR vs. StructOCR Indian Passport API
Learn why generic text extractors fail to capture critical Indian KYC fields like ECR status and File Numbers, and how a specialized API structures this data automatically.
Heavy KYC SDKs vs. StructOCR Passport API for Mobile Apps
Discover why modern app developers are abandoning bulky on-device OCR SDKs in favor of lightweight, edge-deployed Passport APIs.
Add Passport OCR to Your Lovable.dev App in 5 Minutes
Step-by-step guide to integrating the StructOCR Passport scanner API into a Lovable.dev app through a secure server-side function for travel and KYC flows.
Add Passport OCR to Your Replit App in 5 Minutes
Step-by-step guide to integrating the StructOCR Passport scanner API into a Replit application. Build travel, hospitality, and global KYC flows using Replit Agent and Secrets.
Tesseract & PassportEye vs. StructOCR Passport API
A technical evaluation for developers deciding between open-source MRZ scanners and a dedicated cloud-based Passport OCR API.
Add Passport OCR to Your v0 App in 5 Minutes
Step-by-step guide to integrating the StructOCR Passport scanner API into a v0 by Vercel app through a secure Next.js server route.
From tutorial to production in 5 minutes.
You've seen the code. Now get your API key, grab your 200 free credits, and see it work with your own images. No credit card required.