Read an ID document
Onboarding forms die at the ID upload step when someone has to retype a document number by hand. This endpoint reads a photographed or scanned identification card and returns the printed fields as structured data, so your signup flow keeps moving instead of stalling on a keyboard.
Run it online
Run this on our servers with your account. Free tools run in your browser; this one bills your KIT balance per the price above.
Built for the moment before trust
Every KYC flow, rental application or age-gated signup hits the same wall: a human has to confirm that the document in front of the camera says what the form claims. This endpoint reads national ID cards, driver's licenses and resident permits, and hands back the printed fields as clean data instead of a photo someone has to squint at.
What comes back
Send one image of the front of the document and you receive the holder's full name, document number, date of birth, expiration date and issuing authority when present, each tagged with the field it came from. The response is plain structured data, not a rendering of the card, which matters for teams that store the extracted fields but never keep the original image.
Consent is part of the request, not an afterthought
Identification documents carry personal data, so this endpoint is designed around a simple rule: you send it because the document holder agreed to the check, and we do not repurpose that image for anything beyond producing your result. Once retention expires, the file is deleted; nothing you send is used to improve or train models.
How the request behaves
Call POST /ocr/id-document with the image and you get a task_id immediately. The job runs asynchronously and the answer arrives at your webhook, or you can fetch it from a signed link that stays valid for 24 hours. If the document is unreadable after three internal retries, you get a clear error instead of a bill.
Where it slots into a pipeline
Because the call is async and billed per completed task, teams wire it straight into signup or verification queues: a user uploads a photo, your backend fires the request, and by the time the rest of the onboarding form is validated the extracted fields are usually already sitting in your database ready for a human or a rules engine to review.
What you can do with it
Account opening for regulated services
A fintech captures a driver's license photo during signup and auto-fills the applicant's legal name and birth date instead of asking them to type it twice.
Short-term rental check-in
A property manager scans a guest's ID at check-in to log the name and document number against the reservation without a front-desk clerk transcribing it.
Age verification at the door
An event platform reads the date of birth from an uploaded ID to confirm eligibility before issuing a ticket, without storing the photo afterward.
HR document intake
A staffing agency batches new hires' ID uploads overnight and pulls document numbers into the HR system before the morning shift starts.
FAQ
What is the ID document OCR API for?
It reads a photo or scan of a national ID, driver's license or resident permit and returns the printed fields as structured data for KYC, onboarding or check-in flows.
Is there a free tier or trial?
There's no free tier — free tiers get abused and slow everyone down. Access runs on a prepaid ForHosting KIT balance: top up from $10.00 (it never expires) and each request is charged at its published price, so a call with no balance returns HTTP 402. No subscription, no tokens, no invented credits, and a failed task is never charged.
What does it cost?
$0.010 per request plus $0.0575 per image processed, billed only on completed tasks. A failed task is never charged.
Which document types are supported?
National ID cards, driver's licenses and resident permits with a standard printed layout are the primary target; results depend on image legibility.
How do I get the result?
Send the request to POST /ocr/id-document, receive a task_id right away, and collect the output via a signed webhook or a signed link valid for 24 hours.
Do you keep the document image?
No. Images and results are deleted once the retention window closes, and nothing submitted is used for model training.
What happens if the ID photo is blurry or cropped?
The system retries internally up to three times; if it still can't read the document, you get a clear error response and are not charged.
Can I process many IDs at once?
Yes, each document is its own async task, so you can submit a batch of images and collect results as each task completes rather than waiting on one synchronous call.
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, and soon from our app, email and Telegram.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/ocr/id-document \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"image":"https://ejemplo.com/imagen.jpg"}'const res = await fetch("https://api.kit.forhosting.com/ocr/id-document", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"image": "https://ejemplo.com/imagen.jpg"
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/ocr/id-document",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"image": "https://ejemplo.com/imagen.jpg"
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/ocr/id-document", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"image":"https://ejemplo.com/imagen.jpg"}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"image":"https://ejemplo.com/imagen.jpg"}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/ocr/id-document", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"image": "https://ejemplo.com/imagen.jpg"
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "ocr.id_document",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Limits
max_mb | 25 |
max_pages | 10 |
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
422 | task_failed | The task failed after 3 retries. You are never charged for it. |