{
  "openapi": "3.0.1",
  "info": {
    "title": "Mexico Business Directory - INEGI DENUE Lookup",
    "description": "Search Mexico's official INEGI DENUE business directory (6M+ establishments) by name, keyword + state or GPS radius, or look up DENUE IDs. Get name, legal name, activity, size, full address, phone, email, website and coordinates. Official free API, no proxy. $1.50 per 1,000 results.",
    "version": "0.1",
    "x-build-id": "bwdSpkd8fyo1llUki"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/1rrock~mexico-denue-lookup/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-1rrock-mexico-denue-lookup",
        "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/1rrock~mexico-denue-lookup/runs": {
      "post": {
        "operationId": "runs-sync-1rrock-mexico-denue-lookup",
        "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/1rrock~mexico-denue-lookup/run-sync": {
      "post": {
        "operationId": "run-sync-1rrock-mexico-denue-lookup",
        "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": {
          "mode": {
            "title": "Lookup mode",
            "enum": [
              "auto",
              "ficha",
              "nombre",
              "buscar_entidad",
              "buscar"
            ],
            "type": "string",
            "description": "auto = pick the method from the fields you filled, in this order: DENUE Ids → Name → Latitude/Longitude → Keyword. Or force one: ficha (by DENUE Id), nombre (by name), buscar_entidad (keyword + state), buscar (lat/lon radius).",
            "default": "auto"
          },
          "ids": {
            "title": "DENUE Ids",
            "type": "array",
            "description": "Enter DENUE establishment Ids, one per line, for exact lookups (Ficha). In auto mode, Ids take priority over all other search fields.",
            "items": {
              "type": "string"
            }
          },
          "nombre": {
            "title": "Name / razón social",
            "type": "string",
            "description": "Enter word(s) from the business name or razón social, e.g. OXXO or FARMACIA. Used with Federal entity code. Ignored in auto mode when DENUE Ids are filled."
          },
          "condicion": {
            "title": "Keyword / condition",
            "type": "string",
            "description": "Keyword for keyword + state search or radius search, e.g. restaurantes, cafe, taller. Use 'todos' for all businesses.",
            "default": "todos"
          },
          "entidad": {
            "title": "Federal entity code",
            "type": "string",
            "description": "INEGI 2-digit state code: 01–32 (09 = Ciudad de México, 14 = Jalisco, 15 = Estado de México, 19 = Nuevo León). Use 00 for all states (name and keyword search).",
            "default": "09"
          },
          "limit": {
            "title": "Max records",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum establishments returned by name or keyword search (records 1…limit). Each record is one result.",
            "default": 10
          },
          "lat": {
            "title": "Latitude",
            "type": "number",
            "description": "Center latitude for radius search, e.g. 19.4326 (Zócalo, Mexico City)."
          },
          "lon": {
            "title": "Longitude",
            "type": "number",
            "description": "Center longitude for radius search, e.g. -99.1332."
          },
          "metros": {
            "title": "Radius (meters)",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Search radius in meters (INEGI max 5,000). Returns the establishments inside the circle, up to 'Max records (radius search)' (default 100); start small (100–300 m) in dense areas.",
            "default": 500
          },
          "maxItems": {
            "title": "Max records (radius search)",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum establishments returned by a radius (lat/lon) search. Dense areas can contain thousands of businesses; raise this for bigger jobs. Each record is one result.",
            "default": 100
          },
          "token": {
            "title": "INEGI DENUE API token",
            "type": "string",
            "description": "Optional. Your own free INEGI DENUE token (get it by email at https://www.inegi.org.mx/app/api/denue/tokenVerify/tokenverify.html). If empty, the Actor uses INEGI's public example token, which may be revoked at any time."
          },
          "delaySeconds": {
            "title": "Delay between requests (seconds)",
            "minimum": 0,
            "maximum": 30,
            "type": "number",
            "description": "Pause between API calls when looking up several DENUE Ids.",
            "default": 0.5
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}