# National ID & Tax ID Validator (`soxoj/national-id-tax-id-validator`) Actor

Validate and decode national, tax and company IDs in bulk: PESEL, CPF, CNPJ, codice fiscale, Partita IVA, BSN, DNI/NIE, Aadhaar, CURP, RFC, SIREN, INSEE and more, plus passport MRZ. Birth date, sex, region. 222 ID types, 108 countries and territories. $0.40 per 1,000 IDs.

- **URL**: https://apify.com/soxoj/national-id-tax-id-validator.md
- **Developed by:** [Soxoj](https://apify.com/soxoj) (community)
- **Stats:** 1 total users, 0 monthly users, 71.4% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.40 / 1,000 id checkeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## National ID & Tax ID Validator

Catch fake and mistyped ID numbers in bulk, and get the data hidden inside them: birth date, sex, region and more. 222 ID types from 108 countries and territories, plus passport MRZ.

### What you get

- **Validation**: checksum check wherever a public algorithm exists
- **Decoding**: date of birth, sex, region or place of birth, citizenship, serial number, depending on the type
- **Derived identifiers**: data that follows from the number itself, e.g. the official `<personal code>@eesti.ee` e-mail address of Estonian ID card holders, or the place of birth from a French INSEE number
- **Auto-detection**: no need to know the document type; every type the value fits is returned
- **Formatted value**: the number in its usual printed layout

### Supported IDs

**Validated with a checksum, and decoded where the number encodes data:**
PESEL (Poland), NIP (Poland), CPF (Brazil), codice fiscale (Italy), BSN (Netherlands), personnummer and samordningsnummer (Sweden), fødselsnummer (Norway), HETU (Finland), DNI and NIE (Spain), DNI (Argentina), NIF (Portugal), Steuer-ID and Steuernummer (Germany), INSEE / NIR (France), Belgian national number, CNP (Romania), EGN (Bulgaria), OIB (Croatia), JMBG / EMŠO (Balkans), rodné číslo (Czechia, Slovakia), isikukood (Estonia), asmens kodas (Lithuania), personas kods (Latvia), PPS (Ireland), AHV / AVS (Switzerland), TC Kimlik No (Turkey), Teudat Zehut (Israel), Emirates ID, Aadhaar (India), NRIC / FIN (Singapore), HKID (Hong Kong), My Number (Japan), Chinese Resident ID, Thai national ID, Taiwan national ID, South African ID, CURP (Mexico), RUT / RUN (Chile), SIN (Canada), TFN and Medicare (Australia), IRD and NHI (New Zealand), EU VAT for Belgium, Denmark, Austria and Czechia, and more.

**Company and tax registration numbers:**
CNPJ (Brazil), SIREN / SIRET (France), Partita IVA (Italy), CIF (Spain), REGON (Poland), RFC (Mexico), CUIT (Argentina), RUC (Peru, Ecuador, Paraguay), NIT (Colombia), ABN / ACN (Australia), UEN (Singapore), USCC (China), Y-tunnus (Finland), orgnr (Sweden, Norway), GSTIN (India, with the embedded PAN), EU VAT numbers of most member states and the UK, and more.

**Format check only** (no public checksum, so `valid` stays `null`):
SSN, ITIN and EIN (US), NINO (UK), PAN (India), CPR (Denmark), kennitala (Iceland), CNIC (Pakistan), MyKad / NRIC (Malaysia), Saudi ID / Iqama, NIK (Indonesia), NIN (Nigeria), PhilSys, Korean RRN, Egyptian national ID, and more.

**Passport MRZ:** the two-line passport format (TD3) from any country, check digits verified.

### Use cases

- **KYC onboarding**: reject typos and invented numbers before paying for full verification
- **Consistency checks**: compare the birth date and sex encoded in an ID with what the user entered
- **Data cleaning**: classify and normalize identifier columns in bulk

### Input

| Field | Required | Description |
|---|---|---|
| `values` | yes | Identifiers, one per line |
| `country` | no | ISO 3166 alpha-3 (or alpha-2), e.g. `EST`. Only this country's types are tried |
| `type` | no | Exact type, e.g. `est_personal_id`, taken from an earlier run |

```json
{"values": ["37605030299"], "country": "EST"}
```

### Output

One row per matching type:

```json
{
  "value": "37605030299",
  "valid": true,
  "type": "est_personal_id",
  "checksum_verified": true,
  "formatted": "37605030299",
  "fields": {"email": "37605030299@eesti.ee", "yyyymmdd": "1976-05-03", "gender": "male", "sn": "029", "checksum": 9}
}
```

- `valid`: `true` = a checksum matched; `false` = nothing matched; `null` = no `country` or `type` given, or only format-only types matched. Without a hint it stays `null` because short numbers from different countries often share a format and a random number passes *some* country's checksum about a third of the time.
- `checksum_verified: false` means only the format matched: the type has no public checksum.
- A value that fits no type gives one row with empty `type`.

### Pricing

You pay per identifier checked, however many types it matches.

### Privacy

Identifiers are not logged or stored by us. They end up only in your own dataset.

### Limitations

- **Not a registry check.** A valid number may never have been issued, or may belong to someone else.
- Passport MRZ: the two-line passport format (TD3) only; ID-card and visa MRZ are not supported.

# Actor input Schema

## `values` (type: `array`):

National IDs, tax IDs, passport numbers or passport MRZ, one per line. Spaces and hyphens are ignored.

## `country` (type: `string`):

Optional, e.g. EST, POL, BEL (alpha-2 like EE also works, any case). Only this country's types are tried, and 'valid' becomes true or false instead of null.

## `type` (type: `string`):

Optional, e.g. est_personal_id. Take it from the 'type' column of an earlier run.

## Actor input object example

```json
{
  "values": [
    "37605030299"
  ],
  "country": "EST"
}
```

# Actor output Schema

## `results` (type: `string`):

One row per matching ID type: validity, type, formatted value and decoded fields.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "values": [
        "37605030299"
    ],
    "country": "EST"
};

// Run the Actor and wait for it to finish
const run = await client.actor("soxoj/national-id-tax-id-validator").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "values": ["37605030299"],
    "country": "EST",
}

# Run the Actor and wait for it to finish
run = client.actor("soxoj/national-id-tax-id-validator").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "values": [
    "37605030299"
  ],
  "country": "EST"
}' |
apify call soxoj/national-id-tax-id-validator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,soxoj/national-id-tax-id-validator"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/3yTZKgs4EKmsLmRw0/builds/V4YNbaeiNxsgkk2hJ/openapi.json
