SUNAT Peru RUC Scraper & Consulta RUC API | Taxpayer Data
Pricing
from $11.54 / 1,000 results
SUNAT Peru RUC Scraper & Consulta RUC API | Taxpayer Data
Scrape Peru SUNAT by RUC or company name (razon social). Consulta RUC data: estado, condicion, tipo contribuyente, direccion fiscal, CIIU, comprobantes, padrones, legal representatives, branches and worker counts. KYB and company verification for Peru. Export JSON, CSV, Excel.
Pricing
from $11.54 / 1,000 results
Rating
5.0
(1)
Developer
Scrapers Lat
Maintained by CommunityActor stats
0
Bookmarked
4
Total users
0
Monthly active users
12 days ago
Last modified
Categories
Share
SUNAT Peru RUC Scraper & Consulta RUC API
The most complete SUNAT scraper and Consulta RUC API for Peru. Look up any Peruvian taxpayer by RUC or by company name (razon social) and get the full SUNAT taxpayer sheet as clean JSON, CSV or Excel: status, tax address, CIIU economic activity, invoicing and accounting systems, special registries (padrones), plus legal representatives, branch locations and reported worker counts on demand. Built for KYB, company verification, lead generation and due diligence in Peru.
Keywords: SUNAT scraper, SUNAT API, consulta RUC, RUC lookup API, verificar RUC, razon social por RUC, ficha RUC SUNAT, padron SUNAT, Peru company registry data, KYB Peru, company data Peru.
📥 Input · 📤 Output · 💰 Pricing · ▶️ Examples
Here is one real result, with the fields the actor returns (legal-representative and branch lists trimmed for readability):
{"razonSocial": "SUPERMERCADOS PERUANOS SOCIEDAD ANONIMA 'O ' S.P.S.A.","ruc": "20100070970","estado": "ACTIVO","condicion": "HABIDO","tipoContribuyente": "SOCIEDAD ANONIMA","nombreComercial": "SUPERMERCADOS PERUANOS","direccion": "CAL.MORELLI NRO. 181 INT. P-2","departamento": "LIMA","provincia": "LIMA","distrito": "SAN BORJA","ciiu": "4711","actividadEconomica": "VENTA AL POR MENOR EN COMERCIOS NO ESPECIALIZADOS CON PREDOMINIO DE LA VENTA DE ALIMENTOS, BEBIDAS O TABACO","actividadesSecundarias": [{ "ciiu": "4719", "actividadEconomica": "OTRAS ACTIVIDADES DE VENTA AL POR MENOR EN COMERCIOS NO ESPECIALIZADOS" },{ "ciiu": "6810", "actividadEconomica": "ACTIVIDADES INMOBILIARIAS REALIZADAS CON BIENES PROPIOS O ARRENDADOS" }],"sistemaEmisionComprobante": "MECANIZADO","sistemaContabilidad": "COMPUTARIZADO","actividadComercioExterior": "SIN ACTIVIDAD","comprobantesPago": "FACTURA BOLETA DE VENTA LIQUIDACION DE COMPRA NOTA DE CREDITO NOTA DE DEBITO GUIA DE REMISION - REMITENTE COMPROBANTE DE RETENCION","comprobantesElectronicos": "BOLETA (desde 01/01/2013),FACTURA (desde 01/01/2013),GUIA (desde 25/08/2021)","emisorElectronicoDesde": "2013-01-01","afiliadoPleDesde": "2011-09-08","padrones": "Incorporado al Regimen de Agentes de Retencion de IGV (R.S.037-2002) a partir del 01/06/2002","fechaInscripcion": "1992-10-09","fechaInicioActividades": "1979-06-01","numeroTrabajadores": 0,"numeroPensionistas": 0,"numeroPrestadoresServicio": 2,"periodoTrabajadores": "2026-07","trabajadoresHistorial": [{ "periodo": "2026-07", "trabajadores": 0, "pensionistas": 0, "prestadoresServicio": 2 },{ "periodo": "2026-06", "trabajadores": 0, "pensionistas": 0, "prestadoresServicio": 1 }],"url": "https://e-consultaruc.sunat.gob.pe/cl-ti-itmrconsruc/jcrS00Alias?accion=consPorRuc&nroRuc=20100070970","representanteLegal": [{ "tipoDocumento": "DNI", "numeroDocumento": "09342569", "nombre": "SHIMIZU MITSUMASU MISAEL", "cargo": "APODERADO", "fechaDesde": "2013-04-08" },{ "tipoDocumento": "DNI", "numeroDocumento": "41145464", "nombre": "CALMELL DEL SOLAR MONASI JAVIER MANUEL", "cargo": "APODERADO", "fechaDesde": "2015-11-27" }],"establishments": [{ "code": "0236", "type": "LO. L. COMERCIAL", "address": "MZA. A LOTE. 13 P.J. VILLA EL SALVADOR LIMA - LIMA - VILLA EL SALVADOR", "economicActivity": null }],"observedAt": "2026-09-04T14:00:00.000Z","error": null}
The
representanteLegal,establishmentsandtrabajadoresHistoriallists are trimmed above for readability. A real run returns the full lists (this taxpayer returns 15 legal representatives and 1018 branch locations). Every value shown is exactly as returned.observedAtis a representative ISO timestamp.
Table of contents
- What it does
- Why this actor
- Compare with other SUNAT actors
- Use cases
- Quickstart
- Input reference
- Output reference
- Run via API and CLI
- Fetch results
- Billing and limits
- FAQ and troubleshooting
What it does
The actor looks up each search term in the SUNAT Peru taxpayer registry (Consulta RUC), resolves each match to its full taxpayer sheet, and writes one normalized record per taxpayer to the run's dataset. An 11-digit numeric term is treated as a direct RUC lookup; any other text is a company-name search that returns every matching taxpayer. With withDetails on it also fetches the legal representatives and reported worker counts; with withBranches on it fetches every registered branch location. Missing source values are returned as null.
Data covers public SUNAT registry records for Peruvian taxpayers. Field values are returned in Spanish exactly as SUNAT publishes them, so they match the official registry without translation.
Why this actor
- Two ways to search. Look up by exact RUC or by company name (razon social). Most SUNAT tools only accept a RUC number.
- Every field the registry exposes. Status, condition, taxpayer type, trade name, full fiscal address split into department, province and district, primary and secondary CIIU activities, invoicing and accounting systems, foreign-trade flag, authorized and electronic vouchers, PLE affiliation, special registries (padrones), and both inscription and activity-start dates.
- Deep KYB add-ons. Full legal representatives (representantes legales) with document, role and start date, every branch location (establecimientos anexos), and reported worker counts (trabajadores, pensionistas and prestadores de servicio) with monthly history.
- Clean, typed output. Dates normalized to
YYYY-MM-DD,nullfor absent values, ready for JSON, CSV or Excel. - Honest billing. Pay per taxpayer, no charge on failure, spend cap respected.
Compare with other SUNAT actors
| Capability | This actor | Typical RUC-only scraper |
|---|---|---|
| Look up by RUC number | Yes | Yes |
| Look up by company name (razon social) | Yes | No |
| Status, condition, taxpayer type | Yes | Partial |
| Fiscal address split (department, province, district) | Yes | Address only |
| Primary CIIU activity | Yes | Yes |
| Secondary CIIU activities | Yes | No |
| Invoicing and accounting systems | Yes | No |
| Electronic vouchers, emisor and PLE dates | Yes | No |
| Special registries (padrones) | Yes | No |
| Legal representatives (representantes legales) | Yes | No |
| Branch locations (establecimientos anexos) | Yes | No |
| Worker counts with monthly history | Yes | No |
| JSON, CSV, Excel export | Yes | Yes |
| No charge on failure, spend cap | Yes | Varies |
This actor accepts every input other SUNAT RUC scrapers accept (a list of RUC numbers plus a result cap) and returns every field they return, plus name search and the enrichment fields above.
Use cases
- KYB and onboarding in Peru. Verify a supplier or customer RUC, confirm it is ACTIVO and HABIDO, and capture the legal representatives for compliance files.
- Lead generation. Turn a list of company names into structured taxpayer records with activity, location and size signals.
- Due diligence and credit risk. Read taxpayer type, foreign-trade activity, worker counts and branch footprint to size a counterparty.
- Data enrichment. Append razon social, CIIU, address and status to an internal CRM keyed by RUC.
- Market research. Build sector lists (retail, mining, banking, telecom) by company-name search.
Quickstart
Open the actor, paste this into the input, and press Run. It looks up one RUC and returns its full taxpayer sheet with legal representatives and worker counts.
{"maxTaxpayers": 10,"withDetails": true,"withBranches": false,"searchTerms": ["20100070970"]}
Pass an 11-digit RUC for a direct lookup, or a company name (for example SUPERMERCADOS PERUANOS) to return every matching taxpayer. Add several terms to collect them in one run.
Input reference
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
searchTerms | string[] | yes | ["20100070970"] | RUC tax IDs (11 digits) or company names to look up. An 11-digit numeric term is a direct RUC lookup; any other text is a company-name search returning every matching taxpayer. |
maxTaxpayers | integer | no | 10 | Maximum number of taxpayer records to collect across all search terms. Range 1 to 1000000. |
withDetails | boolean | no | true | Also fetch the legal representatives (representantes legales) and reported worker counts (trabajadores, pensionistas, prestadores de servicio) for each taxpayer. Paid add-on: requires a paid Apify plan. |
withBranches | boolean | no | false | Also fetch every registered branch location (establecimientos anexos): internal code, establishment type, full address, and economic activity. Large companies can have thousands. Paid add-on: requires a paid Apify plan. |
useProxy | boolean | no | false | Route requests through Apify Residential proxy in Peru. Enable only if SUNAT starts blocking the run; direct requests normally work. |
Output reference
One dataset item per taxpayer. Types: string, number, object[], or null when the source value is absent. Fields marked (details) require withDetails; establishments requires withBranches.
| Field | Type | Description |
|---|---|---|
razonSocial | string | Registered legal name. |
ruc | string | 11-digit RUC tax ID. |
estado | string | Registry status (for example ACTIVO, BAJA). |
condicion | string | Domicile condition (for example HABIDO, NO HABIDO). |
tipoContribuyente | string | Taxpayer type (for example SOCIEDAD ANONIMA). |
nombreComercial | string | Trade name, or null. |
direccion | string | Registered tax address. |
departamento | string | Department (region). |
provincia | string | Province. |
distrito | string | District. |
ciiu | string | Primary CIIU economic-activity code. |
actividadEconomica | string | Primary economic activity description. |
actividadesSecundarias | object[] | Secondary activities, each {ciiu, actividadEconomica}. |
sistemaEmisionComprobante | string | Invoice issuance system. |
sistemaContabilidad | string | Accounting system. |
actividadComercioExterior | string | Foreign-trade activity status. |
comprobantesPago | string | Authorized payment vouchers. |
comprobantesElectronicos | string | Electronic voucher types with start dates. |
emisorElectronicoDesde | string | Date the taxpayer became an electronic issuer (YYYY-MM-DD), or null. |
afiliadoPleDesde | string | Date affiliated to the electronic ledger (PLE), or null. |
padrones | string | Special taxpayer registries the RUC belongs to (for example agente de retencion/percepcion), or null. |
fechaInscripcion | string | Registry inscription date (YYYY-MM-DD). |
fechaInicioActividades | string | Activity start date (YYYY-MM-DD). |
numeroTrabajadores | number | Reported workers in the latest period, or null (details). |
numeroPensionistas | number | Reported pensioners in the latest period, or null (details). |
numeroPrestadoresServicio | number | Reported service providers in the latest period, or null (details). |
periodoTrabajadores | string | Period of the latest worker snapshot (for example 2026-07) (details). |
trabajadoresHistorial | object[] | Monthly worker history, each {periodo, trabajadores, pensionistas, prestadoresServicio} (details). |
url | string | Public SUNAT consulta URL for the RUC. |
representanteLegal | object[] | Legal representatives, each {tipoDocumento, numeroDocumento, nombre, cargo, fechaDesde} (details). |
establishments | object[] | Branch locations, each with internal code, type, address, and activity (branches). Empty when withBranches is off. |
observedAt | string | ISO 8601 timestamp of when the record was collected. |
error | string | null on success. On a failed lookup, an item with a populated error field is written instead. |
Run via API and CLI
Start a run and read the dataset. Replace <TOKEN> with your Apify API token.
Run synchronously and get dataset items in one call:
curl -X POST "https://api.apify.com/v2/acts/scrapers_lat~sunat-scraper/run-sync-get-dataset-items?token=<TOKEN>" \-H "Content-Type: application/json" \-d '{"searchTerms":["20100070970"],"withDetails":true}'
Start a run asynchronously:
curl -X POST "https://api.apify.com/v2/acts/scrapers_lat~sunat-scraper/runs?token=<TOKEN>" \-H "Content-Type: application/json" \-d '{"searchTerms":["SUPERMERCADOS PERUANOS"],"maxTaxpayers":50,"withBranches":true}'
Apify CLI:
apify call scrapers_lat/sunat-scraper \--input '{"searchTerms":["20100070970"]}'
Fetch results
Every run writes to a dataset. Fetch items as JSON, CSV, or Excel by changing format:
# JSONcurl "https://api.apify.com/v2/datasets/<DATASET_ID>/items?token=<TOKEN>&clean=true&format=json"# CSVcurl "https://api.apify.com/v2/datasets/<DATASET_ID>/items?token=<TOKEN>&clean=true&format=csv"# Paginate large datasetscurl "https://api.apify.com/v2/datasets/<DATASET_ID>/items?token=<TOKEN>&offset=1000&limit=1000"
<DATASET_ID> is returned as defaultDatasetId in the run object. Use offset and limit to page through large result sets. clean=true drops empty and internal fields.
Billing and limits
- Pay per result. You are charged per taxpayer returned (
resultevent). See the pricing tab for the current per-result price. - Details add-on. When
withDetailsorwithBranchesis on, each taxpayer whose enrichment sheet is fetched charges a smalldetailsevent on top of the result price. That one add-on covers legal representatives, worker counts and every branch location for the taxpayer. - No charge on failure. If a lookup fails, the actor writes an item with a populated
errorfield and does not charge for it. Empty runs cost nothing. - Spend cap respected. Set
maxTotalChargeUsdon the run; once reached, the actor stops emitting and charging further billable results and add-ons. - Free Apify plans are capped at 10 taxpayers per run, and the details and branches add-ons require a paid plan. Upgrade for higher volume and enrichment.
FAQ and troubleshooting
A run returned 0 records. Why? The RUC does not exist, or the company-name search matched nothing. Confirm the 11-digit RUC, or try a shorter name fragment. Zero-result runs are not charged.
How do I look up by name instead of RUC?
Pass any non-numeric text in searchTerms (for example SUPERMERCADOS PERUANOS). Every matching taxpayer is returned, up to maxTaxpayers.
How do I get legal representatives, worker counts and branches?
Keep withDetails on for legal representatives and worker counts, and turn withBranches on for every registered branch location. Both are paid add-ons on a paid Apify plan.
Why are field values in Spanish? The values are returned exactly as SUNAT publishes them, so they match the official registry without translation.
Do I need the proxy?
No. Direct requests normally work. Enable useProxy only if SUNAT starts blocking the run.
Is this an official SUNAT tool? No. This actor is independent and has no affiliation with SUNAT or the Peruvian government. It reads only data that is publicly available on the SUNAT RUC consultation service.
Related scrapers
- Argentina Companies Scraper: Argentine company registry and tax data.
- Taiwan Business Registry Scraper: Taiwan company registry records.
- Switzerland Companies Scraper: Swiss commercial registry records.
More scrapers at scrapers.lat
Built and maintained by scrapers.lat, where we publish scrapers for US and Latin American public platforms: company registries, government data, finance, e-commerce and more. Browse the catalog or request a custom scraper at scrapers.lat.
Independent tool, not affiliated with SUNAT or the Peruvian government. Accesses only publicly available RUC registry data.
SUNAT Peru: Scraper de RUC y API de Consulta RUC
El scraper de SUNAT y API de Consulta RUC mas completo para el Peru. Busca cualquier contribuyente peruano por RUC o por nombre de la empresa (razon social) y obten la ficha RUC completa de SUNAT como JSON, CSV o Excel limpio: estado, domicilio fiscal, actividad economica CIIU, sistemas de emision y contabilidad, padrones, ademas de representantes legales, establecimientos anexos y numero de trabajadores cuando lo necesites. Pensado para KYB, verificacion de empresas, generacion de leads y debida diligencia en el Peru.
Palabras clave: scraper SUNAT, API SUNAT, consulta RUC, consultar RUC SUNAT, verificar RUC, razon social por RUC, ficha RUC SUNAT, padron SUNAT, datos de empresas del Peru, KYB Peru, registro de empresas Peru.
📥 Entrada · 📤 Salida · 💰 Precios · ▶️ Ejemplos
Este es un resultado real, con los campos que devuelve el actor (las listas de representantes legales y anexos estan recortadas para facilitar la lectura):
{"razonSocial": "SUPERMERCADOS PERUANOS SOCIEDAD ANONIMA 'O ' S.P.S.A.","ruc": "20100070970","estado": "ACTIVO","condicion": "HABIDO","tipoContribuyente": "SOCIEDAD ANONIMA","nombreComercial": "SUPERMERCADOS PERUANOS","direccion": "CAL.MORELLI NRO. 181 INT. P-2","departamento": "LIMA","provincia": "LIMA","distrito": "SAN BORJA","ciiu": "4711","actividadEconomica": "VENTA AL POR MENOR EN COMERCIOS NO ESPECIALIZADOS CON PREDOMINIO DE LA VENTA DE ALIMENTOS, BEBIDAS O TABACO","actividadesSecundarias": [{ "ciiu": "4719", "actividadEconomica": "OTRAS ACTIVIDADES DE VENTA AL POR MENOR EN COMERCIOS NO ESPECIALIZADOS" },{ "ciiu": "6810", "actividadEconomica": "ACTIVIDADES INMOBILIARIAS REALIZADAS CON BIENES PROPIOS O ARRENDADOS" }],"sistemaEmisionComprobante": "MECANIZADO","sistemaContabilidad": "COMPUTARIZADO","actividadComercioExterior": "SIN ACTIVIDAD","comprobantesPago": "FACTURA BOLETA DE VENTA LIQUIDACION DE COMPRA NOTA DE CREDITO NOTA DE DEBITO GUIA DE REMISION - REMITENTE COMPROBANTE DE RETENCION","comprobantesElectronicos": "BOLETA (desde 01/01/2013),FACTURA (desde 01/01/2013),GUIA (desde 25/08/2021)","emisorElectronicoDesde": "2013-01-01","afiliadoPleDesde": "2011-09-08","padrones": "Incorporado al Regimen de Agentes de Retencion de IGV (R.S.037-2002) a partir del 01/06/2002","fechaInscripcion": "1992-10-09","fechaInicioActividades": "1979-06-01","numeroTrabajadores": 0,"numeroPensionistas": 0,"numeroPrestadoresServicio": 2,"periodoTrabajadores": "2026-07","trabajadoresHistorial": [{ "periodo": "2026-07", "trabajadores": 0, "pensionistas": 0, "prestadoresServicio": 2 },{ "periodo": "2026-06", "trabajadores": 0, "pensionistas": 0, "prestadoresServicio": 1 }],"url": "https://e-consultaruc.sunat.gob.pe/cl-ti-itmrconsruc/jcrS00Alias?accion=consPorRuc&nroRuc=20100070970","representanteLegal": [{ "tipoDocumento": "DNI", "numeroDocumento": "09342569", "nombre": "SHIMIZU MITSUMASU MISAEL", "cargo": "APODERADO", "fechaDesde": "2013-04-08" },{ "tipoDocumento": "DNI", "numeroDocumento": "41145464", "nombre": "CALMELL DEL SOLAR MONASI JAVIER MANUEL", "cargo": "APODERADO", "fechaDesde": "2015-11-27" }],"establishments": [{ "code": "0236", "type": "LO. L. COMERCIAL", "address": "MZA. A LOTE. 13 P.J. VILLA EL SALVADOR LIMA - LIMA - VILLA EL SALVADOR", "economicActivity": null }],"observedAt": "2026-09-04T14:00:00.000Z","error": null}
Las listas
representanteLegal,establishmentsytrabajadoresHistorialestan recortadas arriba. Una ejecucion real devuelve las listas completas (este contribuyente devuelve 15 representantes legales y 1018 establecimientos anexos). Cada valor mostrado es tal como se devuelve.observedAtes una marca de tiempo ISO representativa.
Tabla de contenidos
- Que hace
- Por que este actor
- Comparativa con otros actores de SUNAT
- Casos de uso
- Inicio rapido
- Referencia de entrada
- Referencia de salida
- Ejecutar via API y CLI
- Obtener resultados
- Facturacion y limites
- Preguntas frecuentes
Que hace
El actor busca cada termino en el registro de contribuyentes de SUNAT (Consulta RUC), resuelve cada coincidencia a su ficha completa y escribe un registro normalizado por contribuyente en el dataset de la ejecucion. Un termino numerico de 11 digitos se trata como busqueda directa por RUC; cualquier otro texto es una busqueda por nombre que devuelve todos los contribuyentes coincidentes. Con withDetails activo tambien obtiene los representantes legales y el numero de trabajadores; con withBranches activo obtiene cada establecimiento anexo registrado. Los valores ausentes en la fuente se devuelven como null.
Los datos corresponden a registros publicos de SUNAT de contribuyentes peruanos. Los valores se devuelven en espanol tal como los publica SUNAT, para que coincidan con el registro oficial sin traduccion.
Por que este actor
- Dos formas de buscar. Busca por RUC exacto o por nombre de la empresa (razon social). La mayoria de las herramientas de SUNAT solo aceptan un numero de RUC.
- Todos los campos que expone el registro. Estado, condicion, tipo de contribuyente, nombre comercial, domicilio fiscal completo dividido en departamento, provincia y distrito, actividades CIIU principal y secundarias, sistemas de emision y contabilidad, actividad de comercio exterior, comprobantes autorizados y electronicos, afiliacion al PLE, padrones y las fechas de inscripcion e inicio de actividades.
- Complementos KYB profundos. Representantes legales completos con documento, cargo y fecha, cada establecimiento anexo, y el numero de trabajadores, pensionistas y prestadores de servicio con historial mensual.
- Salida limpia y tipada. Fechas normalizadas a
YYYY-MM-DD,nullpara valores ausentes, listo para JSON, CSV o Excel. - Facturacion honesta. Pago por contribuyente, sin cargo en caso de fallo, con limite de gasto respetado.
Comparativa con otros actores de SUNAT
| Capacidad | Este actor | Scraper tipico solo por RUC |
|---|---|---|
| Busqueda por numero de RUC | Si | Si |
| Busqueda por nombre (razon social) | Si | No |
| Estado, condicion, tipo de contribuyente | Si | Parcial |
| Domicilio fiscal dividido (departamento, provincia, distrito) | Si | Solo direccion |
| Actividad CIIU principal | Si | Si |
| Actividades CIIU secundarias | Si | No |
| Sistemas de emision y contabilidad | Si | No |
| Comprobantes electronicos, fechas de emisor y PLE | Si | No |
| Padrones | Si | No |
| Representantes legales | Si | No |
| Establecimientos anexos | Si | No |
| Numero de trabajadores con historial mensual | Si | No |
| Exportar a JSON, CSV, Excel | Si | Si |
| Sin cargo en caso de fallo, limite de gasto | Si | Varia |
Este actor acepta toda entrada que aceptan otros scrapers de RUC de SUNAT (una lista de numeros de RUC y un limite de resultados) y devuelve todos los campos que ellos devuelven, ademas de la busqueda por nombre y los campos de enriquecimiento anteriores.
Casos de uso
- KYB y onboarding en el Peru. Verifica el RUC de un proveedor o cliente, confirma que esta ACTIVO y HABIDO, y captura los representantes legales para cumplimiento.
- Generacion de leads. Convierte una lista de nombres de empresas en registros estructurados con actividad, ubicacion y senales de tamano.
- Debida diligencia y riesgo crediticio. Lee el tipo de contribuyente, la actividad de comercio exterior, el numero de trabajadores y la red de anexos para dimensionar a una contraparte.
- Enriquecimiento de datos. Agrega razon social, CIIU, direccion y estado a un CRM interno indexado por RUC.
- Investigacion de mercado. Construye listas por sector (retail, mineria, banca, telecomunicaciones) con la busqueda por nombre.
Inicio rapido
Abre el actor, pega esto en la entrada y presiona Run. Busca un RUC y devuelve su ficha completa con representantes legales y numero de trabajadores.
{"maxTaxpayers": 10,"withDetails": true,"withBranches": false,"searchTerms": ["20100070970"]}
Pasa un RUC de 11 digitos para una busqueda directa, o un nombre de empresa (por ejemplo SUPERMERCADOS PERUANOS) para devolver todos los contribuyentes coincidentes. Agrega varios terminos para recopilarlos en una sola ejecucion.
Referencia de entrada
| Campo | Tipo | Requerido | Predeterminado | Descripcion |
|---|---|---|---|---|
searchTerms | string[] | si | ["20100070970"] | RUC (11 digitos) o nombres de empresas a buscar. Un termino numerico de 11 digitos es una busqueda directa por RUC; cualquier otro texto es una busqueda por nombre que devuelve todos los contribuyentes coincidentes. |
maxTaxpayers | integer | no | 10 | Numero maximo de registros a recopilar entre todos los terminos. Rango 1 a 1000000. |
withDetails | boolean | no | true | Tambien obtiene los representantes legales y el numero de trabajadores, pensionistas y prestadores de servicio de cada contribuyente. Complemento de pago: requiere un plan de pago de Apify. |
withBranches | boolean | no | false | Tambien obtiene cada establecimiento anexo registrado: codigo interno, tipo, direccion completa y actividad economica. Las empresas grandes pueden tener miles. Complemento de pago: requiere un plan de pago de Apify. |
useProxy | boolean | no | false | Enruta las solicitudes por el proxy Residencial de Apify en Peru. Activalo solo si SUNAT empieza a bloquear la ejecucion; las solicitudes directas normalmente funcionan. |
Referencia de salida
Un elemento del dataset por contribuyente. Tipos: string, number, object[], o null cuando el valor de origen esta ausente. Los campos marcados (details) requieren withDetails; establishments requiere withBranches.
| Campo | Tipo | Descripcion |
|---|---|---|
razonSocial | string | Nombre legal registrado. |
ruc | string | RUC de 11 digitos. |
estado | string | Estado del registro (por ejemplo ACTIVO, BAJA). |
condicion | string | Condicion del domicilio (por ejemplo HABIDO, NO HABIDO). |
tipoContribuyente | string | Tipo de contribuyente (por ejemplo SOCIEDAD ANONIMA). |
nombreComercial | string | Nombre comercial, o null. |
direccion | string | Domicilio fiscal registrado. |
departamento | string | Departamento (region). |
provincia | string | Provincia. |
distrito | string | Distrito. |
ciiu | string | Codigo CIIU de actividad economica principal. |
actividadEconomica | string | Descripcion de la actividad economica principal. |
actividadesSecundarias | object[] | Actividades secundarias, cada una {ciiu, actividadEconomica}. |
sistemaEmisionComprobante | string | Sistema de emision de comprobantes. |
sistemaContabilidad | string | Sistema de contabilidad. |
actividadComercioExterior | string | Estado de actividad de comercio exterior. |
comprobantesPago | string | Comprobantes de pago autorizados. |
comprobantesElectronicos | string | Tipos de comprobantes electronicos con fechas de inicio. |
emisorElectronicoDesde | string | Fecha en que paso a emisor electronico (YYYY-MM-DD), o null. |
afiliadoPleDesde | string | Fecha de afiliacion al PLE, o null. |
padrones | string | Padrones a los que pertenece el RUC (por ejemplo agente de retencion/percepcion), o null. |
fechaInscripcion | string | Fecha de inscripcion en el registro (YYYY-MM-DD). |
fechaInicioActividades | string | Fecha de inicio de actividades (YYYY-MM-DD). |
numeroTrabajadores | number | Trabajadores reportados en el ultimo periodo, o null (details). |
numeroPensionistas | number | Pensionistas reportados en el ultimo periodo, o null (details). |
numeroPrestadoresServicio | number | Prestadores de servicio reportados en el ultimo periodo, o null (details). |
periodoTrabajadores | string | Periodo de la ultima foto de trabajadores (por ejemplo 2026-07) (details). |
trabajadoresHistorial | object[] | Historial mensual de trabajadores, cada uno {periodo, trabajadores, pensionistas, prestadoresServicio} (details). |
url | string | URL publica de consulta de SUNAT para el RUC. |
representanteLegal | object[] | Representantes legales, cada uno {tipoDocumento, numeroDocumento, nombre, cargo, fechaDesde} (details). |
establishments | object[] | Establecimientos anexos, cada uno con codigo interno, tipo, direccion y actividad (branches). Vacio cuando withBranches esta apagado. |
observedAt | string | Marca de tiempo ISO 8601 de cuando se recopilo el registro. |
error | string | null en caso de exito. Ante una busqueda fallida, se escribe un elemento con el campo error. |
Ejecutar via API y CLI
Inicia una ejecucion y lee el dataset. Reemplaza <TOKEN> por tu token de API de Apify.
Ejecucion sincrona con los items del dataset en una sola llamada:
curl -X POST "https://api.apify.com/v2/acts/scrapers_lat~sunat-scraper/run-sync-get-dataset-items?token=<TOKEN>" \-H "Content-Type: application/json" \-d '{"searchTerms":["20100070970"],"withDetails":true}'
Iniciar una ejecucion asincrona:
curl -X POST "https://api.apify.com/v2/acts/scrapers_lat~sunat-scraper/runs?token=<TOKEN>" \-H "Content-Type: application/json" \-d '{"searchTerms":["SUPERMERCADOS PERUANOS"],"maxTaxpayers":50,"withBranches":true}'
Apify CLI:
apify call scrapers_lat/sunat-scraper \--input '{"searchTerms":["20100070970"]}'
Obtener resultados
Cada ejecucion escribe en un dataset. Obten los items como JSON, CSV o Excel cambiando format:
# JSONcurl "https://api.apify.com/v2/datasets/<DATASET_ID>/items?token=<TOKEN>&clean=true&format=json"# CSVcurl "https://api.apify.com/v2/datasets/<DATASET_ID>/items?token=<TOKEN>&clean=true&format=csv"# Paginar datasets grandescurl "https://api.apify.com/v2/datasets/<DATASET_ID>/items?token=<TOKEN>&offset=1000&limit=1000"
<DATASET_ID> se devuelve como defaultDatasetId en el objeto de la ejecucion. Usa offset y limit para paginar. clean=true elimina campos vacios e internos.
Facturacion y limites
- Pago por resultado. Se cobra por contribuyente devuelto (evento
result). Consulta la pestana de precios para el precio actual por resultado. - Complemento de detalles. Cuando
withDetailsowithBranchesesta activo, cada contribuyente cuya ficha de enriquecimiento se obtiene cobra un pequeno eventodetailssobre el precio por resultado. Ese unico complemento cubre representantes legales, numero de trabajadores y todos los establecimientos anexos del contribuyente. - Sin cargo en caso de fallo. Si una busqueda falla, el actor escribe un elemento con el campo
errory no lo cobra. Las ejecuciones vacias no tienen costo. - Limite de gasto respetado. Configura
maxTotalChargeUsden la ejecucion; al alcanzarlo, el actor deja de emitir y cobrar resultados y complementos. - Los planes gratuitos de Apify estan limitados a 10 contribuyentes por ejecucion, y los complementos de detalles y anexos requieren un plan de pago. Mejora tu plan para mayor volumen y enriquecimiento.
Preguntas frecuentes
Una ejecucion devolvio 0 registros. Por que? El RUC no existe, o la busqueda por nombre no coincidio con nada. Confirma el RUC de 11 digitos, o prueba un fragmento de nombre mas corto. Las ejecuciones sin resultados no se cobran.
Como busco por nombre en lugar de por RUC?
Pasa cualquier texto no numerico en searchTerms (por ejemplo SUPERMERCADOS PERUANOS). Se devuelve cada contribuyente coincidente, hasta maxTaxpayers.
Como obtengo representantes legales, numero de trabajadores y anexos?
Manten withDetails activo para representantes legales y numero de trabajadores, y activa withBranches para cada establecimiento anexo. Ambos son complementos de pago en un plan de pago de Apify.
Por que los valores estan en espanol? Los valores se devuelven tal como los publica SUNAT, para que coincidan con el registro oficial sin traduccion.
Necesito el proxy?
No. Las solicitudes directas normalmente funcionan. Activa useProxy solo si SUNAT empieza a bloquear la ejecucion.
Es una herramienta oficial de SUNAT? No. Este actor es independiente y no tiene afiliacion con SUNAT ni con el gobierno peruano. Solo lee datos que estan disponibles publicamente en el servicio de consulta RUC de SUNAT.
Scrapers relacionados
- Argentina Companies Scraper: registro de empresas y datos tributarios de Argentina.
- Taiwan Business Registry Scraper: registros de empresas de Taiwan.
- Switzerland Companies Scraper: registros del registro mercantil suizo.
Mas scrapers en scrapers.lat
Creado y mantenido por scrapers.lat, donde publicamos scrapers para plataformas publicas de EE. UU. y America Latina: registros de empresas, datos gubernamentales, finanzas, e-commerce y mas. Explora el catalogo o solicita un scraper a medida en scrapers.lat.
Herramienta independiente, sin afiliacion con SUNAT ni con el gobierno peruano. Accede solo a datos del registro RUC disponibles publicamente.
