{
  "openapi": "3.0.1",
  "info": {
    "title": "Mexico Business Directory (DENUE / INEGI)",
    "description": "Search Mexico's official business directory DENUE (INEGI) by keyword, state, municipality, SCIAN activity code or geographic radius. Returns 5+ million establishments with activity, employee size, full address and coordinates via INEGI's official API. Pay per result.",
    "version": "0.1",
    "x-build-id": "MxDxf4vPdwxpAyZbo"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/hexadatalabs~mexico-business-directory-denue/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-hexadatalabs-mexico-business-directory-denue",
        "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/hexadatalabs~mexico-business-directory-denue/runs": {
      "post": {
        "operationId": "runs-sync-hexadatalabs-mexico-business-directory-denue",
        "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/hexadatalabs~mexico-business-directory-denue/run-sync": {
      "post": {
        "operationId": "run-sync-hexadatalabs-mexico-business-directory-denue",
        "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": {
          "keyword": {
            "title": "Keyword",
            "type": "string",
            "description": "Word(s) to search in Spanish, used by the keyword and radius modes. INEGI matches them against the business name, legal name, street, neighborhood, activity class, state, municipality and locality (for example \"dentista\", \"restaurantes\", \"ferreteria\", \"hotel\", \"farmacia\"); separate several words with a comma (\"consultorios,dentales\"). Use \"todos\" for everything. Cannot be combined with municipality, activityCode, employeeStratum or nameFilter (area mode): leave it empty or \"todos\" there and use nameFilter or activityCode instead.",
            "default": "todos"
          },
          "nameFilter": {
            "title": "Business name contains (area mode)",
            "type": "string",
            "description": "Substring of the establishment's trade name, e.g. \"oxxo\". Setting it switches to area mode (state + optional municipality / activityCode / employeeStratum), so \"state\" 19 + nameFilter \"oxxo\" returns every OXXO in Nuevo León. Cannot be combined with keyword or with a radius search."
          },
          "state": {
            "title": "State (entidad federativa)",
            "enum": [
              "00",
              "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"
            ],
            "type": "string",
            "description": "Two-digit INEGI state code. 00 = whole country.",
            "default": "00"
          },
          "municipality": {
            "title": "Municipality code (optional)",
            "pattern": "^\\d{3}$",
            "type": "string",
            "description": "Three-digit INEGI municipality code inside the selected state (for example 039 = Monterrey in Nuevo León 19, 015 = Cuauhtémoc in Ciudad de México 09). Requires a state. Find codes at https://www.inegi.org.mx/app/ageeml/"
          },
          "activityCode": {
            "title": "SCIAN activity code (optional)",
            "pattern": "^\\d{2,6}$",
            "type": "string",
            "description": "North American Industry Classification (SCIAN/NAICS) code with 2 to 6 digits: 2 = sector (e.g. 72 food services), 3 = subsector, 4 = industry group (rama), 6 = class (e.g. 722511 full-service restaurants). Narrows the search to that activity."
          },
          "latitude": {
            "title": "Latitude (optional, radius search)",
            "type": "string",
            "description": "Center of a radius search, e.g. 19.4326 (decimal degrees; a decimal comma is accepted). Set latitude, longitude and radiusMeters to search around a point instead of by area; both coordinates are required."
          },
          "longitude": {
            "title": "Longitude (optional, radius search)",
            "type": "string",
            "description": "e.g. -99.1332 (decimal degrees, negative for Mexico). Required together with latitude."
          },
          "radiusMeters": {
            "title": "Radius in meters",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Radius around the point for the radius search (only used when latitude and longitude are set). INEGI allows up to 5000 m.",
            "default": 1000
          },
          "employeeStratum": {
            "title": "Employee size (optional)",
            "enum": [
              "",
              "1",
              "2",
              "3",
              "4",
              "5",
              "6",
              "7"
            ],
            "type": "string",
            "description": "Filter by number of employees (INEGI stratum). Only applies to area searches (state / municipality / activity code)."
          },
          "maxResults": {
            "title": "Maximum results",
            "minimum": 1,
            "maximum": 500000,
            "type": "integer",
            "description": "Stop after this many establishments. You are charged per result, so this caps the cost.",
            "default": 500
          },
          "includeContactFields": {
            "title": "Include phone, email and website",
            "type": "boolean",
            "description": "DENUE publishes the establishment's phone, email and website. They are omitted by default; turn this on only if you have a lawful basis to use business contact data.",
            "default": false
          },
          "inegiToken": {
            "title": "INEGI API token (optional)",
            "type": "string",
            "description": "Your own free DENUE API token from https://www.inegi.org.mx/app/desarrolladores/generatoken/Usuarios/token_Verify . Leave empty to use the Actor's shared token, which all users of this Actor share and INEGI rate-limits; for large or scheduled jobs request your own."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}