Lookup sunat · aduanet by RUC
https://api.latinfo.dev/pe/sunat/aduanet/ruc/{ruc}
One goods series of an import/export declaration; a company can have many records. Coverage: Legal-entity declarations in the imported weekly official customs files. Lookup by ruc as a string, preserving leading zeros. Accepted syntax and normalization are defined by the contract below. FOB is USD and net weight is kg. Do not sum repeated declarations without series/file deduplication. Returns all records as an array. Import time is not observation time; inspect freshness headers. Add limit (1–500) and offset to retrieve an explicit page; without them the complete original array is returned. X-Total-Count gives the exact row count; follow Link rel=next to retrieve all pages.
Source contract
- Publisher
- SUNAT / ADUANET, Peru
- Coverage
- Legal-entity declarations in the imported weekly official customs files.
- Record meaning
- One goods series of an import/export declaration; a company can have many records.
- Identifier
- Lookup by ruc as a string, preserving leading zeros. Accepted syntax and normalization are defined by the contract below.
- Accepted pattern
^20\d{9}$- Cardinality
many- License
- Reuse permission has not been verified. Public access is not a reuse license.
Known limitations
- FOB is USD and net weight is kg. Do not sum repeated declarations without series/file deduplication.
Parameters
rucstringpathrequiredRUC in the source's normalized format. Keep identifiers as strings; preserve leading zeros.
Example: 20509208361
limitintegerqueryOptional page size. Supplying limit or offset enables explicit pagination; default page size is 100.
offsetintegerqueryRow offset, default 0. Keep the same source generation while collecting pages.
generationstringqueryOpaque source-generation guard, automatically included in the next-page Link. A changed generation returns 409; restart retrieval.
Request example
curl https://api.latinfo.dev/pe/sunat/aduanet/ruc/20509208361 \
-H "Authorization: Bearer $LATINFO_API_KEY"
Responses
200Published source records. Missing data is not a clearance or a negative finding.
Response headers
X-Latinfo-Imported-AtImport time, not the date of the government observation.
X-Source-Updated-AtPublisher update time, when known.
X-Latest-Observation-AtLatest date in returned records, when known.
X-Freshness-Statusstring
CURRENT · DELAYED · STALE · UNKNOWNX-Credits-CostActual credits charged for this request.
X-Source-GenerationOpaque immutable source generation. Follow the guarded next-page Link when collecting a history.
X-Total-CountExact row count for this identifier when pagination is requested.
X-Page-Offsetinteger
X-Page-Limitinteger
LinkNext page URL, rel=next. Absent at the end.
application/jsonResponse fields
[].ruc string requiredLookup by ruc as a string, preserving leading zeros. Accepted syntax and normalization are defined by the contract below.
[].operation_type string requiredimport for MA/MAM formats; export for X formats.
[].declaration string requiredComposite customs-office/year/declaration identifier.
[].customs_office string requiredADUANET customs office code.
[].declaration_year string requiredDeclaration year.
[].declaration_number string requiredDeclaration number; retain leading zeros.
[].declaration_date string requiredPublished declaration date date. Format: YYYYMMDD.
[].operation_date string requiredPublished operation date date. Format: YYYYMMDD.
[].series string requiredGoods series within a declaration; not a distinct company.
[].hs_code string requiredTen-digit national tariff/NANDINA code.
[].description string requiredPublished description.
[].country string requiredOrigin country for imports; destination country for exports.
[].fob_usd string requiredPublished FOB value; no currency conversion is applied. Unit: USD.
USD
[].net_weight_kg string requiredPublished net goods weight. Unit: kg.
kg
[].source_file string requiredOriginal upstream weekly ZIP name for lineage.
Response schema
{
"type": "array",
"items": {
"type": "object",
"properties": {
"ruc": {
"type": "string",
"description": "Lookup by ruc as a string, preserving leading zeros. Accepted syntax and normalization are defined by the contract below."
},
"operation_type": {
"type": "string",
"description": "import for MA/MAM formats; export for X formats.",
"x-latinfo-meaning": "text"
},
"declaration": {
"type": "string",
"description": "Composite customs-office/year/declaration identifier.",
"x-latinfo-meaning": "identifier"
},
"customs_office": {
"type": "string",
"description": "ADUANET customs office code.",
"x-latinfo-meaning": "code"
},
"declaration_year": {
"type": "string",
"description": "Declaration year.",
"x-latinfo-meaning": "text"
},
"declaration_number": {
"type": "string",
"description": "Declaration number; retain leading zeros.",
"x-latinfo-meaning": "identifier"
},
"declaration_date": {
"type": "string",
"description": "Published declaration date date. Format: YYYYMMDD.",
"x-latinfo-meaning": "date"
},
"operation_date": {
"type": "string",
"description": "Published operation date date. Format: YYYYMMDD.",
"x-latinfo-meaning": "date"
},
"series": {
"type": "string",
"description": "Goods series within a declaration; not a distinct company.",
"x-latinfo-meaning": "text"
},
"hs_code": {
"type": "string",
"description": "Ten-digit national tariff/NANDINA code.",
"x-latinfo-meaning": "code"
},
"description": {
"type": "string",
"description": "Published description.",
"x-latinfo-meaning": "text"
},
"country": {
"type": "string",
"description": "Origin country for imports; destination country for exports.",
"x-latinfo-meaning": "text"
},
"fob_usd": {
"type": "string",
"description": "Published FOB value; no currency conversion is applied. Unit: USD.",
"x-latinfo-meaning": "amount",
"x-latinfo-unit": "USD"
},
"net_weight_kg": {
"type": "string",
"description": "Published net goods weight. Unit: kg.",
"x-latinfo-meaning": "quantity",
"x-latinfo-unit": "kg"
},
"source_file": {
"type": "string",
"description": "Original upstream weekly ZIP name for lineage.",
"x-latinfo-meaning": "text"
}
},
"required": [
"ruc",
"operation_type",
"declaration",
"customs_office",
"declaration_year",
"declaration_number",
"declaration_date",
"operation_date",
"series",
"hs_code",
"description",
"country",
"fob_usd",
"net_weight_kg",
"source_file"
],
"additionalProperties": false
}
}400Invalid identifier or query. Correct the input before retrying.
401Missing or invalid API key. Authenticate before retrying.
404No published record, or identifier outside the legal-entity scope. Not proof that the company does not exist.
409Source generation changed during paginated retrieval. Restart from offset 0.
429Rate or credit limit exceeded. Inspect the response and rate-limit headers before retrying.
503Source unavailable. Report unavailable, not an empty result.
Example JSON
Illustrative schema example. This is not a live response.
[
{
"ruc": "string",
"operation_type": "string",
"declaration": "string",
"customs_office": "string",
"declaration_year": "string",
"declaration_number": "string",
"declaration_date": "string",
"operation_date": "string",
"series": "string",
"hs_code": "string",
"description": "string",
"country": "string",
"fob_usd": "string",
"net_weight_kg": "string",
"source_file": "string"
}
]Provenance and limitations
Coverage varies by country and public source. A missing field is not evidence that the underlying fact does not exist. Public registries may be delayed or contain source errors; inspect the returned evidence and source date before relying on a result.