Scan Business Card
curl --request POST \
--url https://api.example.com/v1/scan/business-card \
--header 'Content-Type: application/json' \
--data '
{
"image_base64": "<string>",
"image_url": "<string>",
"language": "<string>",
"create_contact": true
}
'import requests
url = "https://api.example.com/v1/scan/business-card"
payload = {
"image_base64": "<string>",
"image_url": "<string>",
"language": "<string>",
"create_contact": True
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
image_base64: '<string>',
image_url: '<string>',
language: '<string>',
create_contact: true
})
};
fetch('https://api.example.com/v1/scan/business-card', 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.example.com/v1/scan/business-card",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'image_base64' => '<string>',
'image_url' => '<string>',
'language' => '<string>',
'create_contact' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/scan/business-card"
payload := strings.NewReader("{\n \"image_base64\": \"<string>\",\n \"image_url\": \"<string>\",\n \"language\": \"<string>\",\n \"create_contact\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
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.example.com/v1/scan/business-card")
.header("Content-Type", "application/json")
.body("{\n \"image_base64\": \"<string>\",\n \"image_url\": \"<string>\",\n \"language\": \"<string>\",\n \"create_contact\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/scan/business-card")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"image_base64\": \"<string>\",\n \"image_url\": \"<string>\",\n \"language\": \"<string>\",\n \"create_contact\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"fields": {
"full_name": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"job_title": "<string>",
"company_name": "<string>",
"email": "<string>",
"phone": "<string>",
"mobile": "<string>",
"website": "<string>",
"address": "<string>"
},
"contact_id": "<string>",
"confidence": 123,
"raw_text": "<string>",
"credits_remaining": 123
}
}Enrichment
Scan Business Card
Extract contact details from a photo of a business card using OCR and AI parsing
POST
/
v1
/
scan
/
business-card
Scan Business Card
curl --request POST \
--url https://api.example.com/v1/scan/business-card \
--header 'Content-Type: application/json' \
--data '
{
"image_base64": "<string>",
"image_url": "<string>",
"language": "<string>",
"create_contact": true
}
'import requests
url = "https://api.example.com/v1/scan/business-card"
payload = {
"image_base64": "<string>",
"image_url": "<string>",
"language": "<string>",
"create_contact": True
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
image_base64: '<string>',
image_url: '<string>',
language: '<string>',
create_contact: true
})
};
fetch('https://api.example.com/v1/scan/business-card', 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.example.com/v1/scan/business-card",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'image_base64' => '<string>',
'image_url' => '<string>',
'language' => '<string>',
'create_contact' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/scan/business-card"
payload := strings.NewReader("{\n \"image_base64\": \"<string>\",\n \"image_url\": \"<string>\",\n \"language\": \"<string>\",\n \"create_contact\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
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.example.com/v1/scan/business-card")
.header("Content-Type", "application/json")
.body("{\n \"image_base64\": \"<string>\",\n \"image_url\": \"<string>\",\n \"language\": \"<string>\",\n \"create_contact\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/scan/business-card")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"image_base64\": \"<string>\",\n \"image_url\": \"<string>\",\n \"language\": \"<string>\",\n \"create_contact\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"fields": {
"full_name": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"job_title": "<string>",
"company_name": "<string>",
"email": "<string>",
"phone": "<string>",
"mobile": "<string>",
"website": "<string>",
"address": "<string>"
},
"contact_id": "<string>",
"confidence": 123,
"raw_text": "<string>",
"credits_remaining": 123
}
}This endpoint consumes 1 enrichment credit per successful scan. Requests that fail to detect any card fields return
409 no_match and do not consume credits. If the workspace balance is zero, the API returns 402 insufficient_credits.Request
Upload either a base64-encoded image or a URL. The endpoint runs OCR, parses the result with an LLM, and returns structured contact fields. It does not create a contact automatically - callPOST /v1/contacts with the returned data to persist it.
Headers
Authorization: Bearer wbk_your_api_key_here
Content-Type: application/json
string
Optional UUID. Same image and key returns the cached result within 24 hours without consuming additional credits.
Body Parameters
string
Base64-encoded image bytes. Supported formats: PNG, JPG, WEBP, HEIC. Maximum 10 MB. Either
image_base64 or image_url is required.string
Public HTTPS URL to fetch the image from. The URL must be reachable within 5 seconds.
string
default:"auto"
ISO 639-1 language hint for OCR (e.g.
en, de, fr). Defaults to automatic detection.boolean
default:"false"
When
true, the extracted data is used to create a new contact and the resulting contact_id is returned alongside the raw fields.Response
object
Show properties
Show properties
object
string
Present when
create_contact=truenumber
Overall confidence (0.0 - 1.0)
string
Raw OCR text for debugging
integer
Workspace balance after the call
X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, and X-Request-ID.
curl -X POST \
https://data.leadlex.com/functions/v1/api-gateway/v1/scan/business-card \
-H "Authorization: Bearer wbk_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"image_url": "https://example.com/cards/jane.jpg"}'
import base64, requests
API_KEY = "wbk_your_api_key_here"
BASE_URL = "https://data.leadlex.com/functions/v1/api-gateway"
with open("jane.jpg", "rb") as f:
img = base64.b64encode(f.read()).decode()
r = requests.post(
f"{BASE_URL}/v1/scan/business-card",
headers={
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json",
},
json={"image_base64": img, "create_contact": True},
)
print(r.json()["data"]["fields"])
const res = await fetch(
'https://data.leadlex.com/functions/v1/api-gateway/v1/scan/business-card',
{
method: 'POST',
headers: {
'Authorization': 'Bearer wbk_your_api_key_here',
'Content-Type': 'application/json',
},
body: JSON.stringify({ image_url: 'https://example.com/cards/jane.jpg' }),
}
);
const { data } = await res.json();
console.log(data.fields);
Example Response
{
"data": {
"fields": {
"full_name": "Jane Doe",
"first_name": "Jane",
"last_name": "Doe",
"job_title": "General Counsel",
"company_name": "Acme Corp",
"email": "jane@acme.com",
"phone": "+1-555-0100",
"mobile": null,
"website": "https://acme.com",
"address": "500 5th Ave, New York, NY 10110"
},
"contact_id": null,
"confidence": 0.88,
"raw_text": "Jane Doe\nGeneral Counsel\nAcme Corp\njane@acme.com\n+1-555-0100",
"credits_remaining": 4868
}
}
Errors
| Status | Code | Description |
|---|---|---|
| 400 | validation_error | Neither image_base64 nor image_url provided, or image exceeds size cap |
| 401 | invalid_key | Invalid or expired API key |
| 402 | insufficient_credits | Workspace credit balance is exhausted |
| 403 | insufficient_permissions | Missing write:enrich permission |
| 409 | no_match | OCR detected no card-like fields |
| 413 | payload_too_large | Image exceeds 10 MB |
| 429 | rate_limited | Rate limit exceeded |