# Mexico Business Directory (INEGI DENUE) (`tasavera/mexico-denue-directory`) Actor

Official Mexican business directory from INEGI DENUE. Filter by state, municipality, SCIAN industry and size. Bilingual ES/EN. Pay only for businesses with a phone or website.

- **URL**: https://apify.com/tasavera/mexico-denue-directory.md
- **Developed by:** [Tasavera](https://apify.com/tasavera) (community)
- **Categories:** Lead generation, Business
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 business records

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## Mexico Business Directory (INEGI DENUE) / Directorio de empresas de Mexico (DENUE de INEGI)

Search Mexico's official business directory, INEGI's DENUE (more than 5 million establishments), by state, municipality, SCIAN industry code, name keyword and size. By default you get, and pay for, only businesses that list a phone or a website. No owner names, no emails.

Busque en el directorio oficial de negocios de Mexico, el DENUE de INEGI (mas de 5 millones de establecimientos), por estado, municipio, codigo de actividad SCIAN, palabra en el nombre y tamano. Por defecto solo recibe, y paga, negocios con telefono o sitio web. Sin nombres de propietarios, sin correos.

### What you get / Que recibe

| Field / Campo | Meaning / Significado |
|---|---|
| business_name | Trade name / Nombre del establecimiento |
| legal_name | Company legal name, only when it is a company (S.A. de C.V., S. de R.L., A.C....) / Razon social, solo si es empresa |
| scian_code, activity | SCIAN class (Mexican NAICS) and its name / Clase SCIAN y su nombre |
| size_band | Employees, for example "0 a 5 personas" / Personal ocupado |
| neighborhood, zip, location | Colonia, 5-digit CP, municipality and state / Colonia, CP, municipio y estado |
| phone, website | As published by INEGI / Tal como los publica INEGI |
| establishment_type, shopping_center | Fixed or semi-fixed; mall name if any / Fijo o semifijo; plaza comercial |
| latitude, longitude | Coordinates / Coordenadas |
| fuente | Official source of the row / Fuente oficial del registro |
| source_url, source_record_id | Link to DENUE and the official CLEE key / Enlace al DENUE y clave CLEE oficial |
| street_address | Only if you turn it on / Solo si lo activa |

#### Sample output / Ejemplo

```json
{
  "business_name": "EDICIONES FISCALES ISEF",
  "legal_name": null,
  "scian_code": "465312",
  "activity": "Comercio al por menor de libros",
  "size_band": "0 a 5 personas",
  "neighborhood": "CENTRO",
  "zip": "06000",
  "location": "CUAUHTÉMOC, Cuauhtémoc, CIUDAD DE MÉXICO",
  "phone": null,
  "website": "www.lebreriasisef.com.mx",
  "establishment_type": "Fijo",
  "shopping_center": "ZOCALO PINO SUAREZ",
  "latitude": 19.43322679,
  "longitude": -99.1332307,
  "fuente": "Fuente: INEGI, Directorio Estadistico Nacional de Unidades Economicas (DENUE)",
  "source_url": "https://www.inegi.org.mx/app/mapa/denue/",
  "source_record_id": "09015465312003461000003950S7"
}
```

### How to use / Como usarlo

1. **State code / Clave de entidad:** 2 digits, for example 09 Ciudad de Mexico, 14 Jalisco, 19 Nuevo Leon. / 2 digitos.
2. **Municipality / Municipio:** 3-digit INEGI code, or 0 for all. / Clave de 3 digitos, o 0 para todos.
3. **SCIAN code / Codigo SCIAN:** 2 digits (sector), 3 (subsector), 4 (branch) or 6 (class), for example 722 for restaurants. / Por ejemplo 722 para restaurantes.
4. Optional: name keyword, size band, street address, max results. / Opcional: palabra clave, tamano, direccion, maximo.
5. Run and download as CSV, Excel or JSON. / Ejecute y descargue en CSV, Excel o JSON.

### Pricing / Precio

Pay per result: about **$0.002 per business delivered** (lower on higher Apify plans). Businesses with no phone and no website are skipped and not charged unless you turn that filter off.
Example: 1,000 restaurants in Guadalajara with contact info = about **$2.00**.

Pago por resultado: unos **$0.002 por negocio entregado**. Los negocios sin telefono ni sitio web se omiten y no se cobran. Ejemplo: 1,000 restaurantes en Guadalajara = cerca de **$2.00**.

### Privacy / Privacidad

- No email addresses: DENUE emails are often personal, so we drop them. / No entregamos correos.
- For sole proprietors the legal name (razon social) is a person's name, so we return it only when it is clearly a company. / La razon social solo se entrega si es claramente una empresa.
- Street address is off by default. / La direccion esta apagada por defecto.
- Business facts only, as published by INEGI. / Solo datos del negocio, tal como los publica INEGI.

### FAQ / Preguntas frecuentes

**Where does the data come from? / De donde vienen los datos?**
INEGI's DENUE public API, queried live on every run. Every row names its source in the `fuente` column and carries the official CLEE key. / De la API publica del DENUE de INEGI, consultada en vivo.

**How current is it? / Que tan actualizado esta?**
INEGI updates DENUE periodically, and some phones or websites may be out of date. / INEGI lo actualiza periodicamente; algunos datos pueden estar desactualizados.

**Can AI agents use it? / Lo pueden usar agentes de IA?**
Yes. It is a simple batch run with per-result pricing. / Si.

**Something broke? / Algo fallo?**
Open an Issue on this page. We aim to reply within 48 hours. / Abra un Issue en esta pagina. Respondemos en 48 horas.

### What we change / Que transformamos

Tasavera, not INEGI, makes these changes: we drop emails and person-name legal names, skip rows without phone or website (unless you turn that off), pad ZIP codes to 5 digits, tidy spacing, derive the SCIAN code from the CLEE key, lowercase websites and filter by your SCIAN prefix. Nothing else is altered. / Estos cambios los hace Tasavera, no INEGI: quitamos correos y razones sociales de personas, omitimos negocios sin telefono ni sitio web (si asi lo elige), completamos el CP a 5 digitos, limpiamos espacios, obtenemos el codigo SCIAN de la clave CLEE, ponemos sitios web en minusculas y filtramos por su prefijo SCIAN. Nada mas se altera.

### Source credit and disclaimer / Credito y aviso

Fuente: INEGI, Directorio Estadistico Nacional de Unidades Economicas (DENUE), queried live on the run date. Used under INEGI's Terminos de Libre Uso de la Informacion, which allow commercial use with credit. This tool is independent and **not affiliated with, endorsed by, or sponsored by INEGI or the Government of Mexico**. / Esta herramienta es independiente y **no esta afiliada ni respaldada por INEGI ni por el Gobierno de Mexico**.

# Actor input Schema

## `state` (type: `string`):

ES: Clave INEGI de 2 digitos (09 = Ciudad de Mexico, 14 = Jalisco, 19 = Nuevo Leon, 00 = todas). EN: 2-digit INEGI state code (09 = Mexico City, 14 = Jalisco, 19 = Nuevo Leon, 00 = all).

## `municipality` (type: `string`):

ES: Clave de 3 digitos, 0 = todos. EN: 3-digit code, 0 = all.

## `scian` (type: `string`):

ES: Sector (2 digitos), subsector (3), rama (4) o clase (6) SCIAN, 0 = todos. EN: SCIAN (Mexican NAICS) sector, subsector, branch or class, 0 = all.

## `keyword` (type: `string`):

ES: Palabra en el nombre del negocio, 0 = ninguna. EN: Word in the business name, 0 = none.

## `sizeStratum` (type: `string`):

ES: Estrato por numero de empleados. EN: Size band by employees.

## `requireContact` (type: `boolean`):

ES: Solo entrega (y cobra) negocios con telefono o sitio web. EN: Only returns (and charges for) businesses with a phone or website.

## `includeStreetAddress` (type: `boolean`):

ES: Agrega calle y numero. EN: Adds street and number.

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

ES: Limite de registros entregados y cobrados. EN: Cap on records returned and charged.

## Actor input object example

```json
{
  "state": "14",
  "municipality": "039",
  "scian": "722",
  "keyword": "0",
  "sizeStratum": "0",
  "requireContact": true,
  "includeStreetAddress": false,
  "maxItems": 20
}
```

# Actor output Schema

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

No description

## `resultsJson` (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 = {
    "state": "14",
    "municipality": "039",
    "scian": "722",
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("tasavera/mexico-denue-directory").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 = {
    "state": "14",
    "municipality": "039",
    "scian": "722",
    "maxItems": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("tasavera/mexico-denue-directory").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 '{
  "state": "14",
  "municipality": "039",
  "scian": "722",
  "maxItems": 20
}' |
apify call tasavera/mexico-denue-directory --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,tasavera/mexico-denue-directory"
        }
    }
}
```

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/w2gSDxhk6tGkW2VPN/builds/hU88tHNmE17VLDpJm/openapi.json
