# Mexico Company Directory – DENUE / INEGI Business Leads (`frankely84/mexico-denue-company-directory`) Actor

Search Mexico's official DENUE (INEGI) business directory by SCIAN activity, state, municipality, employee size, keyword and radius. Filter to firms with phone, email or website. Watch mode for newly listed establishments. Clean lead-ready JSON/CSV.

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

## Pricing

$2.00 / 1,000 companies

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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 Company Directory – DENUE / INEGI Business Leads

Search **Mexico's official business directory (DENUE)** published by **INEGI** — more than 5 million establishments — and export clean **JSON, CSV or Excel** leads. Filter by **SCIAN activity code**, **state / municipality**, **employee size**, **keyword**, or a **radius around a lat/lon**. Keep only firms with **phone, email or website**. Turn on **Watch mode** to get alerts when newly listed businesses appear.

Data comes from the public INEGI DENUE API. No login and no proxy required.

### What you get

| Field | Description |
|---|---|
| `name`, `legalName` | Trade name and razón social |
| `activity`, `scianCode` | SCIAN activity description and class code |
| `employeeRange` | Size bracket (0–5, 6–10, … 251+) |
| `phone`, `email`, `website` | Contact fields when present in DENUE |
| `street`, `neighborhood`, `postalCode`, `municipality`, `state` | Address |
| `latitude`, `longitude` | Coordinates |
| `listedAt` | DENUE listing month (`YYYY-MM`) when the API returns it |
| `hasPhone` / `hasEmail` / `hasWebsite` | Booleans for easy filtering downstream |

### How to use it (3 steps)

1. Pick a **state** (e.g. `09` or `Ciudad de México`) and/or a **SCIAN code** (e.g. `722` food services), or set **lat/lon + radius**.
2. Optionally narrow by **municipality name or code** (e.g. `Zapopan`, `Benito Juárez`, or `014`), plus **keywords**, **company names**, **employee size** and the **only with phone/email/website** toggles.
3. Run it and export, or schedule it with **Watch mode** on.

### Use cases

- **B2B lead lists** of restaurants, clinics, hardware stores, construction firms… by city and size.
- **Territory / radius prospecting** around a store, warehouse or event (up to 5 km).
- **Enrichment**: find phone / email / website for Mexican establishments in DENUE.
- **New-business alerts**: Watch mode + *listed in last N months* for newly appearing firms.
- **Market sizing** by SCIAN code and state before opening a branch.

### Pricing (pay per event)

- `company`: **$0.002** per establishment returned ($2 per 1,000).
- In Watch mode you pay only for **new** establishments. *Max results* caps the cost of every run.

### Why this Actor

Compared with other DENUE scrapers on the Store, this one focuses on **lead-ready filters** (phone / email / website, employee size, SCIAN, municipio by **name or code**, radius), **deduplication**, a clear **Watch mode**, graceful stop before timeout, and a **lower per-company price**.

### Integrations

Schedule it in Apify and send results to email, Slack, Google Sheets, Zapier, Make, n8n or a webhook, or call it from the Apify API, Python/JS clients or MCP.

### FAQ

**Is this official INEGI data?** Yes. It queries the public DENUE API (Directorio Estadístico Nacional de Unidades Económicas). Coverage and contact fields are whatever INEGI publishes; many small firms have no phone/email.

**What is a SCIAN code?** The North American Industrial Classification used in Mexico. 2 digits = sector, 3 = subsector, 4 = branch, 6 = class. Example: `72` lodging & food, `722` food services, `722513` antojitos restaurants.

**How does radius search work?** Provide latitude, longitude and radius in meters (max **5,000**). DENUE returns establishments around that point; the Actor then applies your contact / activity filters and the max-results cap.

**How do Watch alerts work?** Turn on *Watch mode*, set a *Watch name*, optionally *Listed in last N months*, and schedule daily or weekly. Each run returns only establishment ids not seen before.

**Can I filter by municipality name?** Yes. Set *State* and put either the 3-digit INEGI code or the official name in *Municipality* (e.g. state `Jalisco` + `Zapopan`, or `Ciudad de México` + `Benito Juárez`). Accents are optional. Names need the state because many municipios share a name across Mexico.

**What if the run times out?** The Actor stops about 30 s before the run timeout and keeps everything found so far, with a clear status message.

***

### En español: Directorio de empresas de México (DENUE / INEGI)

Consulta el **DENUE oficial del INEGI** (más de 5 millones de establecimientos) por **código SCIAN**, **estado / municipio**, **tamaño (estrato)**, **palabra clave** o **radio alrededor de un punto**. Filtra solo negocios con **teléfono, correo o sitio web**. Con el **modo vigilancia** recibes alertas de establecimientos nuevos.

#### Preguntas frecuentes

**¿Sirve para generar leads B2B en México?** Sí. Elige estado + actividad (SCIAN o keyword), marca *Only with any contact* y exporta teléfono, correo, web y dirección. (DENUE no siempre trae contacto; el filtro evita filas vacías.)

