Chinese ID Card
Extract data from Chinese resident identity cards with 99%+ accuracy using our advanced OCR technology.
Request Parameters
Required Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
image |
File | ✅ | ID card image file (JPG, PNG, WebP, HEIC and HEIF, max 10MB) |
documentType |
String | ✅ | Must be cn_id_card |
Response Format
Success Response (200 OK)
{
"name": "张三",
"gender": "男",
"ethnicity": "汉",
"dateOfBirth": "1990-01-01",
"address": "北京市朝阳区xxx街道xxx号",
"idNumber": "110101199001011234",
"issuingAuthority": "北京市公安局朝阳分局",
"validityPeriod": "2010.01.01-2030.01.01"
}
Response Fields
| Field | Type | Description | Example |
|---|---|---|---|
name |
string | Full name in Chinese characters | 张三 |
gender |
string | Gender (男/女) | 男 |
ethnicity |
string | Ethnic group | 汉 |
dateOfBirth |
string | Birth date (YYYY-MM-DD) | 1990-01-01 |
address |
string | Full residential address | 北京市朝阳区xxx街道xxx号 |
idNumber |
string | 18-digit ID number | 110101199001011234 |
issuingAuthority |
string | Issuing authority | 北京市公安局朝阳分局 |
validityPeriod |
string | Validity period (YYYY.MM.DD-YYYY.MM.DD) | 2010.01.01-2030.01.01 |
Use the language-specific code samples below to send your first OCR request quickly.
Related Documentation
- Authentication Guide - API key management
- Error Reference - Complete error codes
- Usage and Limits - Usage limits and quotas
- All China Documents - Other Chinese documents
Code Examples
Send a request
curl -X POST "https://pictotext.io/api/v1/ocr" \ -H "Authorization: Bearer sk_live_123456789abcdef" \ -F "image=@cn_id_card.jpg" \ -F "documentType=cn_id_card"Send a request (Node.js server)JavaScript
async function processChineseIDCard(imageFile, apiKey) { const formData = new FormData() formData.append('image', imageFile) formData.append('documentType', 'cn_id_card')
try { const response = await fetch('https://pictotext.io/api/v1/ocr', { method: 'POST', headers: { Authorization: `Bearer ${apiKey}`, }, body: formData, })
if (!response.ok) { const error = await response.json() throw new Error(error.error.message) }
return await response.json() } catch (error) { console.error('Error processing ID card:', error) throw error }}
const fileInput = document.getElementById('id-card-file')fileInput.addEventListener('change', async (event) => { const file = event.target.files[0] if (!file) return
try { const result = await processChineseIDCard(file, 'YOUR_API_KEY') console.log('Extracted data:', result) } catch (error) { alert('Processing failed: ' + error.message) }})