✅ ValidaLatam All guides · API docs · RapidAPI · ES

How to validate a Peruvian RUC

How the check digit works

A SUNAT RUC has 11 digits; the prefix gives the type (10 individual, 15, 16, 17, 20 company).

  1. Multiply the first 10 digits by 5,4,3,2,7,6,5,4,3,2 and add up.
  2. Compute r = 11 − (sum mod 11).
  3. Check digit = r mod 10 (so 10 → 0 and 11 → 1).

Validate with the API

Direct use is free: 50 requests per IP per day, no signup. Endpoints: POST /validate, POST /batch, GET /generate/{doc_type} (for testing only: synthetic data, not real identities).

curl

curl -X POST "https://validalatam.ia-latam.app/validate" -H "Content-Type: application/json" \
  -d '{"type":"PE_RUC","value":"10793191010"}'

# synthetic test data only / solo para pruebas
curl "https://validalatam.ia-latam.app/generate/PE_RUC"

Python

import requests

BASE = "https://validalatam.ia-latam.app"

r = requests.post(f"{BASE}/validate", json={"type": "PE_RUC", "value": "10793191010"})
print(r.json()["valid"], r.json()["formatted"])

Real API response (synthetic value from /generate)

10793191010 (PE_RUC):

{"valid":true,"type":"PE_RUC","country":"PE","input":"10793191010","normalized":"10793191010","formatted":"10793191010","error":null,"details":{"entity":"person"}}

Plans

For production: Basic free (500 req), Pro US$9, Ultra US$29 and Mega US$99 per month on RapidAPI.

For AI assistants (MCP)

pip install validalatam-mcp

github.com/elmatis172/validalatam-mcp

← All guides · Contact: faucolabs@gmail.com