🇵🇪 Perú · fuente pública
SUNAT: aduanet
Weekly bulk files for definitive customs regimes. This importer stores recent import (MA, MAM) and export (X) line items keyed by juridical RUC.
01 · origenSUNAT / ADUANET.URL primaria
02 · procesoValidación y normalizaciónSin inferir datos ausentes
03 · evidenciaAPI con procedenciaFuente y fecha identificables
Cobertura publicada
- Registros
- 9,040,254
- Última actualización
- 21 set. 2026
- Frecuencia
- weekly
- Frescura
- CURRENT
- Identificador
ruc- Búsqueda por nombre
- No publicada
Conteo y frescura consultados desde api.latinfo.dev/sources durante el build del 2026-09-28.
Fuente primaria
- Institution: SUNAT / ADUANET.
- Data: Weekly bulk files for definitive customs regimes. This importer stores recent import (
MA,MAM) and export (X) line items keyed by juridical RUC. - Format: HTML index with ZIP links. Each ZIP contains one DBF file encoded as Latin-1 / dBase.
Cómo se procesa
- Downloads the official ADUANET index page.
- Extracts only bulk ZIP links whose file names start with
MA,MAM, orX. - Downloads ZIPs with
curl -4; ADUANET is slower and less reliable through Node HTTP from the Mint runner. - Extracts the DBF with system
unzip. - Parses DBF records directly from the fixed-width dBase header and record layout.
- Stores only juridical RUCs (
20*). Natural-person RUCs and other document types are skipped before build. - Emits a multi-record TSV keyed by RUC, sorted with
LC_ALL=C sort, then builds the standard Latinfo binary index and content-addressed manifest. - Builds a second analytical output from the exact same canonical TSV: strict typed Parquet, partitioned by regime and declaration year, with raw ZIP lineage and an atomic lake manifest.
- Does not bypass CAPTCHA and does not run millions of form queries. It consumes the official bulk files published for download.
- Script:
src/imports/pe-sunat-aduanet.ts.
Campos publicados
| Field | Type | Example | Notes |
|---|---|---|---|
| ruc | string(11) | 20509208361 | Primary ID. Only 20* is stored. |
| operation_type | string | export | import for MA/MAM, export for X. |
| declaration | string | 118-2026-049541 | Aduana-year-number composite. |
| customs_office | string | 118 | ADUANET customs office code. |
| declaration_year | string | 2026 | Declaration year. |
| declaration_number | string | 049541 | Declaration number. |
| declaration_date | string | 20260622 | YYYYMMDD when present. |
| operation_date | string | 20260618 | Shipment/operation date when present. |
| series | string | 1 | Declaration series. |
| hs_code | string | 2517100000 | Tariff heading / NANDINA code. |
| description | string | Piedra Canto Rodado Negra... | Commercial goods description from ADUANET. |
| country | string | CL | Origin country for imports, destination country for exports. |
| fob_usd | string | 1234.560 | FOB amount in USD as published. |
| net_weight_kg | string | 2204.660 | Net weight as published. |
| source_file | string | x01070626.zip | Upstream ZIP used for lineage. |
Limitaciones conocidas
- The official page only exposes roughly the last two months. Historical coverage requires archiving weekly from now or obtaining older official files.
MBfiles are not ingested in v1 because they do not carry RUC directly; they require a declaration-level join toMA/MAM.- Smoke IDs can age out if the company stops appearing in the rolling two-month window. Replace fixture anchors with current records after a new import if needed.
- ADUANET downloads can be slow. The importer caches ZIPs in
/tmp/pe-sunat-aduanet-zipsand validates cached ZIPs withunzip -tq. - The official DBFs contain byte-identical duplicate lines. The lake removes only exact canonical duplicates under a bounded, documented policy; the raw files remain immutable.
Estado de revisión y alcance
No se publica todavía una opinión jurídica específica aprobada para esta fuente. La ficha documenta procedencia y transformaciones; Latinfo limita su producto a entidades jurídicas.
Latinfo no está afiliado, certificado ni respaldado por la institución de origen. Para decisiones formales, verifica la evidencia en la fuente primaria. Consulta Privacidad y Términos.