{
  "openapi": "3.0.1",
  "info": {
    "title": "Mexico Business Directory – DENUE Leads with Phone & Email",
    "description": "Search Mexico's official INEGI DENUE business directory (5.5M establishments): name, legal name, SCIAN activity, employees, address, phone, email, website, GPS and date added. Filter by state, city, keyword, size. $1 per 1,000 businesses.",
    "version": "0.1",
    "x-build-id": "Qv1NLLgB7aH9LDx1v"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/gazidev~mexico-business-directory/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-gazidev-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/gazidev~mexico-business-directory/runs": {
      "post": {
        "operationId": "runs-sync-gazidev-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/gazidev~mexico-business-directory/run-sync": {
      "post": {
        "operationId": "run-sync-gazidev-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",
        "required": [
          "states"
        ],
        "properties": {
          "states": {
            "title": "States",
            "minItems": 1,
            "type": "array",
            "description": "Mexican states (entidades) to search, at least one. Big states: CDMX ~45 MB, Estado de México ~80 MB of ZIP.",
            "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",
                "06 Colima",
                "07 Chiapas",
                "08 Chihuahua",
                "09 Ciudad de México (CDMX)",
                "10 Durango",
                "11 Guanajuato",
                "12 Guerrero",
                "13 Hidalgo",
                "14 Jalisco",
                "15 Estado de México",
                "16 Michoacán",
                "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",
                "31 Yucatán",
                "32 Zacatecas"
              ]
            }
          },
          "keyword": {
            "title": "Keyword(s)",
            "type": "string",
            "description": "Matched against the business name, legal name (razón social) and activity name. Case- and accent-insensitive, matches the start of a word. Separate several with commas (any of them), e.g. `dentista, consultorio dental`."
          },
          "scianCodes": {
            "title": "SCIAN activity codes (prefixes)",
            "type": "array",
            "description": "SCIAN 2018 code prefixes (2-6 digits), e.g. `722` restaurants & bars, `4611` grocery stores, `6212` dentists, `5311` real-estate rental, `31`-`33` manufacturing.",
            "items": {
              "type": "string"
            }
          },
          "municipalities": {
            "title": "Municipalities / alcaldías",
            "type": "array",
            "description": "Exact municipality names (accent-insensitive), e.g. `Guadalajara`, `Monterrey`, `Benito Juárez`, or 5-digit INEGI codes (state + municipality), e.g. `09014`.",
            "items": {
              "type": "string"
            }
          },
          "postalCodes": {
            "title": "Postal code prefixes",
            "type": "array",
            "description": "E.g. `06600` (one código postal) or `066` (a zone).",
            "items": {
              "type": "string"
            }
          },
          "employeeRanges": {
            "title": "Employees (personal ocupado)",
            "type": "array",
            "description": "Size ranges as published by INEGI. Empty = any size.",
            "items": {
              "type": "string",
              "enum": [
                "0-5",
                "6-10",
                "11-30",
                "31-50",
                "51-100",
                "101-250",
                "251+"
              ],
              "enumTitles": [
                "0-5 employees",
                "6-10 employees",
                "11-30 employees",
                "31-50 employees",
                "51-100 employees",
                "101-250 employees",
                "251+ employees"
              ]
            }
          },
          "hasPhone": {
            "title": "Only with phone",
            "type": "boolean",
            "description": "Skip establishments without a phone number.",
            "default": false
          },
          "hasEmail": {
            "title": "Only with email",
            "type": "boolean",
            "description": "Skip establishments without an email address.",
            "default": false
          },
          "hasWebsite": {
            "title": "Only with website",
            "type": "boolean",
            "description": "Skip establishments without a website.",
            "default": false
          },
          "addedSince": {
            "title": "Added to DENUE since (month)",
            "pattern": "^$|^(19|20)\\d\\d-(0[1-9]|1[0-2])(-\\d\\d)?$",
            "type": "string",
            "description": "New-business leads: only establishments whose `fecha_alta` (month added to the directory) is on/after this month, format `YYYY-MM`, e.g. `2025-06`."
          },
          "onlyNew": {
            "title": "Only new establishments (monitoring)",
            "type": "boolean",
            "description": "Skip DENUE ids returned by earlier runs with the same *State key*. Schedule monthly to get only establishments added in a new DENUE edition.",
            "default": false
          },
          "stateKey": {
            "title": "State key",
            "type": "string",
            "description": "Separate 'already seen' lists for different searches.",
            "default": "default"
          },
          "maxItems": {
            "title": "Max businesses",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many businesses (0 = all matching). You pay per business saved.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}