# Mexico Business Directory - INEGI DENUE Lookup (`1rrock/mexico-denue-lookup`) Actor

Search Mexico's official INEGI DENUE business directory (6M+ establishments) by name, keyword + state or GPS radius, or look up DENUE IDs. Get name, legal name, activity, size, full address, phone, email, website and coordinates. Official free API, no proxy. $1.50 per 1,000 results.

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

## Pricing

from $1.50 / 1,000 results

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

### What is Mexico Business Directory - INEGI DENUE Lookup?

This Actor searches the **DENUE** (*Directorio Estadístico Nacional de Unidades Económicas*), the official **Mexico business directory** published by **INEGI**, through INEGI's free official API. Search Mexican businesses **by name, by keyword + state, or by GPS radius**, or look up known **DENUE IDs**. For each establishment you get the business name, legal name (razón social), economic activity, employee size band, full address, phone, email, website and coordinates, ready to export as JSON, CSV or Excel or to pull through the Apify API.

- ✅ **Official source**: INEGI DENUE, about 6 million active economic units across all 32 Mexican states.
- ✅ **No proxy, no scraping**: uses the official DENUE REST API. Commercial reuse is allowed with attribution.
- ✅ **Works out of the box**: runs without your own token. Add a free INEGI token for production use.
- ✅ **Four search modes**: DENUE ID (Ficha), name (Nombre), keyword + state (BuscarEntidad), lat/lon radius (Buscar).
- ✅ **Cheap and predictable**: **$1.50 per 1,000 results**, platform usage included.

### What data can you extract from DENUE?

| Field | Example | Meaning |
|---|---|---|
| `denue_id`, `clee` | 723550 | DENUE establishment ID and CLEE key |
| `nombre`, `razon_social` | OXXO | Business name and legal name (razón social) |
| `clase_actividad` | Comercio al por menor en tiendas de abarrotes… | Economic activity class (SCIAN) |
| `estrato` | 0 a 5 personas | Employee size band |
| `tipo_vialidad`, `calle`, `num_exterior`, `num_interior`, `colonia`, `cp` | AVENIDA, INSURGENTE EUGENIO JIRON… | Street address and ZIP code |
| `localidad`, `municipio`, `entidad`, `ubicacion` | Iztapalapa, CIUDAD DE MÉXICO | Locality, municipality and state |
| `telefono`, `correo_e`, `sitio_internet` | | Phone, email and website, when the business published them |
| `latitud`, `longitud` | 19.34163014, -99.07484527 | Coordinates |
| `tipo`, `centro_comercial`, `tipo_centro_comercial`, `num_local` | Fijo | Establishment type and shopping-center info |
| `method`, `queried` | Ficha, 723550 | Which API method and query produced the row |
| `source`, `attribution`, `fetched_at` | inegi_denue_api | Source and the required INEGI citation |

### Use cases for Mexico company data

- 📈 **B2B lead generation in Mexico**: list restaurants, pharmacies, workshops or any other business type in a state or around a point.
- 🏭 **Supplier and distributor verification**: confirm a Mexican business exists at the declared address, with its activity and size.
- 🔎 **KYC / KYB support**: cross-check names, addresses and activity of Mexican counterparties.
- 🗂️ **CRM enrichment**: add activity, size band, ZIP code and coordinates to Mexican accounts.
- 🗺️ **Market and location analysis**: count competitors or points of sale within a radius for site selection.

### How to search the Mexico business directory

1. Click **Try for free** (or **Start**) on this page.
2. Choose one way to search:
   - **DENUE Ids**: paste establishment IDs for exact lookups.
   - **Name / razón social**: e.g. `OXXO`, with a **Federal entity code** such as `09` (Ciudad de México) or `00` (all states).
   - **Keyword**: e.g. `restaurantes` + state code.
   - **Latitude / Longitude + Radius**: everything within up to 5,000 m of a point.
