{
  "openapi": "3.0.1",
  "info": {
    "title": "DENUE Mexico Business Directory (INEGI Company Data & Leads)",
    "description": "Mexico's official business directory DENUE (INEGI): 5M+ companies with name, legal name, SCIAN activity, staff size, address, coordinates, phone, email and website. Filter by state, municipality, postal code, activity or keyword, or get only new businesses. Export to JSON, CSV or Excel, or via API.",
    "version": "1.0",
    "x-build-id": "mRHbVS2rE8svxEZ62"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/steadyscrape~denue-mexico-business-directory/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-steadyscrape-denue-mexico-business-directory",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/steadyscrape~denue-mexico-business-directory/runs": {
      "post": {
        "operationId": "runs-sync-steadyscrape-denue-mexico-business-directory",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/steadyscrape~denue-mexico-business-directory/run-sync": {
      "post": {
        "operationId": "run-sync-steadyscrape-denue-mexico-business-directory",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "states": {
            "title": "States",
            "type": "array",
            "description": "Mexican states to read, by INEGI code. Each state is one bulk file (México comes in two); empty reads the whole country, file by file, until the maximum. With activities chosen too, the Actor reads whichever is smaller: the states’ files or the national files of those activities.",
            "items": {
              "type": "string",
              "enum": [
                "01",
                "02",
                "03",
                "04",
                "05",
                "06",
                "07",
                "08",
                "09",
                "10",
                "11",
                "12",
                "13",
                "14",
                "15",
                "16",
                "17",
                "18",
                "19",
                "20",
                "21",
                "22",
                "23",
                "24",
                "25",
                "26",
                "27",
                "28",
                "29",
                "30",
                "31",
                "32"
              ],
              "enumTitles": [
                "01 Aguascalientes",
                "02 Baja California",
                "03 Baja California Sur",
                "04 Campeche",
                "05 Coahuila de Zaragoza",
                "06 Colima",
                "07 Chiapas",
                "08 Chihuahua",
                "09 Ciudad de México (Mexico City)",
                "10 Durango",
                "11 Guanajuato",
                "12 Guerrero",
                "13 Hidalgo",
                "14 Jalisco",
                "15 México (Estado de México)",
                "16 Michoacán de Ocampo",
                "17 Morelos",
                "18 Nayarit",
                "19 Nuevo León",
                "20 Oaxaca",
                "21 Puebla",
                "22 Querétaro",
                "23 Quintana Roo",
                "24 San Luis Potosí",
                "25 Sinaloa",
                "26 Sonora",
                "27 Tabasco",
                "28 Tamaulipas",
                "29 Tlaxcala",
                "30 Veracruz de Ignacio de la Llave",
                "31 Yucatán",
                "32 Zacatecas"
              ]
            },
            "default": []
          },
          "municipalities": {
            "title": "Municipalities (alcaldías in Mexico City)",
            "type": "array",
            "description": "Keep businesses in these municipalities, e.g. <code>Guadalajara</code>, <code>Monterrey</code>, <code>Benito Juárez</code>, <code>Cuauhtémoc</code>. Case and accents do not matter. Choose the state too, or every state is read: several states have a municipality of the same name.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "localities": {
            "title": "Localities (towns)",
            "type": "array",
            "description": "Keep businesses in these localities as INEGI names them, e.g. <code>Ciudad de Villa de Álvarez</code>, <code>Suchitlán</code>. Case and accents do not matter.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "neighborhoods": {
            "title": "Neighbourhoods (colonias)",
            "type": "array",
            "description": "Keep businesses whose colonia, fraccionamiento or barrio contains these words from the start of a word, e.g. <code>Polanco</code> (finds \"POLANCO V SECCION\"), <code>Centro</code>.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "postalCodes": {
            "title": "Postal codes",
            "type": "array",
            "description": "Keep businesses whose postal code is one of these, or starts with these digits: <code>06600</code>, or <code>066</code> for every code starting with 066. Choose the state too, or every state is read.",
            "items": {
              "type": "string",
              "pattern": "^\\s*(\\d\\s*){0,5}$"
            },
            "default": []
          },
          "sectors": {
            "title": "Sectors (SCIAN)",
            "type": "array",
            "description": "Keep businesses of these SCIAN 2018 sectors.",
            "items": {
              "type": "string",
              "enum": [
                "11",
                "21",
                "22",
                "23",
                "31-33",
                "43",
                "46",
                "48-49",
                "51",
                "52",
                "53",
                "54",
                "55",
                "56",
                "61",
                "62",
                "71",
                "72",
                "81",
                "93"
              ],
              "enumTitles": [
                "11 Agriculture, animal breeding, forestry, fishing and hunting (Agricultura…)",
                "21 Mining (Minería)",
                "22 Electricity, water and gas supply (Energía eléctrica, agua y gas)",
                "23 Construction (Construcción)",
                "31-33 Manufacturing (Industrias manufactureras)",
                "43 Wholesale trade (Comercio al por mayor)",
                "46 Retail trade (Comercio al por menor)",
                "48-49 Transportation, mail and warehousing (Transportes, correos y almacenamiento)",
                "51 Information and mass media (Información en medios masivos)",
                "52 Finance and insurance (Servicios financieros y de seguros)",
                "53 Real estate and rental (Servicios inmobiliarios y de alquiler)",
                "54 Professional, scientific and technical services (Servicios profesionales, científicos y técnicos)",
                "55 Corporate offices (Corporativos)",
                "56 Business support and waste management (Servicios de apoyo a los negocios)",
                "61 Education (Servicios educativos)",
                "62 Health care and social assistance (Servicios de salud y de asistencia social)",
                "71 Arts, entertainment and recreation (Servicios de esparcimiento)",
                "72 Accommodation and food services: hotels, restaurants (Alojamiento y preparación de alimentos)",
                "81 Other services: repair, personal care, associations (Otros servicios)",
                "93 Government and international bodies (Actividades gubernamentales)"
              ]
            },
            "default": []
          },
          "activityCodes": {
            "title": "Activity codes (SCIAN)",
            "type": "array",
            "description": "Keep businesses whose SCIAN 2018 code starts with these 2 to 6 digits, e.g. <code>7225</code> restaurants, <code>621111</code> doctors’ offices, <code>4611</code> grocery stores, <code>5413</code> architecture and engineering, <code>8121</code> beauty salons. Combined with the sectors above as any-of.",
            "items": {
              "type": "string",
              "pattern": "^\\s*((11|21|22|23|31|32|33|43|46|48|49|51|52|53|54|55|56|61|62|71|72|81|93)\\d{0,4})?\\s*$"
            },
            "default": []
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Keep businesses whose name, legal name or activity contains any of these words or phrases from the start of a word, e.g. <code>taco</code> (finds \"TACOS EL GÜERO\"), <code>dental</code>, <code>farmacia</code>, <code>hotel</code>. Case and accents do not matter.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "staffRanges": {
            "title": "Staff size",
            "type": "array",
            "description": "Keep businesses in these bands of people employed, as DENUE records them.",
            "items": {
              "type": "string",
              "enum": [
                "0-5",
                "6-10",
                "11-30",
                "31-50",
                "51-100",
                "101-250",
                "251+"
              ],
              "enumTitles": [
                "0–5 people",
                "6–10 people",
                "11–30 people",
                "31–50 people",
                "51–100 people",
                "101–250 people",
                "251 or more people"
              ]
            },
            "default": []
          },
          "requireEmail": {
            "title": "Only with an email",
            "type": "boolean",
            "description": "Keep only businesses with an email address: 20 % of them in Colima, 23 % in Mexico City (release 05/2026).",
            "default": false
          },
          "requirePhone": {
            "title": "Only with a phone",
            "type": "boolean",
            "description": "Keep only businesses with a phone number: 44 % of them in Colima, 36 % in Mexico City.",
            "default": false
          },
          "requireWebsite": {
            "title": "Only with a website",
            "type": "boolean",
            "description": "Keep only businesses with a website: 7 % of them in Colima, 11 % in Mexico City.",
            "default": false
          },
          "registeredFrom": {
            "title": "Added to DENUE from (YYYY-MM)",
            "pattern": "^\\s*(\\d{4}(-(0[1-9]|1[0-2]))?)?\\s*$",
            "type": "string",
            "description": "Keep businesses INEGI added to DENUE in this month or later, e.g. <code>2024-11</code> or a year <code>2025</code>. DENUE records the month a business entered the directory, not when it opened.",
            "default": ""
          },
          "onlyNew": {
            "title": "Only new businesses since the last run",
            "type": "boolean",
            "description": "Monitor mode: deliver only the businesses that were not in DENUE at the previous run with the same filters. The first run saves a free baseline (the files holding businesses that match are charged). INEGI publishes a new release a few times a year; until then a run sees the files unchanged, reads nothing and charges nothing.",
            "default": false
          },
          "maxResults": {
            "title": "Max businesses",
            "minimum": 0,
            "type": "integer",
            "description": "The most businesses a run delivers; 0 for all. The run stops reading the files as soon as it has them, so a small maximum reads only part of a file.",
            "default": 1000
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}