{
  "openapi": "3.0.1",
  "info": {
    "title": "Mexico Company Directory – DENUE / INEGI Business Leads",
    "description": "Search Mexico's official DENUE (INEGI) business directory by SCIAN activity, state, municipality, employee size, keyword and radius. Filter to firms with phone, email or website. Watch mode for newly listed establishments. Clean lead-ready JSON/CSV.",
    "version": "0.1",
    "x-build-id": "U3CUSioTrljPW1u6Y"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/frankely84~mexico-denue-company-directory/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-frankely84-mexico-denue-company-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/frankely84~mexico-denue-company-directory/runs": {
      "post": {
        "operationId": "runs-sync-frankely84-mexico-denue-company-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/frankely84~mexico-denue-company-directory/run-sync": {
      "post": {
        "operationId": "run-sync-frankely84-mexico-denue-company-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": {
          "keywords": {
            "title": "Keywords (name, activity, colonia…)",
            "type": "array",
            "description": "Words to search in the establishment name, legal name, street, colonia or activity (SCIAN description). Separate searches are OR'd when used with the entity search. Examples: 'restaurante', 'ferretería', 'consultorio dental'. Leave empty to list by SCIAN / state / radius only.",
            "items": {
              "type": "string"
            }
          },
          "companyNames": {
            "title": "Company / trade names",
            "type": "array",
            "description": "Search by establishment name or razón social (e.g. 'OXXO', 'BIMBO'). Prefer this over keywords when you know the brand.",
            "items": {
              "type": "string"
            }
          },
          "activityKeywords": {
            "title": "Activity keyword filter (post-filter)",
            "type": "array",
            "description": "Optional. Keep only rows whose activity description or name contains one of these words (accent-insensitive substring), e.g. 'tacos', 'software', 'construcción'.",
            "items": {
              "type": "string"
            }
          },
          "scianCode": {
            "title": "SCIAN activity code",
            "type": "string",
            "description": "Official SCIAN code: 2 digits = sector (e.g. 72 lodging & food), 3 = subsector (722 food services), 4 = branch, 6 = class (722513 antojitos). Leave empty for all activities."
          },
          "state": {
            "title": "State (entidad federativa)",
            "type": "string",
            "description": "Mexican state as 2-digit code (09 = CDMX, 14 = Jalisco, 19 = Nuevo León) or name ('Jalisco', 'Ciudad de México', 'CDMX'). Leave empty for nationwide (slower)."
          },
          "municipalityCode": {
            "title": "Municipality (name or code)",
            "type": "string",
            "description": "Optional. 3-digit INEGI municipality code (e.g. 120) OR the official municipality / alcaldía name (e.g. 'Zapopan', 'Benito Juárez', 'San Pedro Garza García'). Names are accent-insensitive. Requires State. Empty or 0 = all municipalities in the state."
          },
          "employeeRanges": {
            "title": "Employee size (estrato)",
            "type": "array",
            "description": "Optional. Filter by DENUE employee-size brackets. Leave empty for all sizes.",
            "items": {
              "type": "string",
              "enum": [
                "1",
                "2",
                "3",
                "4",
                "5",
                "6",
                "7"
              ],
              "enumTitles": [
                "1 – 0 to 5 employees",
                "2 – 6 to 10 employees",
                "3 – 11 to 30 employees",
                "4 – 31 to 50 employees",
                "5 – 51 to 100 employees",
                "6 – 101 to 250 employees",
                "7 – 251+ employees"
              ]
            }
          },
          "latitude": {
            "title": "Latitude (for radius search)",
            "type": "number",
            "description": "Center latitude (WGS84). Use with Longitude and Radius. Example CDMX Zócalo: 19.4326."
          },
          "longitude": {
            "title": "Longitude (for radius search)",
            "type": "number",
            "description": "Center longitude (WGS84). Example CDMX Zócalo: -99.1332."
          },
          "radiusMeters": {
            "title": "Radius in meters (max 5,000)",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "Search radius around lat/lon. DENUE maximum is 5,000 m. 0 = do not use radius mode.",
            "default": 0
          },
          "onlyWithPhone": {
            "title": "Only with phone",
            "type": "boolean",
            "description": "Keep establishments that have a phone number in DENUE.",
            "default": false
          },
          "onlyWithEmail": {
            "title": "Only with email",
            "type": "boolean",
            "description": "Keep establishments that have an e-mail in DENUE.",
            "default": false
          },
          "onlyWithWebsite": {
            "title": "Only with website",
            "type": "boolean",
            "description": "Keep establishments that have a website in DENUE.",
            "default": false
          },
          "onlyWithContact": {
            "title": "Only with any contact (phone, email or website)",
            "type": "boolean",
            "description": "Lead-friendly filter: keep rows that have at least one of phone, e-mail or website. Combine with the stricter toggles above if needed.",
            "default": false
          },
          "listedInLastMonths": {
            "title": "Only listed in the last N months",
            "minimum": 0,
            "maximum": 120,
            "type": "integer",
            "description": "Optional. Keep establishments whose DENUE Fecha_Alta (listing month) is within the last N months. Useful to find newly registered businesses. 0 = no limit. Works best with area/SCIAN searches (radius results often omit Fecha_Alta).",
            "default": 0
          },
          "onlyNew": {
            "title": "Watch mode: only new since last run",
            "type": "boolean",
            "description": "Remembers establishment ids per Watch name and only outputs ones not seen before. Schedule daily/weekly to get alerts for newly appearing businesses; you pay only for new results.",
            "default": false
          },
          "monitorName": {
            "title": "Watch name",
            "type": "string",
            "description": "Name for this watch's memory so different watches do not share state, e.g. 'cdmx-restaurants'.",
            "default": "default"
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Cap on companies returned (and charged) per run.",
            "default": 100
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}