3. Leave **Lookup mode** on `auto`. It picks the method from the fields you filled (IDs → name → coordinates → keyword).
4. Click **Start** and open the **Output** tab, or export as **JSON, CSV, Excel, XML or HTML**.
5. For production, paste your own free [INEGI DENUE token](https://www.inegi.org.mx/app/api/denue/tokenVerify/tokenverify.html) into **INEGI DENUE API token** (you get it by email in a minute).

State codes: `01` Aguascalientes … `09` Ciudad de México, `14` Jalisco, `15` Estado de México, `19` Nuevo León … `32` Zacatecas (INEGI 2-digit codes). `00` = all states, for name and keyword search.

#### Input example

Search by name in Mexico City:

```json
{
  "mode": "auto",
  "nombre": "OXXO",
  "entidad": "09",
  "limit": 10
}
```

Look up DENUE IDs (the default input):

```json
{ "ids": ["723550", "895680"] }
```

Radius search around Zócalo, Mexico City:

```json
{ "mode": "buscar", "condicion": "cafe", "lat": 19.4326, "lon": -99.1332, "metros": 300 }
```

| Field | Description |
|---|---|
| `mode` | `auto` (default), `ficha` (IDs), `nombre` (name), `buscar_entidad` (keyword + state), `buscar` (lat/lon radius). |
| `ids` | DENUE establishment IDs for exact lookup. |
| `nombre` | Word(s) in the business name or razón social. |
| `condicion` | Keyword for keyword/radius search. `todos` = all businesses. |
| `entidad` | INEGI 2-digit state code (`01`–`32`), `00` = all states. Default `09`. |
| `limit` | Max records for name and keyword search (1–1,000, default 10). |
| `lat`, `lon`, `metros` | Center point and radius (max 5,000 m) for radius search. |
| `maxItems` | Max records for radius search (default 100, up to 10,000). |
| `token` | Optional. Your own free INEGI DENUE API token. |
| `delaySeconds` | Pause between ID lookups (default 0.5 s). |

#### Output example

```json
{
  "denue_id": "723550",
  "clee": "09007461110126731000000000U4",
  "nombre": "OXXO",
  "razon_social": "OXXO",
  "clase_actividad": "Comercio al por menor en tiendas de abarrotes, ultramarinos y misceláneas",
  "estrato": "0 a 5 personas",
  "tipo_vialidad": "AVENIDA",
  "calle": "INSURGENTE EUGENIO JIRON",
  "num_exterior": "1",
  "num_interior": null,
  "colonia": "PARAJE SAN JUAN",
  "cp": "09830",
  "ubicacion": "IZTAPALAPA , Iztapalapa, CIUDAD DE MÉXICO",
  "localidad": "IZTAPALAPA",
  "municipio": "Iztapalapa",
  "entidad": "CIUDAD DE MÉXICO",
  "telefono": null,
  "correo_e": null,
  "sitio_internet": null,
  "tipo": "Fijo",
  "longitud": "-99.07484527",
  "latitud": "19.34163014",
  "method": "Ficha",
  "queried": "723550",
  "source": "inegi_denue_api",
  "attribution": "Fuente: INEGI, Directorio Estadístico Nacional de Unidades Económicas (DENUE)",
  "fetched_at": "2026-10-07T05:59:27.342631+00:00"
}
```

If a lookup fails because of the input (an invalid or unknown ID: `invalid_id`, `not_found`), the Actor writes a row with `"ok": false`, an `error` code, the `method` and the `queried` value. If INEGI rejects the token, the run fails with a clear message and no row is written. Temporary INEGI or network problems are not written to the dataset either (see below).

### How much does DENUE data cost?

This Actor uses **pay-per-result** pricing: **$1.50 per 1,000 results** ($0.0015 per establishment), with Apify platform usage already included. Apify also charges a tiny Actor start fee of $0.00005 per run per GB of memory.

- **What counts as a result?** Every item written to the dataset: one per establishment found, plus one per invalid or unknown ID (`ok: false` rows).
- **Temporary failures are not charged.** If a lookup fails because of a temporary problem at INEGI or on our side (network errors, timeouts, HTTP 429/5xx, unreadable responses), no dataset item is written and nothing is charged. These lookups are listed under `failedLookups` in the run summary (key-value store record `OUTPUT`, linked as *Run summary* in the run's Output tab) so you can run them again later. If nothing could be looked up at all, the run is marked as failed.
- **Control your spend:** name and keyword searches stop at `limit` (default 10, max 1,000). A radius search stops at `maxItems` (default **100**); a dense city center can have thousands of businesses inside the circle, so raise `maxItems` only when you want them all, or use a smaller radius or a specific keyword.
- **How much fits in one run?** At the defaults one run returns up to 10 records for a name/keyword search or up to 100 for a radius search, in a few seconds. ID lookups run one at a time (about 1–1.5 s each with the default 0.5 s delay), so the default 30-minute timeout covers roughly **1,000–1,500 IDs**. For bigger jobs raise `limit` / `maxItems`, raise the run timeout, or split the work into several runs (for example one per state or per keyword).
- **Examples:** 1,000 establishments ≈ $1.50. The default input (2 IDs) ≈ $0.003.
- **Free plan:** Apify's free plan includes $5 of monthly usage, which covers about 3,000 results.

### Use the DENUE API from Python, JavaScript or no-code tools

**Python** ([apify-client](https://docs.apify.com/api/client/python)):

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("1rrock/mexico-denue-lookup").call(
    run_input={"nombre": "OXXO", "entidad": "09", "limit": 50}
)
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item.get("denue_id"), item.get("nombre"), item.get("cp"), item.get("municipio"))
```

**JavaScript / Node.js** ([apify-client](https://docs.apify.com/api/client/js)):

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: '<YOUR_APIFY_TOKEN>' });
const run = await client.actor('1rrock/mexico-denue-lookup').call({
    condicion: 'restaurantes', entidad: '14', limit: 100, mode: 'buscar_entidad',
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items.length);
```

**HTTP (one call, returns the results):**

```bash
curl -X POST "https://api.apify.com/v2/acts/1rrock~mexico-denue-lookup/run-sync-get-dataset-items?token=<YOUR_APIFY_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"ids": ["723550"]}'
```

**No-code:** connect the Actor to [Zapier](https://docs.apify.com/platform/integrations/zapier), [Make](https://docs.apify.com/platform/integrations/make), Google Sheets (with [Google Sheets Import & Export](https://apify.com/lukaskrivka/google-sheets)), webhooks and [other integrations](https://docs.apify.com/platform/integrations). You can also run it on a [schedule](https://docs.apify.com/platform/schedules) or let AI agents call it through the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp).

### FAQ

#### Is it legal to use DENUE data commercially?

Yes. INEGI publishes DENUE under its **Términos de Libre Uso**, which allow free use, including commercial use as input for other products and services, as long as you cite the source. Every row includes the required `attribution` text.

#### Do I need an INEGI token?

No, not to try it. Without a token the Actor uses the public example token from INEGI's own token demo page, which INEGI may revoke at any time. For production, register your own free token [here](https://www.inegi.org.mx/app/api/denue/tokenVerify/tokenverify.html) (only an email address is needed; INEGI emails the token automatically) and pass it in `token`.

#### How fresh is the data?

Results come live from the INEGI API, so they reflect the current DENUE edition (INEGI updates DENUE periodically; the 05/2026 edition lists about 6.1 million establishments). DENUE covers active, non-agricultural economic units.

#### What are the limits?

Radius search is limited to 5,000 m by INEGI and returns at most `maxItems` records (default 100). Name and keyword searches return records 1…`limit` (default 10, max 1,000 per run). ID lists have no cap other than the run timeout (roughly 1,000–1,500 IDs at the defaults). Phone, email and website are only present when the business reported them to INEGI.

#### Something went wrong. What should I do?

Check the `ok: false` rows and the run summary (`OUTPUT` record, which lists lookups that failed temporarily and were not charged) first. A run that fails with *INEGI rejected the API token* means the token is invalid or was revoked: register your own free token (see above). For bugs or feature requests, open an issue in the **Issues** tab.

### Data source and license

**License / terms (brief):**

- INEGI **Términos de Libre Uso** — free use including **commercial exploitation** as input for other products/services.
- Must cite: `Fuente: INEGI, Directorio Estadístico Nacional de Unidades Económicas (DENUE)`.
- Do not imply official INEGI endorsement; disclose any transforms.
- Full text: https://www.inegi.org.mx/inegi/terminos.html

**Transforms:** this Actor renames the API fields to snake_case, trims whitespace, splits `Ubicacion` into locality / municipality / state, and adds `method`, `queried`, `source`, `attribution` and `fetched_at`. It does not change the values themselves. This Actor is not an INEGI product and is not endorsed by INEGI. API docs: [ES](https://www.inegi.org.mx/servicios/api_denue.html) · [EN](https://en.www.inegi.org.mx/servicios/api_denue.html).

### Other actors by 1rrock

Official open-data company lookups, all at $1.50 per 1,000 results:

- 🇧🇷 [Brazil CNPJ Lookup - Receita Federal Company Data](https://apify.com/1rrock/brazil-cnpj-lookup): bulk consulta CNPJ with razão social, situação cadastral, CNAE and QSA.
- 🇯🇵 [Japan Invoice Number Checker - T-Number Lookup](https://apify.com/1rrock/japan-invoice-lookup): bulk-verify Japanese qualified invoice registration numbers (インボイス登録番号).
- 🇯🇵 [Japan Company Data API - gBizINFO Corporate Lookup](https://apify.com/1rrock/japan-gbizinfo-lookup): Japanese company profiles by corporate number (法人番号) or name.
- 🇨🇴 [Colombia NIT Lookup - RUES Company Registry Search](https://apify.com/1rrock/colombia-nit-lookup): consulta NIT in bulk and new-company lead lists from Colombia's official RUES registry.
- 🇹🇼 [Taiwan Company Lookup - 統一編號 GCIS Registry Search](https://apify.com/1rrock/taiwan-company-lookup): Taiwanese companies by 統一編號 or name with capital, directors and new-company lists.

# Actor input Schema

## `mode` (type: `string`):

auto = pick the method from the fields you filled, in this order: DENUE Ids → Name → Latitude/Longitude → Keyword. Or force one: ficha (by DENUE Id), nombre (by name), buscar_entidad (keyword + state), buscar (lat/lon radius).

## `ids` (type: `array`):

Enter DENUE establishment Ids, one per line, for exact lookups (Ficha). In auto mode, Ids take priority over all other search fields.

## `nombre` (type: `string`):

Enter word(s) from the business name or razón social, e.g. OXXO or FARMACIA. Used with Federal entity code. Ignored in auto mode when DENUE Ids are filled.

## `condicion` (type: `string`):

Keyword for keyword + state search or radius search, e.g. restaurantes, cafe, taller. Use 'todos' for all businesses.

## `entidad` (type: `string`):

INEGI 2-digit state code: 01–32 (09 = Ciudad de México, 14 = Jalisco, 15 = Estado de México, 19 = Nuevo León). Use 00 for all states (name and keyword search).

## `limit` (type: `integer`):

Maximum establishments returned by name or keyword search (records 1…limit). Each record is one result.

## `lat` (type: `number`):

Center latitude for radius search, e.g. 19.4326 (Zócalo, Mexico City).

## `lon` (type: `number`):

Center longitude for radius search, e.g. -99.1332.

## `metros` (type: `integer`):

Search radius in meters (INEGI max 5,000). Returns the establishments inside the circle, up to 'Max records (radius search)' (default 100); start small (100–300 m) in dense areas.

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

Maximum establishments returned by a radius (lat/lon) search. Dense areas can contain thousands of businesses; raise this for bigger jobs. Each record is one result.

## `token` (type: `string`):

Optional. Your own free INEGI DENUE token (get it by email at https://www.inegi.org.mx/app/api/denue/tokenVerify/tokenverify.html). If empty, the Actor uses INEGI's public example token, which may be revoked at any time.

## `delaySeconds` (type: `number`):

Pause between API calls when looking up several DENUE Ids.

## Actor input object example

```json
{
  "mode": "auto",
  "ids": [
    "723550",
    "895680"
  ],
  "nombre": "OXXO",
  "condicion": "todos",
  "entidad": "09",
  "limit": 10,
  "metros": 500,
  "maxItems": 100,
  "delaySeconds": 0.5
}
```

# Actor output Schema

## `establishments` (type: `string`):

No description

## `runSummary` (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 = {
    "ids": [
        "723550",
        "895680"
    ],
    "nombre": "OXXO",
    "entidad": "09"
};

// Run the Actor and wait for it to finish
const run = await client.actor("1rrock/mexico-denue-lookup").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 = {
    "ids": [
        "723550",
        "895680",
    ],
    "nombre": "OXXO",
    "entidad": "09",
}

# Run the Actor and wait for it to finish
run = client.actor("1rrock/mexico-denue-lookup").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 '{
  "ids": [
    "723550",
    "895680"
  ],
  "nombre": "OXXO",
  "entidad": "09"
}' |
apify call 1rrock/mexico-denue-lookup --silent --output-dataset

```

## MCP server setup

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

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/kfsP4kRqIWqBPu1Mv/builds/bwdSpkd8fyo1llUki/openapi.json
