INE Data Extraction API: Read Mexican Voter ID Automatically

Extract CURP, nombre, CLABE, fecha de nacimiento and more from Mexican INE voter IDs using an API. Python and Node.js examples for KYC and identity verification.

March 17, 2026 · 5 min read

The INE (Instituto Nacional Electoral) voter ID card is Mexico's primary identity document — used for KYC, bank account opening, loan applications, government services, and more. Manually transcribing data from INE scans is slow and error-prone. This guide shows you how to extract it automatically with an API.

What data can be extracted from an INE?

The Ocilar INE extraction endpoint reads both the front and back of the card and returns:

Extracting INE data with Ocilar

cURL

curl -X POST https://api.ocilar.com/api/v1/extract/ine \
  -H "X-API-Key: sk-your_key" \
  -F "front=@ine_front.jpg" \
  -F "back=@ine_back.jpg"

# Response
{
  "nombre": "JULIO JUAREZ MARTINEZ",
  "curp": "JUAJ850101HMCRRL09",
  "clave_elector": "JUJRJL850101HMCRRL09",
  "fecha_nacimiento": "1985-01-01",
  "sexo": "H",
  "estado": "JALISCO",
  "municipio": "GUADALAJARA",
  "domicilio": "CALLE INDEPENDENCIA 123, COL. CENTRO",
  "seccion": "0123",
  "vigencia": "2029",
  "anio_registro": "2010",
  "credits_used": 1
}

Python

from ocilar import OcilarClient

client = OcilarClient(api_key="sk-your_key")

result = client.extract_ine(
    front="ine_front.jpg",
    back="ine_back.jpg"
)

print(result.nombre)          # "JULIO JUAREZ MARTINEZ"
print(result.curp)            # "JUAJ850101HMCRRL09"
print(result.fecha_nacimiento) # "1985-01-01"
print(result.vigencia)        # "2029"

# Check if expired
from datetime import datetime
current_year = datetime.now().year
is_valid = int(result.vigencia) >= current_year
print(f"INE valid: {is_valid}")

Node.js

import { OcilarClient } from '@ocilar/sdk'
import { createReadStream } from 'fs'

const client = new OcilarClient({ apiKey: 'sk-your_key' })

const result = await client.extractIne({
  front: createReadStream('ine_front.jpg'),
  back: createReadStream('ine_back.jpg')
})

console.log(result.nombre)    // "JULIO JUAREZ MARTINEZ"
console.log(result.curp)      // "JUAJ850101HMCRRL09"
console.log(result.vigencia)  // "2029"

// Validate expiry
const isValid = parseInt(result.vigencia) >= new Date().getFullYear()
console.log('INE valid:', isValid)

KYC workflow example

from ocilar import OcilarClient

client = OcilarClient(api_key="sk-your_key")

def onboard_user(front_img: bytes, back_img: bytes) -> dict:
    """
    Extract INE data for KYC onboarding.
    Returns verified user data or raises if invalid.
    """
    result = client.extract_ine(
        front_bytes=front_img,
        back_bytes=back_img
    )

    # Check expiry
    from datetime import datetime
    if int(result.vigencia) < datetime.now().year:
        raise ValueError("INE expired")

    return {
        "full_name": result.nombre,
        "curp": result.curp,
        "birth_date": result.fecha_nacimiento,
        "gender": result.sexo,
        "state": result.estado,
        "address": result.domicilio,
        "id_expiry": result.vigencia,
        "verified": True
    }

Common use cases

Fintech & lending platforms

Extract borrower identity data automatically during loan applications. Eliminate manual form filling — users upload their INE and data populates instantly.

Bank account opening (KYC)

Mexican banking regulations require INE verification for account opening. Automate the data capture step to reduce onboarding time from minutes to seconds.

HR onboarding

Collect employee identity data automatically when onboarding new hires. Feed directly into IMSS and payroll systems.

Government & social program registration

Platforms that manage beneficiary enrollment can capture INE data without manual transcription, reducing errors and processing time.

Sharing economy & gig platforms

Verify driver, delivery agent, or contractor identities as part of onboarding. Pair INE extraction with liveness detection for full KYC.

Supported INE generations

GenerationYears issuedSupported
INE 2014 (current)2014–present✅ Yes
IFE 20082008–2014✅ Yes
IFE 20022002–2008✅ Yes
Older generationsPre-2002Best effort

Pricing

INE extraction costs $0.05–$0.10 per document depending on plan. Free tier includes 100 documents/month.

FAQ

What image quality is required?

Minimum 300 DPI or equivalent resolution. The card should be fully visible, well-lit, and not blurry. JPG, PNG, and PDF are supported.

Can I send a single-side scan?

Yes — send only the front for basic data (nombre, CURP, fecha de nacimiento). The back adds address and electoral section data.

Is the data stored after processing?

No. Images are deleted within 60 seconds of processing. See our Privacy Policy.

Does this work with photos taken on mobile?

Yes, as long as the image is clear and the card fills most of the frame. Avoid glare and shadows on the card surface.

Can I also extract data from pasaportes or licencias?

We're adding passport and driver's license support. Contact us at hello@ocilar.com if you need it now.

Try Ocilar free

1,000 free solves. No credit card required.

Get API Key