# LatAm Tax ID Validator (NIT, RUT, RFC, CNPJ, CUIT) (`viperthruster/latam-tax-id-validator`) Actor

Validate Colombian NIT, Chilean RUT, Mexican RFC, Brazilian CNPJ and Argentine CUIT numbers offline, with check digits and formatting. Personal numbers are masked.

- **URL**: https://apify.com/viperthruster/latam-tax-id-validator.md
- **Developed by:** [David Rincon](https://apify.com/viperthruster) (community)
- **Categories:** Business, Developer tools, Agents
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 tax 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

## LatAm Tax ID Validator (NIT, RUT, RFC, CNPJ, CUIT)

Check whether Colombian NIT, Chilean RUT, Mexican RFC, Brazilian CNPJ and Argentine CUIT numbers are valid, in bulk, in seconds, without sending them anywhere.

- **Five countries in one call:** pass a list of IDs; the country is detected automatically or set once.
- **Check digits and format:** each number gets `valid`, the reason when it is not, and the official display format. Includes Brazil's new alphanumeric CNPJ (issued from July 2026).
- **Privacy by design:** numbers are validated offline. Company numbers come back in full; numbers that may belong to a person are masked, and the input is never echoed.

### Output example

```json
{
  "index": 0,
  "country": "BR",
  "idType": "CNPJ",
  "valid": true,
  "entityType": "company",
  "id": "16727230000197",
  "formatted": "16.727.230/0001-97",
  "masked": false,
  "checksumVerified": true,
  "alsoValidIn": [],
  "error": null
}
```

A person's number (for example an Argentine CUIT starting with 20) comes back as `"id": "********682"`, `"entityType": "person"`, `"masked": true`. Use `index` to match each row with your input list.

### Cost

You pay per ID checked: US$0.001 per ID, so **1,000 IDs = US$1.00**, plus US$0.00005 per run start. A typical run of 50 IDs costs about US$0.05.

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `ids` | array of strings | required | Tax IDs, with or without dots, dashes or slashes. |
| `country` | `CO`, `CL`, `MX`, `BR` or `AR` | not set | Leave it out to try every country; the others where the ID is also valid go in `alsoValidIn`. |
| `maxItems` | integer | 1000 | Stop after this many IDs. |

### How entity type is decided

| Country | Company | Person or unknown (masked) |
|---|---|---|
| Colombia (NIT) | 9-digit NIT from 800.000.000 | Everything else (usually a cédula) |
| Chile (RUT) | 50.000.000 and above | Below 50.000.000 |
| Mexico (RFC) | 12 characters | 13 characters |
| Brazil (CNPJ) | Always (CNPJ is only for legal entities) | Never |
| Argentina (CUIT) | Prefix 30, 33 or 34 | Prefix 20, 23, 24 or 27 (person), others unknown |

### FAQ

**Does it check that the company exists or is active?** No. It checks structure and check digits, which catches typos and made-up numbers. It does not query tax authorities.

**Why is `checksumVerified` false for some Mexican RFCs?** Around 1.5% of RFCs in use carry homoclave digits that do not follow the published algorithm, so an RFC with a correct format and date is still reported as valid.

**Are my IDs stored?** The Actor stores only the results shown above, with personal numbers masked. It never logs IDs. Like every Apify run, your input is kept in your own run storage under your Apify data retention settings.

**Can AI agents use it?** Yes. Input is a plain list and a run takes a few seconds.

### Legal

Validation runs locally with public check-digit algorithms. No website or government service is contacted and no personal data is returned.

### Related Actors

- [Tax ID & VAT Number Validator (65 countries)](https://apify.com/viperthruster/global-tax-id-validator): need EU VAT, UK VAT, US EIN, ABN, GSTIN or other countries? The same offline checks for 65 countries in one call.

### En español

Valida NIT (Colombia), RUT (Chile), RFC (México), CNPJ (Brasil) y CUIT (Argentina) en lote, sin enviar los números a ningún servicio. Los números de empresas se devuelven completos; los que pueden ser de personas salen enmascarados y la entrada nunca se repite en la salida.

### Changelog

- 0.2: results are saved in batches (1,000 IDs in about 4 s); `country` no longer has an empty option, leave it out to auto-detect.
- 0.1: first version.

# Actor input Schema

## `ids` (type: `array`):

NIT, RUT, RFC, CNPJ or CUIT numbers, with or without dots and dashes; up to 10000. One result per ID, in the same order.

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

Set it when you know the country. Omit it to try every supported country; the result then lists the others where the number is also valid.

## `maxItems` (type: `integer`):

Stop after this many IDs, up to 10000. Keeps costs predictable.

## Actor input object example

```json
{
  "ids": [
    "900.373.913-4",
    "76.086.428-5",
    "MAB-930714-8T4",
    "16.727.230/0001-97",
    "30-50001091-2"
  ],
  "maxItems": 1000
}
```

# Actor output Schema

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

No description

# 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 = {
    "ids": [
        "900.373.913-4",
        "76.086.428-5",
        "MAB-930714-8T4",
        "16.727.230/0001-97",
        "30-50001091-2"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("viperthruster/latam-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 = { "ids": [
        "900.373.913-4",
        "76.086.428-5",
        "MAB-930714-8T4",
        "16.727.230/0001-97",
        "30-50001091-2",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("viperthruster/latam-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 '{
  "ids": [
    "900.373.913-4",
    "76.086.428-5",
    "MAB-930714-8T4",
    "16.727.230/0001-97",
    "30-50001091-2"
  ]
}' |
apify call viperthruster/latam-tax-id-validator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,viperthruster/latam-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/Gi4yoeCoaNncmih0k/builds/eqEetJTSHlbZfayG7/openapi.json
