{
  "openapi": "3.0.1",
  "info": {
    "title": "Mexico Business Directory (INEGI DENUE)",
    "description": "Mexican businesses from INEGI's official DENUE directory for companies and organizations: name, activity (SCIAN), size band, address, municipality, coordinates, phone, website, role mailbox. Filter by state, activity, size, postal code and registration month.",
    "version": "0.1",
    "x-build-id": "WdioLK3pfeBJxSsNX"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/darikami~mexico-business-directory/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-darikami-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/darikami~mexico-business-directory/runs": {
      "post": {
        "operationId": "runs-sync-darikami-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/darikami~mexico-business-directory/run-sync": {
      "post": {
        "operationId": "run-sync-darikami-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": "The states to read, one file each (the State of Mexico has two). Empty = all 32 states, in order, until the maximum is reached.",
            "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",
                "10 Durango",
                "11 Guanajuato",
                "12 Guerrero",
                "13 Hidalgo",
                "14 Jalisco",
                "15 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"
              ]
            }
          },
          "activityPrefixes": {
            "title": "Activity codes (SCIAN 2018)",
            "type": "array",
            "description": "The start of the SCIAN 2018 activity code, 2 to 6 digits. For example 722 restaurants, 4641 pharmacies, 541 professional services, 236 building construction. An establishment matches when its code starts with one of them.",
            "items": {
              "type": "string"
            }
          },
          "sizeBands": {
            "title": "Size (persons employed)",
            "type": "array",
            "description": "INEGI's size band. An establishment matches when it is in one of them.",
            "items": {
              "type": "string",
              "enum": [
                "0-5",
                "6-10",
                "11-30",
                "31-50",
                "51-100",
                "101-250",
                "251+"
              ],
              "enumTitles": [
                "0 to 5",
                "6 to 10",
                "11 to 30",
                "31 to 50",
                "51 to 100",
                "101 to 250",
                "251 and more"
              ]
            }
          },
          "municipality": {
            "title": "Municipality",
            "type": "string",
            "description": "The municipality exactly as INEGI writes it (for Mexico City, the alcaldía, for example Coyoacán). Accents and case do not matter."
          },
          "postalCode": {
            "title": "Postal code",
            "type": "string",
            "description": "A postal code of 5 digits."
          },
          "nameContains": {
            "title": "Name contains",
            "type": "string",
            "description": "A word or part of a word in the trade name or the legal name (2 to 60 characters)."
          },
          "registeredSince": {
            "title": "Registered in the directory since",
            "type": "string",
            "description": "A month YYYY-MM (or a date; the day is ignored): establishments that INEGI added to DENUE in that month or later."
          },
          "onlyWithEmail": {
            "title": "Only with an e-mail address",
            "type": "boolean",
            "description": "On: only establishments with a role mailbox such as ventas@ or contacto@. The actor delivers no other e-mail address.",
            "default": false
          },
          "maxEstablishments": {
            "title": "Maximum establishments",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "The run stops after this number of establishments. Each establishment is one charged result.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}