**¿Cómo busco restaurantes en CDMX con teléfono?** Estado `09` o `Ciudad de México`, SCIAN `722`, *Only with phone* = sí, *Max results* = 200.

**¿Puedo poner el municipio por nombre?** Sí. Ejemplo: estado `Jalisco` + municipio `Zapopan`, o `Ciudad de México` + `Benito Juárez` (también acepta la clave INEGI de 3 dígitos).

**¿Puedo vigilar negocios nuevos?** Activa *Watch mode*, pon *Listed in last N months* = 6 y prográmalo semanal. Solo pagas por ids nuevos.

**¿Cuánto cuesta?** $0.002 USD por empresa ($2 por 1,000).

# Actor input Schema

## `keywords` (type: `array`):

Words to search in the establishment name, legal name, street, colonia or activity (SCIAN description). Separate searches are OR'd when used with the entity search. Examples: 'restaurante', 'ferretería', 'consultorio dental'. Leave empty to list by SCIAN / state / radius only.

## `companyNames` (type: `array`):

Search by establishment name or razón social (e.g. 'OXXO', 'BIMBO'). Prefer this over keywords when you know the brand.

## `activityKeywords` (type: `array`):

Optional. Keep only rows whose activity description or name contains one of these words (accent-insensitive substring), e.g. 'tacos', 'software', 'construcción'.

## `scianCode` (type: `string`):

Official SCIAN code: 2 digits = sector (e.g. 72 lodging & food), 3 = subsector (722 food services), 4 = branch, 6 = class (722513 antojitos). Leave empty for all activities.

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

Mexican state as 2-digit code (09 = CDMX, 14 = Jalisco, 19 = Nuevo León) or name ('Jalisco', 'Ciudad de México', 'CDMX'). Leave empty for nationwide (slower).

## `municipalityCode` (type: `string`):

Optional. 3-digit INEGI municipality code (e.g. 120) OR the official municipality / alcaldía name (e.g. 'Zapopan', 'Benito Juárez', 'San Pedro Garza García'). Names are accent-insensitive. Requires State. Empty or 0 = all municipalities in the state.

## `employeeRanges` (type: `array`):

Optional. Filter by DENUE employee-size brackets. Leave empty for all sizes.

## `latitude` (type: `number`):

Center latitude (WGS84). Use with Longitude and Radius. Example CDMX Zócalo: 19.4326.

## `longitude` (type: `number`):

Center longitude (WGS84). Example CDMX Zócalo: -99.1332.

## `radiusMeters` (type: `integer`):

Search radius around lat/lon. DENUE maximum is 5,000 m. 0 = do not use radius mode.

## `onlyWithPhone` (type: `boolean`):

Keep establishments that have a phone number in DENUE.

## `onlyWithEmail` (type: `boolean`):

Keep establishments that have an e-mail in DENUE.

## `onlyWithWebsite` (type: `boolean`):

Keep establishments that have a website in DENUE.

## `onlyWithContact` (type: `boolean`):

Lead-friendly filter: keep rows that have at least one of phone, e-mail or website. Combine with the stricter toggles above if needed.

## `listedInLastMonths` (type: `integer`):

Optional. Keep establishments whose DENUE Fecha_Alta (listing month) is within the last N months. Useful to find newly registered businesses. 0 = no limit. Works best with area/SCIAN searches (radius results often omit Fecha_Alta).

## `onlyNew` (type: `boolean`):

Remembers establishment ids per Watch name and only outputs ones not seen before. Schedule daily/weekly to get alerts for newly appearing businesses; you pay only for new results.

## `monitorName` (type: `string`):

Name for this watch's memory so different watches do not share state, e.g. 'cdmx-restaurants'.

## `maxResults` (type: `integer`):

Cap on companies returned (and charged) per run.

## Actor input object example

```json
{
  "keywords": [
    "restaurante"
  ],
  "state": "09",
  "radiusMeters": 0,
  "onlyWithPhone": false,
  "onlyWithEmail": false,
  "onlyWithWebsite": false,
  "onlyWithContact": false,
  "listedInLastMonths": 0,
  "onlyNew": false,
  "monitorName": "default",
  "maxResults": 100
}
```

# Actor output Schema

## `companies` (type: `string`):

Matching establishments (overview).

## `companiesDetailed` (type: `string`):

All fields including coordinates and CLEE.

## `summary` (type: `string`):

Mode, filters and counts.

# 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 = {
    "keywords": [
        "restaurante"
    ],
    "state": "09"
};

// Run the Actor and wait for it to finish
const run = await client.actor("frankely84/mexico-denue-company-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 = {
    "keywords": ["restaurante"],
    "state": "09",
}

# Run the Actor and wait for it to finish
run = client.actor("frankely84/mexico-denue-company-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 '{
  "keywords": [
    "restaurante"
  ],
  "state": "09"
}' |
apify call frankely84/mexico-denue-company-directory --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,frankely84/mexico-denue-company-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/JD9WhuL6ddlCMfqUS/builds/U3CUSioTrljPW1u6Y/openapi.json
