Scan Document
curl --request POST \
--url https://api.deepidv.com/v1/document/scanimport requests
url = "https://api.deepidv.com/v1/document/scan"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.deepidv.com/v1/document/scan', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.deepidv.com/v1/document/scan",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.deepidv.com/v1/document/scan"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.deepidv.com/v1/document/scan")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.deepidv.com/v1/document/scan")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"documentType": "drivers_license",
"fullName": "JANE Q PUBLIC",
"firstName": "JANE",
"lastName": "PUBLIC",
"dateOfBirth": "1990-04-12",
"gender": "F",
"nationality": "USA",
"documentNumber": "D1234567",
"expirationDate": "2030-04-12",
"issuingCountry": "USA",
"address": "123 MAIN ST, SPRINGFIELD, IL 62701",
"rawFields": {
"FIRST_NAME": "JANE",
"LAST_NAME": "PUBLIC",
"DATE_OF_BIRTH": "04/12/1990"
},
"confidence": 0.97
}
Server-to-Server
Scan Document
Extract fields from a government-issued ID and run authenticity checks
POST
/
v1
/
document
/
scan
Scan Document
curl --request POST \
--url https://api.deepidv.com/v1/document/scanimport requests
url = "https://api.deepidv.com/v1/document/scan"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.deepidv.com/v1/document/scan', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.deepidv.com/v1/document/scan",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.deepidv.com/v1/document/scan"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.deepidv.com/v1/document/scan")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.deepidv.com/v1/document/scan")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"documentType": "drivers_license",
"fullName": "JANE Q PUBLIC",
"firstName": "JANE",
"lastName": "PUBLIC",
"dateOfBirth": "1990-04-12",
"gender": "F",
"nationality": "USA",
"documentNumber": "D1234567",
"expirationDate": "2030-04-12",
"issuingCountry": "USA",
"address": "123 MAIN ST, SPRINGFIELD, IL 62701",
"rawFields": {
"FIRST_NAME": "JANE",
"LAST_NAME": "PUBLIC",
"DATE_OF_BIRTH": "04/12/1990"
},
"confidence": 0.97
}
POST /v1/document/scan
documentType, and an average extraction confidence score.
Request
Headers
| Header | Required | Description |
|---|---|---|
x-api-key | Yes | Your API key |
Content-Type | Yes | multipart/form-data or application/json |
Body parameters
The endpoint accepts the image either as raw multipart bytes or as a JSON string (base64, base64url, or an S3 key from an earlier presigned upload). See the overview for the shared image rules — accepted formats, the 15 MB limit, and when to prefer one over the other.| Parameter | Type | Required | Description |
|---|---|---|---|
image | binary | string | Yes | The image. For multipart, the file part. For JSON, a base64, base64url, or S3-key string. |
documentType | string | No | One of passport, drivers_license, national_id, auto. Defaults to auto. |
Example request
curl -X POST https://api.deepidv.com/v1/document/scan \
-H "x-api-key: YOUR_API_KEY" \
-F "image=@/path/to/id.jpg" \
-F "documentType=drivers_license"
curl -X POST https://api.deepidv.com/v1/document/scan \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"image": "uploads/abc123-driver-license.jpg",
"documentType": "drivers_license"
}'
import fs from "node:fs";
const form = new FormData();
form.append("image", new Blob([fs.readFileSync("/path/to/id.jpg")]), "id.jpg");
form.append("documentType", "drivers_license");
const response = await fetch("https://api.deepidv.com/v1/document/scan", {
method: "POST",
headers: { "x-api-key": "YOUR_API_KEY" },
body: form,
});
const data = await response.json();
import requests
with open("/path/to/id.jpg", "rb") as f:
response = requests.post(
"https://api.deepidv.com/v1/document/scan",
headers={"x-api-key": "YOUR_API_KEY"},
files={"image": f},
data={"documentType": "drivers_license"},
)
Response
200 — Success
| Field | Type | Description |
|---|---|---|
documentType | string | Normalized document type extracted from the image |
fullName | string | Full name as printed on the document |
firstName | string | First / given name |
lastName | string | Last / family name |
dateOfBirth | string | Date of birth as printed on the document |
gender | string | Gender as printed on the document |
nationality | string | Nationality as printed on the document |
documentNumber | string | Document number |
expirationDate | string | Document expiration date |
issuingCountry | string | Issuing country |
address | string | Address as printed on the document (when present) |
mrzData | string | Machine-readable zone, raw (passports / some IDs) |
rawFields | object | All fields returned by AWS Textract, keyed by Textract field name |
confidence | number (0–1) | Average extraction confidence across all detected fields |
Error responses
| Status | Description |
|---|---|
400 | Invalid body, unsupported image format, or image larger than 15 MB |
401 | Missing or invalid x-api-key |
402 | Insufficient token balance |
403 | The supplied image S3 key is not readable by this organization |
429 | Rate limit exceeded |
500 | Unexpected server error — safe to retry with backoff |
{
"documentType": "drivers_license",
"fullName": "JANE Q PUBLIC",
"firstName": "JANE",
"lastName": "PUBLIC",
"dateOfBirth": "1990-04-12",
"gender": "F",
"nationality": "USA",
"documentNumber": "D1234567",
"expirationDate": "2030-04-12",
"issuingCountry": "USA",
"address": "123 MAIN ST, SPRINGFIELD, IL 62701",
"rawFields": {
"FIRST_NAME": "JANE",
"LAST_NAME": "PUBLIC",
"DATE_OF_BIRTH": "04/12/1990"
},
"confidence": 0.97
}
When to use /v1/identity/verify instead
If you also have a selfie and want a single round-trip that runs document scan + face detect + face compare in parallel, call /v1/identity/verify instead — it returns one aggregated payload with an overallConfidence score.⌘I